[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems binding odd C- & M-keys in Elisp
From: |
Kevin Rodgers |
Subject: |
Re: Problems binding odd C- & M-keys in Elisp |
Date: |
Thu, 09 Mar 2006 10:52:00 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
Joe Fineman wrote:
I can bind commands to the following odd combinations using M-x
global-set-key, but I cannot figure out how to express the same
bindings in Elisp for inclusion in .emacs:
C-; ("\C-\;" gives "Invalid modifier in string")
C-<tab> ("\C-\t" gives the same)
M-<left>
M-<up>
What am I missing?
The [Customizing] Key Bindings node of the Emacs manual has a subnode
called Init Rebinding (aka Rebinding Keys in Your Init File), which
explains that non-ASCII characters such as `C-;' and `C-TAB' must be
represented using the more general vector (vs. string) notation:
[?\C-;] and [?\C-\t]
[M-left] and [M-up]
Note that since <left> and <up> are function keys, not characters,
M-<left> and M-<right> are modified function keys, not characters.
The Changing Key Bindings node of the Emacs Lisp manual describes an
alternate syntax: '(control ?;) and '(control ?\t) or '(control tab)
'(meta left) and '(meta up)
Finally, there is the kbd function: (kbd "C-;") and (kbd "C-TAB")
(kbd "M-<left>") and (kbd "M-<up>")
--
Kevin Rodgers