From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: key-binding values Date: Tue, 6 Sep 2005 10:15:03 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1126027317 21891 80.91.229.2 (6 Sep 2005 17:21:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2005 17:21:57 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 06 19:21:52 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECh8N-0007nL-NK for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 19:21:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EChCs-0001r8-O8 for ged-emacs-devel@m.gmane.org; Tue, 06 Sep 2005 13:26:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EChAH-0000qu-HQ for emacs-devel@gnu.org; Tue, 06 Sep 2005 13:23:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EChA8-0000jF-CJ for emacs-devel@gnu.org; Tue, 06 Sep 2005 13:23:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EChA8-0000hO-0N for emacs-devel@gnu.org; Tue, 06 Sep 2005 13:23:12 -0400 Original-Received: from [141.146.126.229] (helo=agminet02.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1ECh6L-0003c0-1B for emacs-devel@gnu.org; Tue, 06 Sep 2005 13:19:17 -0400 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet02.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j86HF5LP019750 for ; Tue, 6 Sep 2005 12:15:06 -0500 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j86HF5mO021210 for ; Tue, 6 Sep 2005 11:15:05 -0600 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-65.vpn.oracle.com [141.144.81.65]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id j86HF4w9021199 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 6 Sep 2005 11:15:05 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:42662 Archived-At: > Is this as good as can be expected - is there no way to get something more > readable for [?\C-\ ]? (key-description [67108896]) => "C-SPC" (key-description "\C- ") => "C-@" Yes, that's what key-description is for. My question was, "is this as good as can be expected from C-h v in this case?" I suppose the answer is "yes", because there is no way for describe-variable to know that this represents a key sequence and not an arbitrary string or vector. > Emacs users learn quickly to read "^@" as "control @", and they also > learn that this is equivalent to "control SPC", but [67108896] is hard > to read and digest. Keys are just integers in Emacs. There is nothing that makes any integer special wrt to keys. Characters, not key sequences, are integers. Some key sequences are characters (integers), but others are more complex events. And none of the ouput expressions "^@", [67108896], and [(control 32)], or the input expressions "\C- ", [?\C-\ ], and [(control ?\ )], is an integer. But this point is valid: There is nothing that makes a vector, string etc. special wrt a key. There is no way for C-h v to know that a given value is intended to represent a key sequence. > Also, correct me if I'm wrong, but my understanding is that the form [?\C- ] > is generally preferred over the form "\C- ", for a key binding. These two key sequences represent quite different bindings. You can't get one override the other, it depends on the terminal which key you receive on typing C-space. Whenever either is acceptable, is one of the two preferred in Emacs-Lisp code, for binding keys? My understanding was that the vector form was preferred. > If so, that makes matters worse in cases like this. > This form is good: > (defcustom my-key [(control ?\ )] "My key sequence.") Given all of the above, I would think that [(control ?\ )] should be the preferred syntax in code, whenever alternatives are equivalent. Both the source code and the C-h v output are clearer.