Mercurial > emacs
comparison src/keyboard.c @ 78696:c9c7e7b146ec
(syms_of_keyboard): Set up new Lisp variable
last-repeatable-command.
(init_kboard): Initialize Vlast_repeatable_command.
(command_loop_1): Set it to real_this_command unless that was
bound to an input event.
(mark_kboards): Mark it.
author | Martin Rudalics <rudalics@gmx.at> |
---|---|
date | Wed, 29 Aug 2007 09:00:42 +0000 |
parents | 1677cf1c2509 |
children | 2894950842e6 |
comparison
equal
deleted
inserted
replaced
78695:4492556ec35d | 78696:c9c7e7b146ec |
---|---|
1534 } | 1534 } |
1535 | 1535 |
1536 /* Do this after running Vpost_command_hook, for consistency. */ | 1536 /* Do this after running Vpost_command_hook, for consistency. */ |
1537 current_kboard->Vlast_command = Vthis_command; | 1537 current_kboard->Vlast_command = Vthis_command; |
1538 current_kboard->Vreal_last_command = real_this_command; | 1538 current_kboard->Vreal_last_command = real_this_command; |
1539 if (!CONSP (last_command_char)) | |
1540 current_kboard->Vlast_repeatable_command = real_this_command; | |
1539 | 1541 |
1540 while (1) | 1542 while (1) |
1541 { | 1543 { |
1542 if (! FRAME_LIVE_P (XFRAME (selected_frame))) | 1544 if (! FRAME_LIVE_P (XFRAME (selected_frame))) |
1543 Fkill_emacs (Qnil); | 1545 Fkill_emacs (Qnil); |
1914 then the above doesn't apply. */ | 1916 then the above doesn't apply. */ |
1915 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_char)) | 1917 if (NILP (current_kboard->Vprefix_arg) || CONSP (last_command_char)) |
1916 { | 1918 { |
1917 current_kboard->Vlast_command = Vthis_command; | 1919 current_kboard->Vlast_command = Vthis_command; |
1918 current_kboard->Vreal_last_command = real_this_command; | 1920 current_kboard->Vreal_last_command = real_this_command; |
1921 if (!CONSP (last_command_char)) | |
1922 current_kboard->Vlast_repeatable_command = real_this_command; | |
1919 cancel_echoing (); | 1923 cancel_echoing (); |
1920 this_command_key_count = 0; | 1924 this_command_key_count = 0; |
1921 this_command_key_count_reset = 0; | 1925 this_command_key_count_reset = 0; |
1922 this_single_command_key_start = 0; | 1926 this_single_command_key_start = 0; |
1923 } | 1927 } |
10968 KBOARD *kb; | 10972 KBOARD *kb; |
10969 { | 10973 { |
10970 kb->Voverriding_terminal_local_map = Qnil; | 10974 kb->Voverriding_terminal_local_map = Qnil; |
10971 kb->Vlast_command = Qnil; | 10975 kb->Vlast_command = Qnil; |
10972 kb->Vreal_last_command = Qnil; | 10976 kb->Vreal_last_command = Qnil; |
10977 kb->Vlast_repeatable_command = Qnil; | |
10973 kb->Vprefix_arg = Qnil; | 10978 kb->Vprefix_arg = Qnil; |
10974 kb->Vlast_prefix_arg = Qnil; | 10979 kb->Vlast_prefix_arg = Qnil; |
10975 kb->kbd_queue = Qnil; | 10980 kb->kbd_queue = Qnil; |
10976 kb->kbd_queue_has_data = 0; | 10981 kb->kbd_queue_has_data = 0; |
10977 kb->immediate_echo = 0; | 10982 kb->immediate_echo = 0; |
11454 The value `kill-region' is special; it means that the previous command | 11459 The value `kill-region' is special; it means that the previous command |
11455 was a kill command. */); | 11460 was a kill command. */); |
11456 | 11461 |
11457 DEFVAR_KBOARD ("real-last-command", Vreal_last_command, | 11462 DEFVAR_KBOARD ("real-last-command", Vreal_last_command, |
11458 doc: /* Same as `last-command', but never altered by Lisp code. */); | 11463 doc: /* Same as `last-command', but never altered by Lisp code. */); |
11464 | |
11465 DEFVAR_KBOARD ("last-repeatable-command", Vlast_repeatable_command, | |
11466 doc: /* Last command that may be repeated. | |
11467 The last command executed that was not bound to an input event. | |
11468 This is the command `repeat' will try to repeat. */); | |
11459 | 11469 |
11460 DEFVAR_LISP ("this-command", &Vthis_command, | 11470 DEFVAR_LISP ("this-command", &Vthis_command, |
11461 doc: /* The command now being executed. | 11471 doc: /* The command now being executed. |
11462 The command can set this variable; whatever is put here | 11472 The command can set this variable; whatever is put here |
11463 will be in `last-command' during the following command. */); | 11473 will be in `last-command' during the following command. */); |
11853 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++) | 11863 for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++) |
11854 mark_object (*p); | 11864 mark_object (*p); |
11855 mark_object (kb->Voverriding_terminal_local_map); | 11865 mark_object (kb->Voverriding_terminal_local_map); |
11856 mark_object (kb->Vlast_command); | 11866 mark_object (kb->Vlast_command); |
11857 mark_object (kb->Vreal_last_command); | 11867 mark_object (kb->Vreal_last_command); |
11868 mark_object (kb->Vlast_repeatable_command); | |
11858 mark_object (kb->Vprefix_arg); | 11869 mark_object (kb->Vprefix_arg); |
11859 mark_object (kb->Vlast_prefix_arg); | 11870 mark_object (kb->Vlast_prefix_arg); |
11860 mark_object (kb->kbd_queue); | 11871 mark_object (kb->kbd_queue); |
11861 mark_object (kb->defining_kbd_macro); | 11872 mark_object (kb->defining_kbd_macro); |
11862 mark_object (kb->Vlast_kbd_macro); | 11873 mark_object (kb->Vlast_kbd_macro); |