emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105993: * src/keyboard.c (read_key_s


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105993: * src/keyboard.c (read_key_sequence_remapped): New var.
Date: Mon, 03 Oct 2011 16:50:54 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105993
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-10-03 16:50:54 -0400
message:
  * src/keyboard.c (read_key_sequence_remapped): New var.
  (read_key_sequence): Compute remapping in the right buffer.
  (command_loop_1): Use read_key_sequence's remapping directly.
modified:
  src/ChangeLog
  src/keyboard.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-10-02 04:08:50 +0000
+++ b/src/ChangeLog     2011-10-03 20:50:54 +0000
@@ -1,3 +1,9 @@
+2011-10-03  Stefan Monnier  <address@hidden>
+
+       * keyboard.c (read_key_sequence_remapped): New var.
+       (read_key_sequence): Compute remapping in the right buffer.
+       (command_loop_1): Use read_key_sequence's remapping directly.
+
 2011-10-02  Stefan Monnier  <address@hidden>
 
        * dired.c (file_name_completion): Don't expand file name.

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2011-09-09 01:06:52 +0000
+++ b/src/keyboard.c    2011-10-03 20:50:54 +0000
@@ -252,6 +252,7 @@
 /* read_key_sequence stores here the command definition of the
    key sequence that it reads.  */
 static Lisp_Object read_key_sequence_cmd;
+static Lisp_Object read_key_sequence_remapped;
 
 static Lisp_Object Qinput_method_function;
 
@@ -1514,14 +1515,10 @@
         reset it before we execute the command. */
       Vdeactivate_mark = Qnil;
 
-      /* Remap command through active keymaps */
+      /* Remap command through active keymaps.  */
       Vthis_original_command = cmd;
-      if (SYMBOLP (cmd))
-       {
-         Lisp_Object cmd1;
-         if (cmd1 = Fcommand_remapping (cmd, Qnil, Qnil), !NILP (cmd1))
-           cmd = cmd1;
-       }
+      if (!NILP (read_key_sequence_remapped))
+       cmd = read_key_sequence_remapped;
 
       /* Execute the command.  */
 
@@ -9999,6 +9996,13 @@
     read_key_sequence_cmd = (first_binding < nmaps
                             ? defs[first_binding]
                             : Qnil);
+  read_key_sequence_remapped
+    /* Remap command through active keymaps.
+       Do the remapping here, before the unbind_to so it uses the keymaps
+       of the appropriate buffer.  */
+    = SYMBOLP (read_key_sequence_cmd)
+    ? Fcommand_remapping (read_key_sequence_cmd, Qnil, Qnil)
+    : Qnil;
 
   unread_switch_frame = delayed_switch_frame;
   unbind_to (count, Qnil);
@@ -11663,6 +11667,8 @@
 
   read_key_sequence_cmd = Qnil;
   staticpro (&read_key_sequence_cmd);
+  read_key_sequence_remapped = Qnil;
+  staticpro (&read_key_sequence_remapped);
 
   menu_bar_one_keymap_changed_items = Qnil;
   staticpro (&menu_bar_one_keymap_changed_items);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]