diff src/event-stream.c @ 5689:7371081ce8f7

Have command remapping work interactively too, thank you Robert Pluim! src/ChangeLog addition: 2012-10-14 Aidan Kehoe <kehoea@parhasard.net> Have command remapping work interactively too, thank you Robert Pluim. * event-stream.c (Fdispatch_event): Obey command remapping here, it wasn't done for us. * keymap.c: * keymap.c (command_remapping_for_event): New, needed to observe command remapping interactively. * lisp.h: Make it available. 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 Sun, 14 Oct 2012 22:10:39 +0100
parents 56144c8593a8
children b490ddbd42aa
line wrap: on
line diff
--- a/src/event-stream.c	Sun Oct 14 16:14:25 2012 +0100
+++ b/src/event-stream.c	Sun Oct 14 22:10:39 2012 +0100
@@ -4550,8 +4550,6 @@
 	    int magic_undo = 0;
 	    Elemcount magic_undo_count = 20;
 
-	    Vthis_command = leaf;
-
 	    /* Don't push an undo boundary if the command set the prefix arg,
 	       or if we are executing a keyboard macro, or if in the
 	       minibuffer.  If the command we are about to execute is
@@ -4567,6 +4565,8 @@
 	    if (SYMBOLP (leaf))
 	      {
 		Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil);
+                Lisp_Object remap = Qnil;
+
 		if (NATNUMP (prop))
                   {
                     magic_undo = 1;
@@ -4587,8 +4587,16 @@
 		  magic_undo = 1;
 		else if (EQ (leaf, Qself_insert_command))
 		  magic_undo = 1;
+
+                remap = command_remapping_for_event (leaf, event);
+                if (!NILP (remap))
+                  {
+                    leaf = remap;
+                  }
 	      }
 
+	    Vthis_command = leaf;
+
 	    if (!magic_undo)
 	      command_builder->self_insert_countdown = 0;
 	    if (NILP (XCONSOLE (console)->prefix_arg)