emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `key-binding' and XEmacs-style events


From: David Kastrup
Subject: Re: `key-binding' and XEmacs-style events
Date: Fri, 02 Mar 2007 09:28:59 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux)

"Stuart D. Herring" <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]