Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
5691:b490ddbd42aa | 5692:be87f507f510 |
---|---|
2994 compiled-function objects) */ | 2994 compiled-function objects) */ |
2995 Lisp_Object | 2995 Lisp_Object |
2996 event_binding (Lisp_Object event0, int accept_default) | 2996 event_binding (Lisp_Object event0, int accept_default) |
2997 { | 2997 { |
2998 /* This function can GC */ | 2998 /* This function can GC */ |
2999 Lisp_Object maps[100]; | 2999 Lisp_Object maps[100], result; |
3000 int nmaps; | 3000 int nmaps; |
3001 | 3001 |
3002 assert (EVENTP (event0)); | 3002 assert (EVENTP (event0)); |
3003 | 3003 |
3004 nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps); | 3004 nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps); |
3005 if (nmaps > countof (maps)) | 3005 if (nmaps > countof (maps)) |
3006 nmaps = countof (maps); | 3006 nmaps = countof (maps); |
3007 return process_event_binding_result (lookup_events (event0, nmaps, maps, | 3007 |
3008 accept_default)); | 3008 result = process_event_binding_result (lookup_events (event0, nmaps, maps, |
3009 accept_default)); | |
3010 | |
3011 if (!NILP (result) && SYMBOLP (result)) | |
3012 { | |
3013 Lisp_Object remap = command_remapping (result, nmaps, maps); | |
3014 if (!NILP (remap)) | |
3015 { | |
3016 result = remap; | |
3017 } | |
3018 } | |
3019 | |
3020 return result; | |
3009 } | 3021 } |
3010 | 3022 |
3011 /* like event_binding, but specify a keymap to search */ | 3023 /* like event_binding, but specify a keymap to search */ |
3012 | 3024 |
3013 Lisp_Object | 3025 Lisp_Object |