Lacking Natural Simplicity

Random musings on books, code, and tabletop games.

Defining keys in the C-x 8 prefix keymap

Yay! I finally found it!

Suppose you hate typing “C-x 8 RET GREEK SMALL LETTER LAMBDA” to insert a lowercase lambda character in emacs (perhaps because you have a dull American keyboard and aren't very savvy to input methods). You can add a key definition to the “C-x 8 prefix keymap”, say “gl”, so you can type “C-x 8 g l” and insert a lowercase lambda.

Here's how you might do it for “λ”, “Λ”, and “§”:

(load-library "iso-transl.el")
(iso-transl-define-keys '(("gl" . [?λ])   ; greek lowercase lambda
                          ("gL" . [?Λ])   ; greek uppercase lambda
                          ("ps" . [?§]))) ; punctuation SECTION SIGN
Print Friendly and PDF

Comments

Comments powered by Disqus