APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352240835 0
# Node ID be87f507f5100953f14b0405f0ccbd825e941fe7
# Parent b490ddbd42aab637aa8332b0fc3dbb722f60dc44
Handle interactive command remapping a little better than 7371081ce8f7, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)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(a)parhasard.net>
* help.el:
* help.el (describe-function-1):
Add some newlines here when dealing with remapped commands, thank
you Robert Pluim.
diff -r b490ddbd42aa -r be87f507f510 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Nov 06 21:34:15 2012 +0000
+++ b/lisp/ChangeLog Tue Nov 06 22:27:15 2012 +0000
@@ -1,3 +1,10 @@
+2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * help.el:
+ * help.el (describe-function-1):
+ Add some newlines here when dealing with remapped commands, thank
+ you Robert Pluim.
+
2012-10-13 Mats Lidell <matsl(a)xemacs.org>
* process.el (call-process-shell-command): New function from GNU.
diff -r b490ddbd42aa -r be87f507f510 lisp/help.el
--- a/lisp/help.el Tue Nov 06 21:34:15 2012 +0000
+++ b/lisp/help.el Tue Nov 06 22:27:15 2012 +0000
@@ -1544,10 +1544,10 @@
(format "\n\\[%s]" function))))
(when commands-remapped-to
(if (cdr commands-remapped-to)
- (princ (format "The following functions are \
+ (princ (format "\n\nThe following functions are \
remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
"', `")))
- (princ (format "`%s' is remapped to it.\n"
+ (princ (format "\n\n`%s' is remapped to it.\n"
(car
commands-remapped-to))))))))))))))
diff -r b490ddbd42aa -r be87f507f510 src/ChangeLog
--- a/src/ChangeLog Tue Nov 06 21:34:15 2012 +0000
+++ b/src/ChangeLog Tue Nov 06 22:27:15 2012 +0000
@@ -1,3 +1,11 @@
+2012-11-06 Aidan Kehoe <kehoea(a)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).
+
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
Respect face and display table information in the minibuffer
diff -r b490ddbd42aa -r be87f507f510 src/keymap.c
--- 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 */
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches