diff options
| author | Richard M. Stallman | 1994-04-28 07:49:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-28 07:49:45 +0000 |
| commit | 245976082f70cec14f02b8963ebe73404a99bab2 (patch) | |
| tree | 8be6e18a293bbe8658ed3723e25d1f6a781a0f67 /src | |
| parent | d7a38a2ed90b2eefb57f3a8408f2c5cbb184829a (diff) | |
| download | emacs-245976082f70cec14f02b8963ebe73404a99bab2.tar.gz emacs-245976082f70cec14f02b8963ebe73404a99bab2.zip | |
(Vunread_command_events): Renamed from unread_command_events.
All uses changed.
(read_char): Don't use menus if we have events waiting.
(syms_of_keyboard): Init and staticpro accent_key_syms.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index a7900c85c43..f0402c50235 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -179,7 +179,7 @@ Lisp_Object last_nonmenu_event; | |||
| 179 | Lisp_Object last_input_char; | 179 | Lisp_Object last_input_char; |
| 180 | 180 | ||
| 181 | /* If not Qnil, a list of objects to be read as subsequent command input. */ | 181 | /* If not Qnil, a list of objects to be read as subsequent command input. */ |
| 182 | Lisp_Object unread_command_events; | 182 | Lisp_Object Vunread_command_events; |
| 183 | 183 | ||
| 184 | /* If not -1, an event to be read as subsequent command input. */ | 184 | /* If not -1, an event to be read as subsequent command input. */ |
| 185 | int unread_command_char; | 185 | int unread_command_char; |
| @@ -965,7 +965,7 @@ command_loop_1 () | |||
| 965 | if (!NILP (Vquit_flag)) | 965 | if (!NILP (Vquit_flag)) |
| 966 | { | 966 | { |
| 967 | Vquit_flag = Qnil; | 967 | Vquit_flag = Qnil; |
| 968 | unread_command_events = Fcons (make_number (quit_char), Qnil); | 968 | Vunread_command_events = Fcons (make_number (quit_char), Qnil); |
| 969 | } | 969 | } |
| 970 | } | 970 | } |
| 971 | 971 | ||
| @@ -1375,10 +1375,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1375 | int count; | 1375 | int count; |
| 1376 | jmp_buf save_jump; | 1376 | jmp_buf save_jump; |
| 1377 | 1377 | ||
| 1378 | if (CONSP (unread_command_events)) | 1378 | if (CONSP (Vunread_command_events)) |
| 1379 | { | 1379 | { |
| 1380 | c = XCONS (unread_command_events)->car; | 1380 | c = XCONS (Vunread_command_events)->car; |
| 1381 | unread_command_events = XCONS (unread_command_events)->cdr; | 1381 | Vunread_command_events = XCONS (Vunread_command_events)->cdr; |
| 1382 | 1382 | ||
| 1383 | if (this_command_key_count == 0) | 1383 | if (this_command_key_count == 0) |
| 1384 | goto reread_first; | 1384 | goto reread_first; |
| @@ -1482,11 +1482,16 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1482 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading | 1482 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading |
| 1483 | after a mouse event so don't try a minibuf menu. */ | 1483 | after a mouse event so don't try a minibuf menu. */ |
| 1484 | c = Qnil; | 1484 | c = Qnil; |
| 1485 | if (nmaps > 0 && INTERACTIVE && | 1485 | if (nmaps > 0 && INTERACTIVE |
| 1486 | !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)) | 1486 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) |
| 1487 | /* Don't bring up a menu if we already have another event. */ | ||
| 1488 | && NILP (Vunread_command_events) | ||
| 1489 | && unread_command_char < 0 | ||
| 1490 | && EVENT_QUEUES_EMPTY) | ||
| 1487 | { | 1491 | { |
| 1488 | c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); | 1492 | c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); |
| 1489 | if ( ! NILP(c) ) return c ; | 1493 | if (! NILP (c)) |
| 1494 | return c; | ||
| 1490 | } | 1495 | } |
| 1491 | 1496 | ||
| 1492 | /* If in middle of key sequence and minibuffer not active, | 1497 | /* If in middle of key sequence and minibuffer not active, |
| @@ -1525,11 +1530,15 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1525 | } | 1530 | } |
| 1526 | 1531 | ||
| 1527 | /* Try reading using an X menu. | 1532 | /* Try reading using an X menu. |
| 1528 | This is never confused with reading using the minibuf because the recursive | 1533 | This is never confused with reading using the minibuf |
| 1529 | call of read_char in read_char_minibuf_menu_prompt does not pass on | 1534 | because the recursive call of read_char in read_char_minibuf_menu_prompt |
| 1530 | any keys maps */ | 1535 | does not pass on any keymaps. */ |
| 1531 | if (nmaps > 0 && INTERACTIVE && | 1536 | if (nmaps > 0 && INTERACTIVE |
| 1532 | !NILP (prev_event) && EVENT_HAS_PARAMETERS (prev_event)) | 1537 | && !NILP (prev_event) && EVENT_HAS_PARAMETERS (prev_event) |
| 1538 | /* Don't bring up a menu if we already have another event. */ | ||
| 1539 | && NILP (Vunread_command_events) | ||
| 1540 | && unread_command_char < 0 | ||
| 1541 | && EVENT_QUEUES_EMPTY) | ||
| 1533 | c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); | 1542 | c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); |
| 1534 | 1543 | ||
| 1535 | /* Slow down auto saves logarithmically in size of current buffer, | 1544 | /* Slow down auto saves logarithmically in size of current buffer, |
| @@ -3862,8 +3871,8 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu) | |||
| 3862 | /* If we got more than one event, put all but the first | 3871 | /* If we got more than one event, put all but the first |
| 3863 | onto this list to be read later. | 3872 | onto this list to be read later. |
| 3864 | Return just the first event now. */ | 3873 | Return just the first event now. */ |
| 3865 | unread_command_events | 3874 | Vunread_command_events |
| 3866 | = nconc2 (XCONS (value)->cdr, unread_command_events); | 3875 | = nconc2 (XCONS (value)->cdr, Vunread_command_events); |
| 3867 | value = XCONS (value)->car; | 3876 | value = XCONS (value)->car; |
| 3868 | } | 3877 | } |
| 3869 | else if (NILP (value)) | 3878 | else if (NILP (value)) |
| @@ -3878,7 +3887,7 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu) | |||
| 3878 | } | 3887 | } |
| 3879 | 3888 | ||
| 3880 | static Lisp_Object | 3889 | static Lisp_Object |
| 3881 | read_char_minibuf_menu_prompt(commandflag, nmaps, maps) | 3890 | read_char_minibuf_menu_prompt (commandflag, nmaps, maps) |
| 3882 | int commandflag ; | 3891 | int commandflag ; |
| 3883 | int nmaps; | 3892 | int nmaps; |
| 3884 | Lisp_Object *maps; | 3893 | Lisp_Object *maps; |
| @@ -5197,7 +5206,7 @@ DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0, | |||
| 5197 | Actually, the value is nil only if we can be sure that no input is available.") | 5206 | Actually, the value is nil only if we can be sure that no input is available.") |
| 5198 | () | 5207 | () |
| 5199 | { | 5208 | { |
| 5200 | if (!NILP (unread_command_events) || unread_command_char != -1) | 5209 | if (!NILP (Vunread_command_events) || unread_command_char != -1) |
| 5201 | return (Qt); | 5210 | return (Qt); |
| 5202 | 5211 | ||
| 5203 | return detect_input_pending () ? Qt : Qnil; | 5212 | return detect_input_pending () ? Qt : Qnil; |
| @@ -5271,7 +5280,7 @@ Also cancel any kbd macro being defined.") | |||
| 5271 | defining_kbd_macro = 0; | 5280 | defining_kbd_macro = 0; |
| 5272 | update_mode_lines++; | 5281 | update_mode_lines++; |
| 5273 | 5282 | ||
| 5274 | unread_command_events = Qnil; | 5283 | Vunread_command_events = Qnil; |
| 5275 | unread_command_char = -1; | 5284 | unread_command_char = -1; |
| 5276 | 5285 | ||
| 5277 | discard_tty_input (); | 5286 | discard_tty_input (); |
| @@ -5532,7 +5541,7 @@ quit_throw_to_read_char () | |||
| 5532 | clear_waiting_for_input (); | 5541 | clear_waiting_for_input (); |
| 5533 | input_pending = 0; | 5542 | input_pending = 0; |
| 5534 | 5543 | ||
| 5535 | unread_command_events = Qnil; | 5544 | Vunread_command_events = Qnil; |
| 5536 | unread_command_char = -1; | 5545 | unread_command_char = -1; |
| 5537 | 5546 | ||
| 5538 | #ifdef POLL_FOR_INPUT | 5547 | #ifdef POLL_FOR_INPUT |
| @@ -5641,7 +5650,7 @@ init_keyboard () | |||
| 5641 | command_loop_level = -1; | 5650 | command_loop_level = -1; |
| 5642 | immediate_quit = 0; | 5651 | immediate_quit = 0; |
| 5643 | quit_char = Ctl ('g'); | 5652 | quit_char = Ctl ('g'); |
| 5644 | unread_command_events = Qnil; | 5653 | Vunread_command_events = Qnil; |
| 5645 | unread_command_char = -1; | 5654 | unread_command_char = -1; |
| 5646 | total_keys = 0; | 5655 | total_keys = 0; |
| 5647 | recent_keys_index = 0; | 5656 | recent_keys_index = 0; |
| @@ -5829,6 +5838,9 @@ syms_of_keyboard () | |||
| 5829 | = Fmake_vector (make_number (KBD_BUFFER_SIZE), Qnil); | 5838 | = Fmake_vector (make_number (KBD_BUFFER_SIZE), Qnil); |
| 5830 | staticpro (&kbd_buffer_frame_or_window); | 5839 | staticpro (&kbd_buffer_frame_or_window); |
| 5831 | 5840 | ||
| 5841 | accent_key_syms = Qnil; | ||
| 5842 | staticpro (&accent_key_syms); | ||
| 5843 | |||
| 5832 | func_key_syms = Qnil; | 5844 | func_key_syms = Qnil; |
| 5833 | staticpro (&func_key_syms); | 5845 | staticpro (&func_key_syms); |
| 5834 | 5846 | ||
| @@ -5877,7 +5889,7 @@ so that you can determine whether the command was run by mouse or not."); | |||
| 5877 | DEFVAR_LISP ("last-input-event", &last_input_char, | 5889 | DEFVAR_LISP ("last-input-event", &last_input_char, |
| 5878 | "Last input event."); | 5890 | "Last input event."); |
| 5879 | 5891 | ||
| 5880 | DEFVAR_LISP ("unread-command-events", &unread_command_events, | 5892 | DEFVAR_LISP ("unread-command-events", &Vunread_command_events, |
| 5881 | "List of objects to be read as next command input events."); | 5893 | "List of objects to be read as next command input events."); |
| 5882 | 5894 | ||
| 5883 | DEFVAR_INT ("unread-command-char", &unread_command_char, | 5895 | DEFVAR_INT ("unread-command-char", &unread_command_char, |