diff options
| author | Richard M. Stallman | 1995-07-28 16:36:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-07-28 16:36:01 +0000 |
| commit | e0301c07f0377f2165bf3b859d92d96233ecab21 (patch) | |
| tree | c4eb2c37954f74c4f5afc8705598ae974ff3592f /src | |
| parent | 53e24404481dcbdc8d1db0e1010e2bb7c28040ba (diff) | |
| download | emacs-e0301c07f0377f2165bf3b859d92d96233ecab21.tar.gz emacs-e0301c07f0377f2165bf3b859d92d96233ecab21.zip | |
(kbd_buffer_get_event): Update input_pending after
discarding one event from the queue, if we process the event here.
(swallow_events): Likewise.
(Vkey_translation_map): Just declare, don't define.
(syms_of_keyboard): Don't set up Lisp var.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index f1181188103..7037747ceb0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -310,8 +310,9 @@ Lisp_Object Vkeyboard_translate_table; | |||
| 310 | /* Keymap mapping ASCII function key sequences onto their preferred forms. */ | 310 | /* Keymap mapping ASCII function key sequences onto their preferred forms. */ |
| 311 | extern Lisp_Object Vfunction_key_map; | 311 | extern Lisp_Object Vfunction_key_map; |
| 312 | 312 | ||
| 313 | /* Keymap mapping ASCII function key sequences onto their preferred forms. */ | 313 | /* Another keymap that maps key sequences into key sequences. |
| 314 | Lisp_Object Vkey_translation_map; | 314 | This one takes precedence over ordinary definitions. */ |
| 315 | extern Lisp_Object Vkey_translation_map; | ||
| 315 | 316 | ||
| 316 | /* Non-nil means deactivate the mark at end of this command. */ | 317 | /* Non-nil means deactivate the mark at end of this command. */ |
| 317 | Lisp_Object Vdeactivate_mark; | 318 | Lisp_Object Vdeactivate_mark; |
| @@ -2563,6 +2564,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 2563 | and process it again. */ | 2564 | and process it again. */ |
| 2564 | copy = *event; | 2565 | copy = *event; |
| 2565 | kbd_fetch_ptr = event + 1; | 2566 | kbd_fetch_ptr = event + 1; |
| 2567 | input_pending = readable_events (); | ||
| 2566 | x_handle_selection_request (©); | 2568 | x_handle_selection_request (©); |
| 2567 | #else | 2569 | #else |
| 2568 | /* We're getting selection request events, but we don't have | 2570 | /* We're getting selection request events, but we don't have |
| @@ -2574,7 +2576,12 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 2574 | else if (event->kind == selection_clear_event) | 2576 | else if (event->kind == selection_clear_event) |
| 2575 | { | 2577 | { |
| 2576 | #ifdef HAVE_X11 | 2578 | #ifdef HAVE_X11 |
| 2579 | struct input_event copy; | ||
| 2580 | |||
| 2581 | /* Remove it from the buffer before processing it. */ | ||
| 2582 | copy = *event; | ||
| 2577 | kbd_fetch_ptr = event + 1; | 2583 | kbd_fetch_ptr = event + 1; |
| 2584 | input_pending = readable_events (); | ||
| 2578 | x_handle_selection_clear (event); | 2585 | x_handle_selection_clear (event); |
| 2579 | #else | 2586 | #else |
| 2580 | /* We're getting selection request events, but we don't have | 2587 | /* We're getting selection request events, but we don't have |
| @@ -2615,6 +2622,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 2615 | else if (event->kind == menu_bar_activate_event) | 2622 | else if (event->kind == menu_bar_activate_event) |
| 2616 | { | 2623 | { |
| 2617 | kbd_fetch_ptr = event + 1; | 2624 | kbd_fetch_ptr = event + 1; |
| 2625 | input_pending = readable_events (); | ||
| 2618 | x_activate_menubar (XFRAME (event->frame_or_window)); | 2626 | x_activate_menubar (XFRAME (event->frame_or_window)); |
| 2619 | } | 2627 | } |
| 2620 | #endif | 2628 | #endif |
| @@ -2757,8 +2765,13 @@ swallow_events () | |||
| 2757 | { | 2765 | { |
| 2758 | #ifdef HAVE_X11 | 2766 | #ifdef HAVE_X11 |
| 2759 | struct input_event copy; | 2767 | struct input_event copy; |
| 2768 | |||
| 2769 | /* Remove it from the buffer before processing it, | ||
| 2770 | since otherwise swallow_events called recursively could see it | ||
| 2771 | and process it again. */ | ||
| 2760 | copy = *event; | 2772 | copy = *event; |
| 2761 | kbd_fetch_ptr = event + 1; | 2773 | kbd_fetch_ptr = event + 1; |
| 2774 | input_pending = readable_events (); | ||
| 2762 | x_handle_selection_request (©); | 2775 | x_handle_selection_request (©); |
| 2763 | #else | 2776 | #else |
| 2764 | /* We're getting selection request events, but we don't have | 2777 | /* We're getting selection request events, but we don't have |
| @@ -2770,8 +2783,14 @@ swallow_events () | |||
| 2770 | else if (event->kind == selection_clear_event) | 2783 | else if (event->kind == selection_clear_event) |
| 2771 | { | 2784 | { |
| 2772 | #ifdef HAVE_X11 | 2785 | #ifdef HAVE_X11 |
| 2773 | x_handle_selection_clear (event); | 2786 | struct input_event copy; |
| 2787 | |||
| 2788 | /* Remove it from the buffer before processing it, */ | ||
| 2789 | copy = *event; | ||
| 2790 | |||
| 2774 | kbd_fetch_ptr = event + 1; | 2791 | kbd_fetch_ptr = event + 1; |
| 2792 | input_pending = readable_events (); | ||
| 2793 | x_handle_selection_clear (event); | ||
| 2775 | #else | 2794 | #else |
| 2776 | /* We're getting selection request events, but we don't have | 2795 | /* We're getting selection request events, but we don't have |
| 2777 | a window system. */ | 2796 | a window system. */ |
| @@ -7163,12 +7182,6 @@ Each character is looked up in this string and the contents used instead.\n\ | |||
| 7163 | If string is of length N, character codes N and up are untranslated."); | 7182 | If string is of length N, character codes N and up are untranslated."); |
| 7164 | Vkeyboard_translate_table = Qnil; | 7183 | Vkeyboard_translate_table = Qnil; |
| 7165 | 7184 | ||
| 7166 | DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, | ||
| 7167 | "Keymap of key translations that can override keymaps.\n\ | ||
| 7168 | This keymap works like `function-key-map', but comes after that,\n\ | ||
| 7169 | and applies even for keys that have ordinary bindings."); | ||
| 7170 | Vkey_translation_map = Qnil; | ||
| 7171 | |||
| 7172 | DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, | 7185 | DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, |
| 7173 | "Non-nil means to always spawn a subshell instead of suspending,\n\ | 7186 | "Non-nil means to always spawn a subshell instead of suspending,\n\ |
| 7174 | even if the operating system has support for stopping a process."); | 7187 | even if the operating system has support for stopping a process."); |