summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-04-01 15:58:29 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-04-01 15:58:29 +0000
commitbee27b4de3823c2171f36a32ce33b8ff62f0bd1b (patch)
tree7363c91980422b2ea5a749d9d6892d0df46cabd4
parent50fcc3999b8d3c696cf53a1e459963fbe87addf7 (diff)
downloademacs-bee27b4de3823c2171f36a32ce33b8ff62f0bd1b.tar.gz
emacs-bee27b4de3823c2171f36a32ce33b8ff62f0bd1b.tar.bz2
emacs-bee27b4de3823c2171f36a32ce33b8ff62f0bd1b.zip
(where_is_internal): Scan provided keymaps for command remappings
rather than calling Fcommand_remapping.
-rw-r--r--src/keymap.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 731c42dd9d4..501f4683398 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2579,15 +2579,6 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
/* 1 means ignore all menu bindings entirely. */
int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
- /* If this command is remapped, then it has no key bindings
- of its own. */
- if (NILP (no_remap) && SYMBOLP (definition))
- {
- Lisp_Object tem;
- if (tem = Fcommand_remapping (definition, Qnil), !NILP (tem))
- return Qnil;
- }
-
found = keymaps;
while (CONSP (found))
{
@@ -2601,6 +2592,22 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
found = Qnil;
sequences = Qnil;
+ /* If this command is remapped, then it has no key bindings
+ of its own. */
+ if (NILP (no_remap) && SYMBOLP (definition))
+ {
+ Lisp_Object kmaps, map, remap;
+
+ for (kmaps = maps; !NILP (kmaps); kmaps = Fcdr (kmaps))
+ if (map = Fcdr (Fcar (kmaps)), KEYMAPP (map))
+ {
+ ASET (command_remapping_vector, 1, definition);
+ remap = Flookup_key (map, command_remapping_vector, Qnil);
+ if (!NILP (remap) && !INTEGERP (remap))
+ RETURN_UNGCPRO (Qnil);
+ }
+ }
+
for (; !NILP (maps); maps = Fcdr (maps))
{
/* Key sequence to reach map, and the map that it reaches */