GNU bug report logs -
#966
keybinding involving Ctrl and Shift and letter
Previous Next
Reported by: xah lee <xah <at> xahlee.org>
Date: Fri, 12 Sep 2008 03:55:05 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 966-done <at> emacsbugs.donarmstrong.com (full text, mbox):
umm...
thanks for the answer.
I think there is still a problem, that is, inconsistency with the
meta notation.
Namely, when defining a key with Ctrl or Meta with a Shift and a
letter, when it is Meta,
(global-set-key (kbd "M-N") 'f)
works but
(global-set-key (kbd "M-S-n") 'f) does not work.
But with Ctrl, it is the the other way around.
Shouldn't emacs make "M-S-n" notation work and not "M-N", so that it
is consistant with the Control?
In summary, the notation for a Meta/Control+Shift+‹letter›
keybinding used in macro is not consistant. For Meta, "-N" is
effective but for Control, "-S-n" is effective.
Xah
∑ http://xahlee.org/
☄
On Sep 17, 2008, at 1:08 PM, Chong Yidong wrote:
> i'm trying to set keybindings for both Ctrl+n and Ctrl+Shift+n, by:
>
> (global-set-key (kbd "C-N") 'f1)
> (global-set-key (kbd "C-n") 'f2)
>
> however, that doesn't work.
> Emacs will take both Ctrl+Shift+n and Ctrl+Shift+n to be whichever is
> evaluated last. In this case, f2.
>
> But the following works:
>
> (global-set-key (kbd "C-S-n") 'f1)
> (global-set-key (kbd "C-n") 'f2)
>
> This seems to contradict with Meta's ways.
This is a legacy of ASCII. Taking a look at an ASCII chart, you'll see
that ^A (control-a) through ^Z (control-z) map to ASCII codes 1 through
26, and these control keys are not case sensitive: control-a is
equivalent to control-A.
Emacs extends ASCII, which allows us to define things like C-] which are
not present in ASCII. However, (kbd "C-N") and (kbd "C-n") still both
evaluate to ^N.
☄
This bug report was last modified 16 years and 248 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.