Mercurial > hg > xemacs-beta
diff src/keymap.c @ 5692:be87f507f510
Handle interactive command remapping a little better than 7371081ce8f7, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea@parhasard.net>
* keymap.c (event_binding):
Do command remapping here for interactive lookups; avoids a
relatively expensive repeated call to get_relevant_keymaps(), as
was necessary in 7371081ce8f7 (which changeset has been backed
out).
lisp/ChangeLog addition:
2012-10-14 Aidan Kehoe <kehoea@parhasard.net>
* help.el:
* help.el (describe-function-1):
Add some newlines here when dealing with remapped commands, thank
you Robert Pluim.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 06 Nov 2012 22:27:15 +0000 |
parents | b490ddbd42aa |
children | 4d15e903800b |
line wrap: on
line diff
--- a/src/keymap.c Tue Nov 06 21:34:15 2012 +0000 +++ b/src/keymap.c Tue Nov 06 22:27:15 2012 +0000 @@ -2996,7 +2996,7 @@ event_binding (Lisp_Object event0, int accept_default) { /* This function can GC */ - Lisp_Object maps[100]; + Lisp_Object maps[100], result; int nmaps; assert (EVENTP (event0)); @@ -3004,8 +3004,20 @@ nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps); if (nmaps > countof (maps)) nmaps = countof (maps); - return process_event_binding_result (lookup_events (event0, nmaps, maps, - accept_default)); + + result = process_event_binding_result (lookup_events (event0, nmaps, maps, + accept_default)); + + if (!NILP (result) && SYMBOLP (result)) + { + Lisp_Object remap = command_remapping (result, nmaps, maps); + if (!NILP (remap)) + { + result = remap; + } + } + + return result; } /* like event_binding, but specify a keymap to search */