[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 Cx 8 RET. Orgmode 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 mathrelated
> symbols)
`Cx 8 RET' is extremely general, since it tries to handle all Unicode
chars.
Try library `ucscmds.el', here:
http://www.emacswiki.org/emacsen/download/ucscmds.el (code)
http://www.emacswiki.org/emacsen/UnicodeEncoding#ucscmds.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 `ucscmds.el' should be relevant
for your particular use cases:
(ucscmakecommands "^greek [az]+ letter") ; Greek characters
(ucscmakecommands "^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
`greeksmallletterlambda', which inserts a lowercase lambda character.
Another command so defined is `mathematicalboldfrakturcapitalr'.
Here is its doc string:
,
 mathematicalboldfrakturcapitalr is an interactive Lisp function.

 (mathematicalboldfrakturcapitalr ARG)

 Insert Unicode character `MATHEMATICAL BOLD FRAKTUR CAPITAL R'.
 This character has code point 120189.
`