all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Óscar Fuentes" <ofv@wanadoo.es>, help-gnu-emacs@gnu.org
Subject: RE: Writing source code with Unicode characters
Date: Thu, 6 Feb 2014 10:48:56 -0800 (PST)	[thread overview]
Message-ID: <e08cc8dc-a917-47a0-9d44-c0ff1ca61413@default> (raw)
In-Reply-To: <87zjm4qeqi.fsf@wanadoo.es>

> 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.
`----



  parent reply	other threads:[~2014-02-06 18:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 18:26 Writing source code with Unicode characters Óscar Fuentes
2014-02-06 18:45 ` Eli Zaretskii
2014-02-06 18:48 ` Drew Adams [this message]
2014-02-06 19:23 ` Göktuğ Kayaalp
2014-02-06 20:38 ` Óscar Fuentes
2014-02-06 22:59   ` Drew Adams
2014-02-07  0:32 ` Florian Beck
     [not found] <mailman.13962.1391711236.10748.help-gnu-emacs@gnu.org>
2014-02-06 20:36 ` Eric Wolf
2014-02-07  2:52 ` Rusi
2014-02-07 16:41   ` Rusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e08cc8dc-a917-47a0-9d44-c0ff1ca61413@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ofv@wanadoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.