Subject: bug#966 closed by Chong Yidong <[email-masked]> (keybinding involving Ctrl and Shift and letter)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#966: keybinding involving Ctrl and Shift and letter

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
966: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=966
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Wed Sep 17 13:04:52 2008
From: Chong Yidong <[email-masked]>
To: xah lee <[email-masked]>
Cc: [email-masked]
Subject: keybinding involving Ctrl and Shift and letter
Date: Wed, 17 Sep 2008 16:08:31 -0400

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

>From [email-masked] Thu Sep 11 20:46:28 2008
To: [email-masked]
From: xah lee <[email-masked]>
Subject: keybinding involving Ctrl and Shift and letter
Date: Thu, 11 Sep 2008 20:46:22 -0700

This seems to be a bug.

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 =20=

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. That is (kbd "M-N") works =20
but not (kbd "M-S-n").

   Xah
=E2=88=91 http://xahlee.org/

=E2=98=84

In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0)
  of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp
Windowing system distributor `Apple Inc.', version 10.4.11
configured using `configure  '--prefix=3D/Applications/Emacs.app/=20
Contents/Resources' '--with-carbon' '--without-x' '--libexecdir=3D/=20
Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' 'CFLAGS=3D-Os -arch =20
i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DUSE_ATSUI -=20=

DUSE_MAC_TSM''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: nil
   locale-coding-system: iso-8859-1
   default-enable-multibyte-characters: t

=E2=98=84