all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: A bug, I think, in key-binding
Date: Wed, 09 Aug 2006 09:03:57 +0200	[thread overview]
Message-ID: <85hd0m75lu.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1GAg9S-0003XD-EU@fencepost.gnu.org> (Richard Stallman's message of "Wed, 09 Aug 2006 00:58:42 -0400")

Richard Stallman <rms@gnu.org> writes:

>     `read-key-sequence', although the DOC string does not mention it, will
>     also substitute any mouse-activated maps for the buffer-local maps, if
>     they are present and a click event is used.
>
> What do you mean by "mouse-activated maps"?  Do you mean keymaps that
> come from properties that apply to the character that was clicked
> on?

Keymaps on display properties, before-string properties and
after-string properties.

> The way we describe that feature is that the location of the click
> overrides point for choosing the character whose properties should
> be used.

I was not able to glean that from the DOC string.

>     But if we take a look at `key-binding':
>
>     we will find that the same expression "current keymaps" suddenly fails
>     to include mouse-activated maps even for click events.
>
> That is true.  But I think key-binding MUST do what it now does.
> That is an essential primitive for accessing keymaps.

So it is quite lamentable that its current implementation does not do
the trick.  The command loop could not get implemented using it.
Instead, read-key-sequence stashes the looked-up command away in a
secret internal variable where the command loop retrieves it.  While
it is efficient to avoid the double lookup (read-key-sequence has to
know how to combine primitive events to a sequence, and that requires
the maps), it also makes key-binding pretty much a sham: it is neither
used nor usable for its central purpose in the command loop.

> Perhaps we should have a function to do lookup on a key sequence
> just the same way the command loop does.  That can be written in
> Lisp; it just has to see if the first event is a mouse even, and
> move point there inside save-excursion.
>
> What do you think of this solution?

It is not sufficient to relocate point temporarily (I believe this
might actually already be done), since the maps of mouse clicks depent
on the actual screen position, not just the point position, of a mouse
click.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

      parent reply	other threads:[~2006-08-09  7:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08 22:47 A bug, I think, in key-binding David Kastrup
2006-08-09  4:58 ` Richard Stallman
2006-08-09  5:18   ` Stefan Monnier
2006-08-10  1:13     ` Richard Stallman
2006-08-17  6:02     ` Richard Stallman
2006-08-17 14:48       ` Stefan Monnier
2006-08-18 15:47         ` Richard Stallman
2006-08-18 11:02       ` David Kastrup
2006-08-22 15:41         ` Richard Stallman
2006-08-22 16:39           ` David Kastrup
2006-08-09  7:03   ` David Kastrup [this message]

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=85hd0m75lu.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@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.