Commits

Aidan Kehoe committed be87f50

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.

  • Participants
  • Parent commits b490ddb

Comments (0)

Files changed (4)

+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.
+
 2012-10-13  Mats Lidell  <matsl@xemacs.org>
 
 	* process.el (call-process-shell-command): New function from GNU.
                                    (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))))))))))))))
 
+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).
+
 2012-10-14  Aidan Kehoe  <kehoea@parhasard.net>
 
 	Respect face and display table information in the minibuffer
 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));
   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 */