unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Cc: 13948@debbugs.gnu.org, Brian Malehorn <bmalehorn@gmail.com>
Subject: bug#13948: no key-binding-locus
Date: Mon, 02 Jun 2014 09:55:26 -0400	[thread overview]
Message-ID: <jwvsinn77in.fsf-monnier+bug#13948@gnu.org> (raw)
In-Reply-To: <87k38zipmh.fsf@geodiff-mac3.ulb.ac.be> (Nicolas Richard's message of "Mon, 02 Jun 2014 12:15:34 +0200")

>> 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.
> IIUC, it's slightly more complicated than just modifying the return
> value of a function.

Indeed, the code was not written with this in mind.  E.g. looking up
"C-c C-s" first looks up "C-c" which returns a new keymap which combines
the C-c part of all the active keymaps, and then we lookup C-s in that
"composed" map.

Tracking the origin would require changing the data representation
(which is visible to ELisp), so it could be tricky to do without
breaking compatibility (tho we do such risky changes on a regular
basis ;-)

> Another reason is that some keymaps might not even be stored in any
> variable (symbol's value cell) at all.

Yes, keeping track of the original keymap in which the binding is found
is one thing, but keeping track of where that keymap is coming from is
yet another.

I'd welcome a change in C-h k to try and show where the binding comes
from, and it'd be OK to implement it with the kind of code you showed
(i.e. something not 100% reliable).


        Stefan





  reply	other threads:[~2014-06-02 13:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 20:34 bug#13948: no key-binding-locus Brian Malehorn
2013-04-23 19:41 ` Josh
2014-06-02 10:15 ` Nicolas Richard
2014-06-02 13:55   ` Stefan Monnier [this message]
2014-06-04 10:51     ` Nicolas Richard
2014-06-04 13:50       ` Stefan Monnier
2014-06-04 14:00         ` Nicolas Richard
2014-06-04 14:20           ` Stefan Monnier
2014-06-06 17:57             ` Nicolas Richard
2014-06-06 18:27               ` Stefan Monnier
2014-06-10 19:46                 ` Nicolas Richard
2014-06-10 22:24                   ` Stefan Monnier
2014-06-11 11:23                     ` Nicolas Richard
2014-06-11 18:06                       ` Stefan Monnier
2014-06-11 20:20                         ` Nicolas Richard
2014-06-11 22:00                           ` Stefan Monnier
2014-06-12  8:16                           ` Nicolas Richard
2014-06-12 16:09                     ` Nicolas Richard

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwvsinn77in.fsf-monnier+bug#13948@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=13948@debbugs.gnu.org \
    --cc=bmalehorn@gmail.com \
    --cc=theonewiththeevillook@yahoo.fr \
    /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 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).