aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2002-02-06 22:59:56 +0000
committerKim F. Storm2002-02-06 22:59:56 +0000
commit8b9940e66c585db91bd8d252367b62b20ff66cef (patch)
tree5d08f9f61b063db151f187f143c67a0c4aad23c4 /src
parentcc0d001d9e80907ff192192d2eb3c20fc03fbe4a (diff)
downloademacs-8b9940e66c585db91bd8d252367b62b20ff66cef.tar.gz
emacs-8b9940e66c585db91bd8d252367b62b20ff66cef.zip
(Vthis_original_command): New variable.
(syms_of_keyboard): DEFVAR_LISP it. (command_loop_1): Set it, and perform command remapping.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index c26d6a1296f..44976d9bbed 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -373,6 +373,10 @@ Lisp_Object Vthis_command;
373/* This is like Vthis_command, except that commands never set it. */ 373/* This is like Vthis_command, except that commands never set it. */
374Lisp_Object real_this_command; 374Lisp_Object real_this_command;
375 375
376/* If the lookup of the command returns a binding, the original
377 command is stored in this-original-command. It is nil otherwise. */
378Lisp_Object Vthis_original_command;
379
376/* The value of point when the last command was executed. */ 380/* The value of point when the last command was executed. */
377int last_point_position; 381int last_point_position;
378 382
@@ -1503,6 +1507,17 @@ command_loop_1 ()
1503 reset it before we execute the command. */ 1507 reset it before we execute the command. */
1504 Vdeactivate_mark = Qnil; 1508 Vdeactivate_mark = Qnil;
1505 1509
1510 /* Remap command through active keymaps */
1511 Vthis_original_command = cmd;
1512 if (is_command_symbol (cmd))
1513 {
1514 Lisp_Object cmd1;
1515
1516 cmd1 = Fkey_binding (cmd, Qnil, Qt);
1517 if (!NILP (cmd1) && is_command_symbol (cmd1))
1518 cmd = cmd1;
1519 }
1520
1506 /* Execute the command. */ 1521 /* Execute the command. */
1507 1522
1508 Vthis_command = cmd; 1523 Vthis_command = cmd;
@@ -6947,7 +6962,7 @@ parse_menu_item (item, notreal, inmenubar)
6947 Lisp_Object prefix; 6962 Lisp_Object prefix;
6948 6963
6949 if (!NILP (tem)) 6964 if (!NILP (tem))
6950 tem = Fkey_binding (tem, Qnil); 6965 tem = Fkey_binding (tem, Qnil, Qnil);
6951 6966
6952 prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ); 6967 prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
6953 if (CONSP (prefix)) 6968 if (CONSP (prefix))
@@ -6993,7 +7008,7 @@ parse_menu_item (item, notreal, inmenubar)
6993 && SYMBOLP (XSYMBOL (def)->function) 7008 && SYMBOLP (XSYMBOL (def)->function)
6994 && ! NILP (Fget (def, Qmenu_alias))) 7009 && ! NILP (Fget (def, Qmenu_alias)))
6995 def = XSYMBOL (def)->function; 7010 def = XSYMBOL (def)->function;
6996 tem = Fwhere_is_internal (def, Qnil, Qt, Qnil); 7011 tem = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qt);
6997 XSETCAR (cachelist, tem); 7012 XSETCAR (cachelist, tem);
6998 if (NILP (tem)) 7013 if (NILP (tem))
6999 { 7014 {
@@ -9408,7 +9423,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
9408 && NILP (Vexecuting_macro) 9423 && NILP (Vexecuting_macro)
9409 && SYMBOLP (function)) 9424 && SYMBOLP (function))
9410 bindings = Fwhere_is_internal (function, Voverriding_local_map, 9425 bindings = Fwhere_is_internal (function, Voverriding_local_map,
9411 Qt, Qnil); 9426 Qt, Qnil, Qnil);
9412 else 9427 else
9413 bindings = Qnil; 9428 bindings = Qnil;
9414 9429
@@ -10635,6 +10650,12 @@ The command can set this variable; whatever is put here
10635will be in `last-command' during the following command. */); 10650will be in `last-command' during the following command. */);
10636 Vthis_command = Qnil; 10651 Vthis_command = Qnil;
10637 10652
10653 DEFVAR_LISP ("this-original-command", &Vthis_original_command,
10654 doc: /* If non-nil, the original command bound to the current key sequence.
10655The value of `this-command' is the result of looking up the original
10656command in the active keymaps. */);
10657 Vthis_original_command = Qnil;
10658
10638 DEFVAR_INT ("auto-save-interval", &auto_save_interval, 10659 DEFVAR_INT ("auto-save-interval", &auto_save_interval,
10639 doc: /* *Number of input events between auto-saves. 10660 doc: /* *Number of input events between auto-saves.
10640Zero means disable autosaving due to number of characters typed. */); 10661Zero means disable autosaving due to number of characters typed. */);