From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel,gmane.emacs.help,gmane.emacs.bugs Subject: RE: read-key-sequence(-vector) on Shift left/right gives[left]/[right], not [S-left]/[S-right] ? Date: Tue, 7 Sep 2004 07:32:50 -0700 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <86isaqqonn.fsf@ketchup.de.uu.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1094567649 22320 80.91.224.253 (7 Sep 2004 14:34:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Sep 2004 14:34:09 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, rms@gnu.org, Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 07 16:33:52 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C4h2d-00048P-00 for ; Tue, 07 Sep 2004 16:33:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4h7r-00011S-B1 for ged-emacs-devel@m.gmane.org; Tue, 07 Sep 2004 10:39:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C4h7j-00010a-3E for emacs-devel@gnu.org; Tue, 07 Sep 2004 10:39:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C4h7h-00010I-67 for emacs-devel@gnu.org; Tue, 07 Sep 2004 10:39:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4h7h-000106-1w; Tue, 07 Sep 2004 10:39:05 -0400 Original-Received: from [141.146.126.231] (helo=agminet04.oracle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C4h1r-0001bT-W9; Tue, 07 Sep 2004 10:33:04 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.191.11]) by agminet04.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i87EWt4q023044; Tue, 7 Sep 2004 07:32:56 -0700 Original-Received: from rgmgw2.us.oracle.com (localhost [127.0.0.1]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i87EWtFu017806; Tue, 7 Sep 2004 08:32:55 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-65-166.vpn.oracle.com [141.144.65.166]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id i87EWsgx017773; Tue, 7 Sep 2004 08:32:55 -0600 Original-To: "Kai Grossjohann" , X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <86isaqqonn.fsf@ketchup.de.uu.net> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26853 gmane.emacs.help:20477 gmane.emacs.bugs:8954 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26853 From: Kai Grossjohann: > > (defun foo () > > (interactive) > > (let ((foo (read-key-sequence-vector "" ))) > > (message "foo: %s" foo))) > > > > Execute foo, press Shift+[left] or Shift+[right]. The message ([left] or > > [right]) shows that the Shift modifier is lost. > If S- is unbound, Emacs looks up the binding of . So are > S- and S- bound but S- and S- are unbound? > The reason for this is such that you can use most keybindings even > when caps lock is on. ------------8<----------------------- Thanks, Kai. That was the answer I couldn't find (S-left/right weren't bound). However: 1) Where is this (perhaps handy but inconsistent/exceptional) behavior documented? I haven't been able to find it in either the Emacs manual or the Emacs Lisp manual. Perhaps this should be mentioned in the Emacs manual at node Kinds of User Input? 2) Shouldn't it at least be documented in the doc strings of read-key-sequence and read-key-sequence-vector? The doc string mentions that button-down events are dropped, but it says nothing about dropping the shift modifier. Are these two functions the only ones affected by this exceptional convention? 3) The Emacs manual says, in node Window Handling Convenience Features and Customization: "Not all terminals support shifted arrow keys". Without knowing that the read-key-* functions drop the shift modifier if that key sequence is currently unbound, someone could easily think that the terminal just doesn't support shifted arrow keys. Convenience or confusion? 4) Is this really a good thing, anyway? If I want a command that reads key sequences, should I really have to pre-bind (and later unbind, to clean up) such "exceptional" keys, just to be able to read the input key sequence correctly (to see what the user pressed)? At the least, shouldn't there be an option in read-key-sequence and read-key-sequence-vector to _not_ ignore the shift modifier? 5) What does key binding have to do with reading key input? Shouldn't code be able to read user input without paying attention to key bindings (and whether or not keys are bound)? 6) This is inconsistent (also) with read-event, which DTRT in this regard. I guess that's what I would need to do in this case: read-event and then test for modifiers. But that seems heavy-handed if what I really want to do is just read a key sequence (read-key-sequence, read-key-sequence-vector). 7) If this is for the convenience of being able to use the keys with caps-lock on, as the manual says, then why not just pre-bind shift-* to the same binding as * (*= any key)? And let users know to do the same thing if they rebind keys. The current approach seems like the wrong way to deal with this. Thanks, Drew