emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#13948: closed (no key-binding-locus)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13948: closed (no key-binding-locus)
Date: Thu, 12 Jun 2014 16:10:02 +0000

Your message dated Thu, 12 Jun 2014 18:09:43 +0200
with message-id <address@hidden>
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
address@hidden)


-- 
13948: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13948
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: no key-binding-locus Date: Wed, 13 Mar 2013 16:34:48 -0400
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


--- End Message ---
--- Begin Message --- Subject: Re: bug#13948: no key-binding-locus Date: Thu, 12 Jun 2014 18:09:43 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux)
Stefan Monnier <address@hidden> 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.


--- End Message ---

reply via email to

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