aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2011-10-03 16:50:54 -0400
committerStefan Monnier2011-10-03 16:50:54 -0400
commitdf1bbe5b135a64bf547bb298b88c82065ef2790a (patch)
tree2a9adbef0b67a3766840a0ac225df726d60c1b64 /src
parent915a9b6440634287d48d184bb326a0c845c31863 (diff)
downloademacs-df1bbe5b135a64bf547bb298b88c82065ef2790a.tar.gz
emacs-df1bbe5b135a64bf547bb298b88c82065ef2790a.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/keyboard.c20
2 files changed, 19 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bc9ffc8f3fe..b697ee43376 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keyboard.c (read_key_sequence_remapped): New var.
4 (read_key_sequence): Compute remapping in the right buffer.
5 (command_loop_1): Use read_key_sequence's remapping directly.
6
12011-10-02 Stefan Monnier <monnier@iro.umontreal.ca> 72011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * dired.c (file_name_completion): Don't expand file name. 9 * dired.c (file_name_completion): Don't expand file name.
diff --git a/src/keyboard.c b/src/keyboard.c
index 26407785c86..6f3bfd8c1e7 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -252,6 +252,7 @@ static Lisp_Object Qtimer_event_handler;
252/* read_key_sequence stores here the command definition of the 252/* read_key_sequence stores here the command definition of the
253 key sequence that it reads. */ 253 key sequence that it reads. */
254static Lisp_Object read_key_sequence_cmd; 254static Lisp_Object read_key_sequence_cmd;
255static Lisp_Object read_key_sequence_remapped;
255 256
256static Lisp_Object Qinput_method_function; 257static Lisp_Object Qinput_method_function;
257 258
@@ -1514,14 +1515,10 @@ command_loop_1 (void)
1514 reset it before we execute the command. */ 1515 reset it before we execute the command. */
1515 Vdeactivate_mark = Qnil; 1516 Vdeactivate_mark = Qnil;
1516 1517
1517 /* Remap command through active keymaps */ 1518 /* Remap command through active keymaps. */
1518 Vthis_original_command = cmd; 1519 Vthis_original_command = cmd;
1519 if (SYMBOLP (cmd)) 1520 if (!NILP (read_key_sequence_remapped))
1520 { 1521 cmd = read_key_sequence_remapped;
1521 Lisp_Object cmd1;
1522 if (cmd1 = Fcommand_remapping (cmd, Qnil, Qnil), !NILP (cmd1))
1523 cmd = cmd1;
1524 }
1525 1522
1526 /* Execute the command. */ 1523 /* Execute the command. */
1527 1524
@@ -9999,6 +9996,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9999 read_key_sequence_cmd = (first_binding < nmaps 9996 read_key_sequence_cmd = (first_binding < nmaps
10000 ? defs[first_binding] 9997 ? defs[first_binding]
10001 : Qnil); 9998 : Qnil);
9999 read_key_sequence_remapped
10000 /* Remap command through active keymaps.
10001 Do the remapping here, before the unbind_to so it uses the keymaps
10002 of the appropriate buffer. */
10003 = SYMBOLP (read_key_sequence_cmd)
10004 ? Fcommand_remapping (read_key_sequence_cmd, Qnil, Qnil)
10005 : Qnil;
10002 10006
10003 unread_switch_frame = delayed_switch_frame; 10007 unread_switch_frame = delayed_switch_frame;
10004 unbind_to (count, Qnil); 10008 unbind_to (count, Qnil);
@@ -11663,6 +11667,8 @@ syms_of_keyboard (void)
11663 11667
11664 read_key_sequence_cmd = Qnil; 11668 read_key_sequence_cmd = Qnil;
11665 staticpro (&read_key_sequence_cmd); 11669 staticpro (&read_key_sequence_cmd);
11670 read_key_sequence_remapped = Qnil;
11671 staticpro (&read_key_sequence_remapped);
11666 11672
11667 menu_bar_one_keymap_changed_items = Qnil; 11673 menu_bar_one_keymap_changed_items = Qnil;
11668 staticpro (&menu_bar_one_keymap_changed_items); 11674 staticpro (&menu_bar_one_keymap_changed_items);