emacs-devel
[Top][All Lists]
Advanced

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

Re: Proposal: Remap interactive commands via keymaps


From: Kim F. Storm
Subject: Re: Proposal: Remap interactive commands via keymaps
Date: 24 Jan 2002 01:19:41 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

address@hidden (Kim F. Storm) writes:

> I've started adding this, and it is actually very simple.
> Basically, I just need to call Fkey_binding at the right place
> in command_loop_1.

This is indeed the simple part of adding this feature.
However, other functions also need to support this.

Notably, key-binding must itself remap the command through the active
keymaps.  To do this, key-binding has to call itself, and to avoid
recursion, I added a third optional argument NO_REMAP to it -
specificially to make the final remapping of the command (including
from command_loop_1.  This works now.

So things like C-h k now reports the correct command run by a
key sequence.


Another function which needs tweaking is  where-is-internal.

Currently, if I remap, say list-buffers to switch-to-buffer,
and I do C-h w switch-to-buffer, it will report 
 switch-to-buffer is on <list-buffers>, C-x b
rather than
 switch-to-buffer is on C-x C-b, C-x b

The first form is definitely wrong, since M-x list-buffers
will NOT run switch-to-buffer (recalling our discussion
on this subject).

I think it would be simplest (but not trivial) to modify
where-is-internal to call itself when it encounters a
symbol with a function binding (i.e. symbolp and commandp
are both true) to find key bindings for that command.

Again, this should not be done recursively, so I guess
I need to add a NO_REMAP argument to where-is-internal
too.


Any other commands which must be modified?
Any other ideas?


-- 
Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

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