jed-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Non-ascii chars in UTF-8 mode not bindable


G. Milde <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
>What is your method for inserting letters not found on the keyboard?

I tend to use the "digraph_cmd" function that I have bound to 
Ctrl-X 8.  I believe the emacs emulation also uses this binding.

I also use the code appended below for some other Unicode characters,
e.g., α = e²/â??c.  I generated this using \alpha=e\^2/\hbar c where the
backslashed items were converted to unicode using the latex_to_utf8
function, which I have bound to Ctrl-O.  --John

private variable Latex_To_UTF8_Map = Assoc_Type[String_Type, ""];
private define add_mapping (a, b)
{
   Latex_To_UTF8_Map[a] = b;
}

add_mapping ("Alpha", "\x{0391}");
add_mapping ("Beta", "\x{0392}");
add_mapping ("Gamma", "\x{0393}");
add_mapping ("Delta", "\x{0394}");
add_mapping ("Epsilon", "\x{0395}");
add_mapping ("Zeta", "\x{0396}");
add_mapping ("Eta", "\x{0397}");
add_mapping ("Theta", "\x{0398}");
add_mapping ("Iota", "\x{0399}");
add_mapping ("Kappa", "\x{039A}");
add_mapping ("Lamda", "\x{039B}");
add_mapping ("Mu", "\x{039C}");
add_mapping ("Nu", "\x{039D}");
add_mapping ("Xi", "\x{039E}");
add_mapping ("Omicron", "\x{039F}");
add_mapping ("Pi", "\x{03A0}");
add_mapping ("Rho", "\x{03A1}");
add_mapping ("Sigma", "\x{03A3}");
add_mapping ("Tau", "\x{03A4}");
add_mapping ("Upsilon", "\x{03A5}");
add_mapping ("Phi", "\x{03A6}");
add_mapping ("Chi", "\x{03A7}");
add_mapping ("Psi", "\x{03A8}");
add_mapping ("Omega", "\x{03A9}");

add_mapping ("alpha", "\x{03B1}");
add_mapping ("beta", "\x{03B2}");
add_mapping ("gamma", "\x{03B3}");
add_mapping ("delta", "\x{03B4}");
add_mapping ("epsilon", "\x{03B5}");
add_mapping ("zeta", "\x{03B6}");
add_mapping ("eta", "\x{03B7}");
add_mapping ("theta", "\x{03B8}");
add_mapping ("iota", "\x{03B9}");
add_mapping ("kappa", "\x{03BA}");
add_mapping ("lamda", "\x{03BB}");
add_mapping ("mu", "\x{03BC}");
add_mapping ("nu", "\x{03BD}");
add_mapping ("xi", "\x{03BE}");
add_mapping ("omicron", "\x{03BF}");
add_mapping ("pi", "\x{03C0}");
add_mapping ("rho", "\x{03C1}");
add_mapping ("sigma", "\x{03C3}");
add_mapping ("tau", "\x{03C4}");
add_mapping ("upsilon", "\x{03C5}");
add_mapping ("phi", "\x{03C6}");
add_mapping ("chi", "\x{03C7}");
add_mapping ("psi", "\x{03C8}");
add_mapping ("omega", "\x{03C9}");

add_mapping ("^0", "\x{2070}");
add_mapping ("^1", "\x{00B9}");
add_mapping ("^2", "\x{00B2}");
add_mapping ("^3", "\x{00B3}");
add_mapping ("^4", "\x{2074}");
add_mapping ("^5", "\x{2075}");
add_mapping ("^6", "\x{2076}");
add_mapping ("^7", "\x{2077}");
add_mapping ("^8", "\x{2078}");
add_mapping ("^9", "\x{2079}");
add_mapping ("^+", "\x{207A}");
add_mapping ("^-", "\x{207B}");
add_mapping ("^=", "\x{207C}");
add_mapping ("^(", "\x{207D}");
add_mapping ("^)", "\x{207E}");
add_mapping ("^n", "\x{207F}");

add_mapping ("_0", "\x{2080}");
add_mapping ("_1", "\x{2081}");
add_mapping ("_2", "\x{2082}");
add_mapping ("_3", "\x{2083}");
add_mapping ("_4", "\x{2084}");
add_mapping ("_5", "\x{2085}");
add_mapping ("_6", "\x{2086}");
add_mapping ("_7", "\x{2087}");
add_mapping ("_8", "\x{2088}");
add_mapping ("_9", "\x{2089}");
add_mapping ("_+", "\x{208A}");
add_mapping ("_-", "\x{208B}");
add_mapping ("_=", "\x{208C}");
add_mapping ("_(", "\x{208D}");
add_mapping ("_)", "\x{208E}");
add_mapping ("hbar", "\x{210F}");
add_mapping ("<=", "\x{2264}");
add_mapping (">=", "\x{2265}");
add_mapping ("<<", "\x{226A}");
add_mapping (">>", "\x{226B}");

define latex_to_utf8 ()
{
   push_mark ();
   bskip_chars ("-+=<>()a-zA-Z^_0-9");
   !if (blooking_at ("\\"))
     {
	pop_mark_1 ();
	return;
     }
   () = dupmark ();
   variable name = bufsubstr ();
   variable utf8 = Latex_To_UTF8_Map[name];
   if (utf8 == "")
     {
	pop_mark_1 ();
	return;
     }
   go_left_1 ();		       %  skip \\
   del_region ();
   insert (utf8);
}



  

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]