From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: `key-binding' and XEmacs-style events Date: Fri, 02 Mar 2007 09:28:59 +0100 Message-ID: <853b4oaw1g.fsf@lola.goethe.zz> References: <36817.128.165.123.18.1172703473.squirrel@webmail.lanl.gov> <38667.128.165.123.18.1172788075.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172824224 6817 80.91.229.12 (2 Mar 2007 08:30:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Mar 2007 08:30:24 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , rms@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 02 09:30:18 2007 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 1HN39d-0005FY-Cx for ged-emacs-devel@m.gmane.org; Fri, 02 Mar 2007 09:30:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HN39c-0007Xv-Sv for ged-emacs-devel@m.gmane.org; Fri, 02 Mar 2007 03:30:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HN38S-0006Zq-LV for emacs-devel@gnu.org; Fri, 02 Mar 2007 03:29:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HN38R-0006Xv-5Z for emacs-devel@gnu.org; Fri, 02 Mar 2007 03:29:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HN38Q-0006Xj-T0 for emacs-devel@gnu.org; Fri, 02 Mar 2007 03:29:02 -0500 Original-Received: from mail-in-02.arcor-online.net ([151.189.21.42]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HN38P-00051Q-5s; Fri, 02 Mar 2007 03:29:01 -0500 Original-Received: from mail-in-14-z2.arcor-online.net (mail-in-14-z2.arcor-online.net [151.189.8.31]) by mail-in-02.arcor-online.net (Postfix) with ESMTP id E208F2D9E54; Fri, 2 Mar 2007 09:28:59 +0100 (CET) Original-Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by mail-in-14-z2.arcor-online.net (Postfix) with ESMTP id C90A0100BE; Fri, 2 Mar 2007 09:28:59 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-009-095.pools.arcor-ip.net [84.61.9.95]) by mail-in-06.arcor-online.net (Postfix) with ESMTP id 9ADA935E50D; Fri, 2 Mar 2007 09:28:59 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 30F671C4D3B2; Fri, 2 Mar 2007 09:28:59 +0100 (CET) In-Reply-To: <38667.128.165.123.18.1172788075.squirrel@webmail.lanl.gov> (Stuart D. Herring's message of "Thu\, 1 Mar 2007 14\:27\:55 -0800 \(PST\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 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:67206 Archived-At: "Stuart D. Herring" writes: > We're talking about going the other way -- supporting (key-binding [(?a)]) > in Emacs (I don't know what XEmacs thinks of event-lists with no > modifiers). The simplest fix seems to be to move the check that the list > is at least two long before the code that uses its first element as a > symbol: > > *** keymap.c.~1.345.~ 2007-02-08 09:45:05.000000000 -0700 > --- keymap.c 2007-03-01 15:26:32.000000000 -0700 > *************** > *** 1612,1621 **** > > /* We are not interested in locations without event data */ > > ! if (EVENT_HAS_PARAMETERS (event)) > { > Lisp_Object kind = EVENT_HEAD_KIND (EVENT_HEAD (event)); > ! if (CONSP (XCDR (event)) && EQ (kind, Qmouse_click)) > position = EVENT_START (event); > } > } > --- 1612,1621 ---- > > /* We are not interested in locations without event data */ > > ! if (EVENT_HAS_PARAMETERS (event) && CONSP (XCDR (event))) > { > Lisp_Object kind = EVENT_HEAD_KIND (EVENT_HEAD (event)); > ! if (EQ (kind, Qmouse_click)) > position = EVENT_START (event); > } > } > > That will still die on (key-binding [(?a ?b)]), but that's meaningless > anyway. As the one who has been responsible for that piece of code originally: it more or less tried to use enough clues to figure out the right meaning of a sequence. These tests fall short of completely guaranteeing that their _is_ a proper sequence to be interpreted, the idea is that something will just throw an error in case it isn't. Extending the cases seems certainly reasonable as long as one makes sure that other occurences of EVENT_HAS_PARAMETERS will interpret the same sequence in the same manner. It might possibly even make sense to change EVENT_HAS_PARAMETERS itself to cater for such cases. Can those sequences come about in any manner except by manually specifying them? Is this format documented anywhere? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum