diff options
| author | Chong Yidong | 2007-04-01 15:58:29 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-04-01 15:58:29 +0000 |
| commit | bee27b4de3823c2171f36a32ce33b8ff62f0bd1b (patch) | |
| tree | 7363c91980422b2ea5a749d9d6892d0df46cabd4 /src/keymap.c | |
| parent | 50fcc3999b8d3c696cf53a1e459963fbe87addf7 (diff) | |
| download | emacs-bee27b4de3823c2171f36a32ce33b8ff62f0bd1b.tar.gz emacs-bee27b4de3823c2171f36a32ce33b8ff62f0bd1b.zip | |
(where_is_internal): Scan provided keymaps for command remappings
rather than calling Fcommand_remapping.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 25 |
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) | |||
| 2579 | /* 1 means ignore all menu bindings entirely. */ | 2579 | /* 1 means ignore all menu bindings entirely. */ |
| 2580 | int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii); | 2580 | int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii); |
| 2581 | 2581 | ||
| 2582 | /* If this command is remapped, then it has no key bindings | ||
| 2583 | of its own. */ | ||
| 2584 | if (NILP (no_remap) && SYMBOLP (definition)) | ||
| 2585 | { | ||
| 2586 | Lisp_Object tem; | ||
| 2587 | if (tem = Fcommand_remapping (definition, Qnil), !NILP (tem)) | ||
| 2588 | return Qnil; | ||
| 2589 | } | ||
| 2590 | |||
| 2591 | found = keymaps; | 2582 | found = keymaps; |
| 2592 | while (CONSP (found)) | 2583 | while (CONSP (found)) |
| 2593 | { | 2584 | { |
| @@ -2601,6 +2592,22 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) | |||
| 2601 | found = Qnil; | 2592 | found = Qnil; |
| 2602 | sequences = Qnil; | 2593 | sequences = Qnil; |
| 2603 | 2594 | ||
| 2595 | /* If this command is remapped, then it has no key bindings | ||
| 2596 | of its own. */ | ||
| 2597 | if (NILP (no_remap) && SYMBOLP (definition)) | ||
| 2598 | { | ||
| 2599 | Lisp_Object kmaps, map, remap; | ||
| 2600 | |||
| 2601 | for (kmaps = maps; !NILP (kmaps); kmaps = Fcdr (kmaps)) | ||
| 2602 | if (map = Fcdr (Fcar (kmaps)), KEYMAPP (map)) | ||
| 2603 | { | ||
| 2604 | ASET (command_remapping_vector, 1, definition); | ||
| 2605 | remap = Flookup_key (map, command_remapping_vector, Qnil); | ||
| 2606 | if (!NILP (remap) && !INTEGERP (remap)) | ||
| 2607 | RETURN_UNGCPRO (Qnil); | ||
| 2608 | } | ||
| 2609 | } | ||
| 2610 | |||
| 2604 | for (; !NILP (maps); maps = Fcdr (maps)) | 2611 | for (; !NILP (maps); maps = Fcdr (maps)) |
| 2605 | { | 2612 | { |
| 2606 | /* Key sequence to reach map, and the map that it reaches */ | 2613 | /* Key sequence to reach map, and the map that it reaches */ |