emacs-devel
[Top][All Lists]
Advanced

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

(kbd) for key bindings (was: editor for large xml files?)


From: Steve Revilak
Subject: (kbd) for key bindings (was: editor for large xml files?)
Date: Wed, 17 Feb 2010 22:29:48 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

From: Tassilo Horn <address@hidden>

IMO, the recommended style for making keybindings should be `kbd', which
is available in Emacs, XEmacs, and SXEmacs.

So your 2 definitions would become:

 (global-set-key (kbd "<C-kp-divide>") 'My-Command)
 (global-set-key (kbd "C-x c")         'My-Other-Command)

That's quite easy to read and write (you can simply insert the string
describe-key outputs as argument to `kbd'), and it hides how an
implementation represents the key sequences internally.

I'd never heard of (kbd) before, but I like that representation a lot.
It's the same syntax that describe-key outputs, and it's also the same
syntax that people use when writing about emacs key bindings (e.g.,
the emacs tutorial).  If you understand what "C-x C-f" means, then you
basically know how to supply arguments to kbd.

Steve
(who just re-wrote all of his custom key bindings)

Attachment: pgpKxGwpWWqOQ.pgp
Description: PGP signature


reply via email to

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