From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Is there a canonical key for S-tab? Date: Wed, 14 Mar 2012 09:07:14 -0400 Message-ID: References: <87ipikis87.fsf@gmail.com> <877gz0iqp2.fsf@gmail.com> <87vcm77lhr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331730485 32005 80.91.229.3 (14 Mar 2012 13:08:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Mar 2012 13:08:05 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 14 14:08:02 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S7nvs-00078K-Mo for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2012 14:08:00 +0100 Original-Received: from localhost ([::1]:54314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7nvr-0002cw-Vn for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2012 09:07:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7nvR-0002GY-Vi for emacs-devel@gnu.org; Wed, 14 Mar 2012 09:07:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7nvI-0000tZ-8Z for emacs-devel@gnu.org; Wed, 14 Mar 2012 09:07:33 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:36648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7nvB-0000sR-9r; Wed, 14 Mar 2012 09:07:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9soXdS/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="167960167" Original-Received: from 108-161-119-82.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.161.119.82]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Mar 2012 09:07:14 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 826DFAE08D; Wed, 14 Mar 2012 09:07:14 -0400 (EDT) In-Reply-To: (Andreas Schwab's message of "Wed, 14 Mar 2012 10:25:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.183 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149039 Archived-At: >> I think this is a bug in kbd. It doesn't seem to handle TAB with >> modifiers right. > Looks correct for me: ELISP> (kbd "S-TAB") > [33554441] ELISP> (key-description (kbd "S-TAB")) > "S-TAB" ELISP> (eq (aref (kbd "S-TAB") 0) ?\S-\t) > t I think the problem is that it's nowhere defined what "correct" should be. The above shows that `kbd' is at least returning consistent results, but the way we handle events (especially events that can sometimes be represented by chars) is not always consistent. E.g. I don't think the C code together with the various remapping keymaps will ever generate a ?\S-\t char, instead they'll generate either an `S-tab' symbol, or a `backtab' symbol. Stefan PS: This reminds me of a related issue: we currently remap the `tab' symbol to ?\C-i, the `return' symbol to ?\C-m, largely for historical reasons. It would actually be better to do it the other way around (i.e. remap ttys's ?\C-i and ?\C-m to `tab' and `return'). One of the advantages is that a GUI-only user could then more easily bind `tab', `return', C-m, and C-i independently.