GNU bug report logs -
#13948
no key-binding-locus
Previous Next
Reported by: Brian Malehorn <bmalehorn <at> gmail.com>
Date: Wed, 13 Mar 2013 21:22:02 UTC
Severity: wishlist
Done: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 12 Jun 2014 18:09:43 +0200
with message-id <87mwdi2jp4.fsf <at> yahoo.fr>
and subject line Re: bug#13948: no key-binding-locus
has caused the debbugs.gnu.org bug report #13948,
regarding no key-binding-locus
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
13948: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13948
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Why isn't there a key equivalent to variable-binding-locus? As
in, a way to figure out where a particular keybinding is coming
from. For example,
M-x key-binding-locus C-j
would evaluate to 'lisp-interaction-mode-map, which is the first
map in which C-j was found.
In terms of implementation, the process for finding a binding is
described in (info "(elisp) Searching Keymaps"):
...Here is a pseudo-Lisp description of the order and
conditions for searching them:
(or (cond
(overriding-terminal-local-map
(FIND-IN overriding-terminal-local-map))
(overriding-local-map
(FIND-IN overriding-local-map))
((or (FIND-IN (get-char-property (point) 'keymap))
(FIND-IN-ANY emulation-mode-map-alists)
(FIND-IN-ANY minor-mode-overriding-map-alist)
(FIND-IN-ANY minor-mode-map-alist)
(if (get-text-property (point) 'local-map)
(FIND-IN (get-char-property (point) 'local-map))
(FIND-IN (current-local-map))))))
(FIND-IN (current-global-map)))
So implementing key-binding-locus would only be a small tweak of
the key lookup code: the first time you find the key, just return
the map you found it in, rather than the command it's supposed to
call.
Thanks,
Brian
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> Here's another attempt. Like the previous patch, I define
>> key-binding-keymap which finds the keymap by mimicking key-binding, and
>> describe-key--binding-locus which matches the keymap to a symbol and
>> makes a description suitable for describe-key.
>
> Looks pretty good. Feel free to install it into `trunk'.
It seems I have done that in revision 117324 (thanks to vc.el)
--
Nico.
This bug report was last modified 10 years and 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.