From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: keybinding with shift key syntax. C-S-n vs C-N Date: Wed, 17 Sep 2008 15:51:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <8ad1d6ac-9b4e-492c-82fe-79b630a2b116@b30g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1221694845 14591 80.91.229.12 (17 Sep 2008 23:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Sep 2008 23:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 01:41:42 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kg6eR-0002QV-M6 for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Sep 2008 01:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:50151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg6dQ-0001fm-GZ for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Sep 2008 19:40:36 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v39g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 89 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1221691916 11104 127.0.0.1 (17 Sep 2008 22:51:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 17 Sep 2008 22:51:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v39g2000pro.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:162403 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57745 Archived-At: A emacs developer Chong Yidong replied to my bug report. Chong wrote: =C2=AB 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. =C2=BB 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+=E2=80=B9letter=E2=80=BA = keybinding used in macro is not consistant. For Meta, "-N" is effective but for Control, "-S-n" is effective. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Sep 16, 12:35=C2=A0pm, Xah wrote: > On Sep 15, 12:44 pm, Oleksandr Gavenko wrote: > > > I try all write. Same behavior > > (GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE). > > > (global-set-key (kbd "M-S-n") 'f1) do not define key binding, but > > (global-set-key (kbd "M-n") 'f2) do for both M-n and M-N. > > I might have miscommunicated. I try again: > > I want to define a keybinding with the Shift down. e.g. Ctrl+Shift+n. > > In emacs, it appears there are 2 notations that can be used. > > 1. (kbd "C-S-n") > 2. (kbd "C-N") > > however, this does not seems to work property. > > =C2=A0Xah > =E2=88=91http://xahlee.org/ > > =E2=98=84 > > --------------------- > > 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 > 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 > but not (kbd "M-S-n"). > > I filed a bug but no response. Can anyone reproduce this? > > =C2=A0Xah > =E2=88=91http://xahlee.org/ > =E2=98=84