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

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

RE: .emacs poser


From: Drew Adams
Subject: RE: .emacs poser
Date: Mon, 16 Dec 2013 18:46:47 -0800 (PST)

> In my emacs I have these global-set-key forms:
> (global-set-key "\C-cg" (lambda () (interactive) (insert  ?° )))
> (global-set-key "\C-ch" (lambda () (interactive)  (insert  ?·)))

An easy way to define commands that insert individual Unicode chars
that you use often is to use library `ucs-cmds.el'.

* Command `ucsc-insert' does the same as `insert-char': inserts a
  char you choose by its Unicode name (or hex code) using completion.
  But with a negative prefix arg it also defines a command with the
  same name.

* Macro `ucs-make-commands' defines a whole set of such commands,
  based on a regexp that is matched against all Unicode char names.

You can then bind the commands to keys.  E.g.:

  C-- M-x ucsc-insert greek small letter lambda RET

defines command `greek-small-letter-lambda', which inserts that
character (or N such chars, where N is the prefix arg).

Then: (global-set-key "\C-cl 'greek-small-letter-lambda).

http://www.emacswiki.org/emacs-en/download/ucs-cmds.el

http://www.emacswiki.org/emacs/UnicodeEncoding#ucsc-insert



reply via email to

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