How to enter Greek characters in Emacs

后端 未结 10 1322
说谎
说谎 2021-01-30 11:20

This page indicates that Greek letters can be inserted into Emacs by using M-i. However, Emacs 23.2.1 in a Debian Squeeze variant inserts the \"tab\" character when

相关标签:
10条回答
  • 2021-01-30 11:51

    To find out how to enter a single character that you already see somewhere on the screen, you can copy-paste that character to some emacs buffer/file, and then call M-x describe-char. With α, it yields

    [...] to input: type "C-x 8 RET 3b1" or "C-x 8 RET GREEK SMALL LETTER ALPHA" [...]
    

    PS: re your profile, try also ['a'] * 28

    0 讨论(0)
  • 2021-01-30 11:55

    C-x 8 RET, as described by @Daimrod above, is fine for a one-off insertion.

    If you want to bind a key to insert a given Unicode character: Load library ucs-cmds.el, then use C-1 C-x 8 RET. That inserts the character you choose and also creates a command with the same name, which you can bind to a key.

    For example, C-1 C-x 8 RET GREEK SMALL LETTER LAMBDA RET defines command greek-small-letter-lambda, which inserts that character when called.

    You can create multiple such commands at once, using macro ucsc-make-commands, also from ucs-cmds.el. For example, to create individual commands for each of the Greek letters, just do this:

      (ucsc-make-commands "^greek [a-z]+ letter")
    

    Then you can bind, say, command greek-small-letter-beta to C-c b or whatever:

      (global-set-key (kbd "C-c b") 'greek-small-letter-beta)
    
    0 讨论(0)
  • 2021-01-30 11:56

    You can set your input method to Greek:

    M-x set-input-method RET greek
    

    or

    C-x RET C-\ greek
    

    (which is the same). To set the input method back press C-\ (toggle-input-method).

    0 讨论(0)
  • 2021-01-30 12:01

    You can use ucs-insert bound to C-x8RET to insert any Unicode characters by name or by value.

    For example to insert a lambda you can do

    • C-x8RET GREEK SMALL LETTER LAMBDA RET → λ
    • C-x8RET 03bb RET → λ

    A tab-completion is also available.

    C-x8RET* lambdaTAB will list every unicode characters ended by a lambda.

    0 讨论(0)
提交回复
热议问题