aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-06-07 22:37:36 +0000
committerRichard M. Stallman1998-06-07 22:37:36 +0000
commit75045dcbffddb463735a9a27bd905b6cfcb7bc45 (patch)
tree8a0229ba727ee773ac4e9003e2e3229b062f8a41 /src
parentfe3fbdcc80c48c33a830ee4fdd379153f0f16229 (diff)
downloademacs-75045dcbffddb463735a9a27bd905b6cfcb7bc45.tar.gz
emacs-75045dcbffddb463735a9a27bd905b6cfcb7bc45.zip
(cmd_error): Init Vlast_prefix_arg.
(init_kboard, command_loop_1): Init Vlast_prefix_arg. (Fcommand_execute): Set Vlast_prefix_arg to prefix arg used. (command_loop_1): Set Vreal_last_command with Vlast_command. (init_kboard): Init Vreal_last_command field. (syms_of_keyboard): Set up Lisp var real-last-command. (lispy_function_keys): Add kanji...eisu-toggle.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 3d1e6649074..cf793b1909a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -939,6 +939,7 @@ cmd_error (data)
939 Vexecuting_macro = Qnil; 939 Vexecuting_macro = Qnil;
940 executing_macro = Qnil; 940 executing_macro = Qnil;
941 current_kboard->Vprefix_arg = Qnil; 941 current_kboard->Vprefix_arg = Qnil;
942 current_kboard->Vlast_prefix_arg = Qnil;
942 cancel_echoing (); 943 cancel_echoing ();
943 944
944 /* Avoid unquittable loop if data contains a circular list. */ 945 /* Avoid unquittable loop if data contains a circular list. */
@@ -1122,6 +1123,7 @@ command_loop_1 ()
1122#endif 1123#endif
1123 1124
1124 current_kboard->Vprefix_arg = Qnil; 1125 current_kboard->Vprefix_arg = Qnil;
1126 current_kboard->Vlast_prefix_arg = Qnil;
1125 Vdeactivate_mark = Qnil; 1127 Vdeactivate_mark = Qnil;
1126 waiting_for_input = 0; 1128 waiting_for_input = 0;
1127 cancel_echoing (); 1129 cancel_echoing ();
@@ -1151,6 +1153,7 @@ command_loop_1 ()
1151 1153
1152 /* Do this after running Vpost_command_hook, for consistency. */ 1154 /* Do this after running Vpost_command_hook, for consistency. */
1153 current_kboard->Vlast_command = this_command; 1155 current_kboard->Vlast_command = this_command;
1156 current_kboard->Vreal_last_command = this_command;
1154 1157
1155 while (1) 1158 while (1)
1156 { 1159 {
@@ -1287,7 +1290,7 @@ command_loop_1 ()
1287 if the symbol is a local variable. */ 1290 if the symbol is a local variable. */
1288 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks)) 1291 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks))
1289 safe_run_hooks (Qpre_command_hook); 1292 safe_run_hooks (Qpre_command_hook);
1290 1293
1291 if (NILP (this_command)) 1294 if (NILP (this_command))
1292 { 1295 {
1293 /* nil means key is undefined. */ 1296 /* nil means key is undefined. */
@@ -1300,6 +1303,9 @@ command_loop_1 ()
1300 { 1303 {
1301 if (NILP (current_kboard->Vprefix_arg) && ! no_direct) 1304 if (NILP (current_kboard->Vprefix_arg) && ! no_direct)
1302 { 1305 {
1306 /* In case we jump to directly_done. */
1307 Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
1308
1303 /* Recognize some common commands in common situations and 1309 /* Recognize some common commands in common situations and
1304 do them directly. */ 1310 do them directly. */
1305 if (EQ (this_command, Qforward_char) && PT < ZV) 1311 if (EQ (this_command, Qforward_char) && PT < ZV)
@@ -1442,9 +1448,9 @@ command_loop_1 ()
1442 if (NILP (current_kboard->Vprefix_arg)) 1448 if (NILP (current_kboard->Vprefix_arg))
1443 Fundo_boundary (); 1449 Fundo_boundary ();
1444 Fcommand_execute (this_command, Qnil, Qnil, Qnil); 1450 Fcommand_execute (this_command, Qnil, Qnil, Qnil);
1445
1446 } 1451 }
1447 directly_done: ; 1452 directly_done: ;
1453 current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
1448 1454
1449 /* Note that the value cell will never directly contain nil 1455 /* Note that the value cell will never directly contain nil
1450 if the symbol is a local variable. */ 1456 if the symbol is a local variable. */
@@ -1478,6 +1484,7 @@ command_loop_1 ()
1478 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_char)) 1484 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_char))
1479 { 1485 {
1480 current_kboard->Vlast_command = this_command; 1486 current_kboard->Vlast_command = this_command;
1487 current_kboard->Vreal_last_command = this_command;
1481 cancel_echoing (); 1488 cancel_echoing ();
1482 this_command_key_count = 0; 1489 this_command_key_count = 0;
1483 this_single_command_key_start = 0; 1490 this_single_command_key_start = 0;
@@ -3607,35 +3614,23 @@ static char *lispy_function_keys[] =
3607 { 3614 {
3608 /* X Keysym value */ 3615 /* X Keysym value */
3609 3616
3610 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff00 */ 3617 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff00...0f */
3611 "backspace", 3618 "backspace", "tab", "linefeed", "clear",
3612 "tab", 3619 0, "return", 0, 0,
3613 "linefeed", 3620 0, 0, 0, "pause", /* 0xff10...1f */
3614 "clear", 3621 0, 0, 0, 0, 0, 0, 0, "escape",
3615 0,
3616 "return",
3617 0, 0,
3618 0, 0, 0, /* 0xff10 */
3619 "pause",
3620 0, 0, 0, 0, 0, 0, 0,
3621 "escape",
3622 0, 0, 0, 0, 3622 0, 0, 0, 0,
3623 0, "kanji", "muhenkan", 3623 0, "kanji", "muhenkan", "henkan", /* 0xff20...2f */
3624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff20...2f */ 3624 "romaji", "hiragana", "katakana", "hiragana-katakana",
3625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff30...3f */ 3625 "zenkaku", "hankaku", "zenkaku-hankaku", "touroku",
3626 "massyo", "kana-lock", "kana-shift", "eisu-shift",
3627 "eisu-toggle", /* 0xff30...3f */
3628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff40...4f */ 3629 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff40...4f */
3627 3630
3628 "home", /* 0xff50 */ /* IsCursorKey */ 3631 "home", "left", "up", "right", /* 0xff50 */ /* IsCursorKey */
3629 "left", 3632 "down", "prior", "next", "end",
3630 "up", 3633 "begin", 0, 0, 0, 0, 0, 0, 0,
3631 "right",
3632 "down",
3633 "prior",
3634 "next",
3635 "end",
3636 "begin",
3637 0, /* 0xff59 */
3638 0, 0, 0, 0, 0, 0,
3639 "select", /* 0xff60 */ /* IsMiscFunctionKey */ 3634 "select", /* 0xff60 */ /* IsMiscFunctionKey */
3640 "print", 3635 "print",
3641 "execute", 3636 "execute",
@@ -3649,9 +3644,9 @@ static char *lispy_function_keys[] =
3649 "help", 3644 "help",
3650 "break", /* 0xff6b */ 3645 "break", /* 0xff6b */
3651 3646
3652 0, 0, 0, 0, 0, 0, 0, 0, "backtab", 0, 3647 0, 0, 0, 0,
3653 0, /* 0xff76 */ 3648 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */
3654 0, 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff7f */ 3649 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */
3655 "kp-space", /* 0xff80 */ /* IsKeypadKey */ 3650 "kp-space", /* 0xff80 */ /* IsKeypadKey */
3656 0, 0, 0, 0, 0, 0, 0, 0, 3651 0, 0, 0, 0, 0, 0, 0, 0,
3657 "kp-tab", /* 0xff89 */ 3652 "kp-tab", /* 0xff89 */
@@ -8458,7 +8453,9 @@ init_kboard (kb)
8458{ 8453{
8459 kb->Voverriding_terminal_local_map = Qnil; 8454 kb->Voverriding_terminal_local_map = Qnil;
8460 kb->Vlast_command = Qnil; 8455 kb->Vlast_command = Qnil;
8456 kb->Vreal_last_command = Qnil;
8461 kb->Vprefix_arg = Qnil; 8457 kb->Vprefix_arg = Qnil;
8458 kb->Vlast_prefix_arg = Qnil;
8462 kb->kbd_queue = Qnil; 8459 kb->kbd_queue = Qnil;
8463 kb->kbd_queue_has_data = 0; 8460 kb->kbd_queue_has_data = 0;
8464 kb->immediate_echo = 0; 8461 kb->immediate_echo = 0;
@@ -8843,6 +8840,9 @@ command exit.\n\
8843The value `kill-region' is special; it means that the previous command\n\ 8840The value `kill-region' is special; it means that the previous command\n\
8844was a kill command."); 8841was a kill command.");
8845 8842
8843 DEFVAR_KBOARD ("real-last-command", Vreal_last_command,
8844 "Same as `last-command', but never altered by Lisp code.");
8845
8846 DEFVAR_LISP ("this-command", &this_command, 8846 DEFVAR_LISP ("this-command", &this_command,
8847 "The command now being executed.\n\ 8847 "The command now being executed.\n\
8848The command can set this variable; whatever is put here\n\ 8848The command can set this variable; whatever is put here\n\