GNU bug report logs - #13948
no key-binding-locus

Previous Next

Package: emacs;

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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#13948: closed (no key-binding-locus)
Date: Thu, 12 Jun 2014 16:10:02 +0000
[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)]
From: Brian Malehorn <bmalehorn <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: no key-binding-locus
Date: Wed, 13 Mar 2013 16:34:48 -0400
[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)]
From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>,
 13948-done <at> debbugs.gnu.org, Brian Malehorn <bmalehorn <at> gmail.com>
Subject: Re: bug#13948: no key-binding-locus
Date: Thu, 12 Jun 2014 18:09:43 +0200
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.