unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A bug, I think, in key-binding
@ 2006-08-08 22:47 David Kastrup
  2006-08-09  4:58 ` Richard Stallman
  0 siblings, 1 reply; 11+ messages in thread
From: David Kastrup @ 2006-08-08 22:47 UTC (permalink / raw)



Hi, we have

    read-key-sequence is a built-in function in `src/keyboard.c'.
    (read-key-sequence PROMPT &optional CONTINUE-ECHO DONT-DOWNCASE-LAST
    CAN-RETURN-SWITCH-FRAME COMMAND-LOOP)

    Read a sequence of keystrokes and return as a string or vector.
    The sequence is sufficient to specify a non-prefix command in the
    current local and global maps.

    [...]

    If the key sequence starts with a mouse click, then the sequence is read
    using the keymaps of the buffer of the window clicked in, not the buffer
    of the selected window as normal.

    [...]

`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.

But if we take a look at `key-binding':

    key-binding is a built-in function in `src/keymap.c'.
    (key-binding KEY &optional ACCEPT-DEFAULT NO-REMAP)

    Return the binding for command KEY in current keymaps.
    KEY is a string or vector, a sequence of keystrokes.

    [...]

we will find that the same expression "current keymaps" suddenly fails
to include mouse-activated maps even for click events.

As a result, you can't reliably feed the output of `read-key-sequence'
into `key-binding': the meaning differs.

I think this is a mistake.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-08-22 16:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).