all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: herring@lanl.gov
Cc: emacs-devel@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	rms@gnu.org
Subject: Re: `key-binding' and XEmacs-style events
Date: Fri, 02 Mar 2007 09:28:59 +0100	[thread overview]
Message-ID: <853b4oaw1g.fsf@lola.goethe.zz> (raw)
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\)")

"Stuart D. Herring" <herring@lanl.gov> 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

  parent reply	other threads:[~2007-03-02  8:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 22:57 `key-binding' and XEmacs-style events Stuart D. Herring
2007-03-01  8:14 ` Richard Stallman
2007-03-01 15:19   ` Stefan Monnier
2007-03-01 22:27     ` Stuart D. Herring
2007-03-01 23:35       ` Kim F. Storm
2007-03-01 23:52         ` Stuart D. Herring
2007-03-02  8:31           ` David Kastrup
2007-03-04  6:13             ` Stuart D. Herring
2007-03-02  8:26       ` Richard Stallman
2007-03-02  8:46         ` David Kastrup
2007-03-02 23:46           ` Richard Stallman
2007-03-03  7:40             ` David Kastrup
2007-03-04  2:00               ` Richard Stallman
2007-03-04  6:27                 ` Stuart D. Herring
2007-03-06 17:06           ` Stuart D. Herring
2007-03-02  8:28       ` David Kastrup [this message]
2007-03-02  3:28     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=853b4oaw1g.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.