help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Writing source code with Unicode characters


From: Drew Adams
Subject: RE: Writing source code with Unicode characters
Date: Thu, 6 Feb 2014 10:48:56 -0800 (PST)

> I'll like to experiment with using Unicode on source code (λ instead
> of lambda, etc) but it seems quite inconvenient to insert those chars
> with C-x 8 RET. Org-mode has the capability of displaying λ when you type
> \lambda, but that's just a display replacement, the raw text still
> is \lambda.
> 
> What can I use to make more convenient the insertion of Unicode
> chars? (I'm mostly interested on Greek letters and other math-related
> symbols)

`C-x 8 RET' is extremely general, since it tries to handle all Unicode
chars.

Try library `ucs-cmds.el', here:
http://www.emacswiki.org/emacs-en/download/ucs-cmds.el (code)
http://www.emacswiki.org/emacs-en/UnicodeEncoding#ucs-cmds.el (description)

Use it to define commands that insert particular Unicode chars that
you use most of the time.  Then bind those commands to keys if you
want.

These examples from the Commentary in `ucs-cmds.el' should be relevant
for your particular use cases:

(ucsc-make-commands "^greek [a-z]+ letter") ; Greek characters
(ucsc-make-commands "^math")                ; Math symbols

Those define individual commands that insert the Greek chars and the
Unicode math symbols.

For example, one of those commands that gets defined is
`greek-small-letter-lambda', which inserts a lowercase lambda character.

Another command so defined is `mathematical-bold-fraktur-capital-r'.
Here is its doc string:

,----
| mathematical-bold-fraktur-capital-r is an interactive Lisp function.
| 
| (mathematical-bold-fraktur-capital-r ARG)
|  
| Insert Unicode character `MATHEMATICAL BOLD FRAKTUR CAPITAL R'.
| This character has code point 120189.
`----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]