From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Bug with S-Tab in keymaps Date: Mon, 5 May 2008 20:54:11 +0000 Message-ID: <20080505205411.GB1365@muc.de> References: <20080505141152.GA1365@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210019805 8055 80.91.229.12 (5 May 2008 20:36:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 May 2008 20:36:45 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 05 22:37:20 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jt7Qs-0000s2-PU for ged-emacs-devel@m.gmane.org; Mon, 05 May 2008 22:37:11 +0200 Original-Received: from localhost ([127.0.0.1]:34087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jt7QB-0006UJ-2G for ged-emacs-devel@m.gmane.org; Mon, 05 May 2008 16:36:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jt7Q7-0006UC-KO for emacs-devel@gnu.org; Mon, 05 May 2008 16:36:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jt7Q6-0006Tn-PH for emacs-devel@gnu.org; Mon, 05 May 2008 16:36:23 -0400 Original-Received: from [199.232.76.173] (port=55094 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jt7Q6-0006Tk-Je for emacs-devel@gnu.org; Mon, 05 May 2008 16:36:22 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jt7Q6-0000uv-3C for emacs-devel@gnu.org; Mon, 05 May 2008 16:36:22 -0400 Original-Received: (qmail 4794 invoked by uid 3782); 5 May 2008 20:34:51 -0000 Original-Received: from acm.muc.de (p57AF793A.dip.t-dialin.net [87.175.121.58]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 May 2008 22:34:44 +0200 Original-Received: (qmail 18802 invoked by uid 1000); 5 May 2008 20:54:11 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96533 Archived-At: Hi, Stefan! On Mon, May 05, 2008 at 02:07:53PM -0400, Stefan Monnier wrote: > > Should S-Tab be stored in a keymap as a symbol or a number? Or are both > > valid? Which is the canonical form? Where should the conversion from > > the uncanonical form to the canonical be done? > IIUC the canonical name of shift-tab in Emacs is `backtab'. > The conversion from various other terminal-specific representations > should be done in function-key-map. If it's not done there, please > report it as a bug. That's what I thought I was doing. I think the bug is that a symbol, here 'S-tab, is being used when there's a perfectly good ASCII char + bucky bit available. I also think the canonical form of a key sequence should be defined in the Elisp manual. (Yes, I know, I'm implicitly volunteering to do this.) Icicles actually uses the symbol 'S-tab. So, potentially, does a fair bit of other software. My own opinion, for what it's worth, is that read_key_sequence (in keyboard.c) and lookup-key (in keymap.c) should both massage the differences between #x2000009 and 'S-tab and 'S-TAB, somehow. I suppose even #x4000049 (&I + the control bucky bit) for the same thing is conceivable. Maybe `define-key' should canonicalise the key-sequences it's given before writing them into a keymap. In fact, `canonicalise-key-sequence' would be easy to write in Lisp, and could be called from all of read_key_sequence, lookup-key and define-key. What do you think? > Stefan -- Alan Mackenzie (Nuremberg, Germany).