diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 8dba1d098e9..66885c29024 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1874,11 +1874,11 @@ kbd_buffer_get_event () | |||
| 1874 | #endif | 1874 | #endif |
| 1875 | } | 1875 | } |
| 1876 | 1876 | ||
| 1877 | #ifdef MULTI_FRAME | ||
| 1878 | /* If this event is on a different frame, return a switch-frame this | 1877 | /* If this event is on a different frame, return a switch-frame this |
| 1879 | time, and leave the event in the queue for next time. */ | 1878 | time, and leave the event in the queue for next time. */ |
| 1880 | else | 1879 | else |
| 1881 | { | 1880 | { |
| 1881 | #ifdef MULTI_FRAME | ||
| 1882 | Lisp_Object frame = event->frame_or_window; | 1882 | Lisp_Object frame = event->frame_or_window; |
| 1883 | Lisp_Object focus; | 1883 | Lisp_Object focus; |
| 1884 | 1884 | ||
| @@ -1893,6 +1893,7 @@ kbd_buffer_get_event () | |||
| 1893 | && XFRAME (frame) != selected_frame) | 1893 | && XFRAME (frame) != selected_frame) |
| 1894 | obj = make_lispy_switch_frame (frame); | 1894 | obj = make_lispy_switch_frame (frame); |
| 1895 | internal_last_event_frame = frame; | 1895 | internal_last_event_frame = frame; |
| 1896 | #endif /* MULTI_FRAME */ | ||
| 1896 | 1897 | ||
| 1897 | /* If we didn't decide to make a switch-frame event, go ahead | 1898 | /* If we didn't decide to make a switch-frame event, go ahead |
| 1898 | and build a real event from the queue entry. */ | 1899 | and build a real event from the queue entry. */ |
| @@ -1909,7 +1910,6 @@ kbd_buffer_get_event () | |||
| 1909 | kbd_fetch_ptr = event + 1; | 1910 | kbd_fetch_ptr = event + 1; |
| 1910 | } | 1911 | } |
| 1911 | } | 1912 | } |
| 1912 | #endif | ||
| 1913 | } | 1913 | } |
| 1914 | else if (do_mouse_tracking && mouse_moved) | 1914 | else if (do_mouse_tracking && mouse_moved) |
| 1915 | { | 1915 | { |
| @@ -2024,7 +2024,7 @@ static char *lispy_function_keys[] = | |||
| 2024 | { | 2024 | { |
| 2025 | /* X Keysym value */ | 2025 | /* X Keysym value */ |
| 2026 | 2026 | ||
| 2027 | 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff00 */ | 2027 | "remove", 0, 0, 0, 0, 0, 0, 0, /* 0xff00 */ |
| 2028 | "backspace", | 2028 | "backspace", |
| 2029 | "tab", | 2029 | "tab", |
| 2030 | "linefeed", | 2030 | "linefeed", |
| @@ -3097,7 +3097,7 @@ menu_bar_items () | |||
| 3097 | #ifdef USE_TEXT_PROPERTIES | 3097 | #ifdef USE_TEXT_PROPERTIES |
| 3098 | maps[nmaps-2] = get_local_map (PT, current_buffer); | 3098 | maps[nmaps-2] = get_local_map (PT, current_buffer); |
| 3099 | #else | 3099 | #else |
| 3100 | maps[nmaps-2] = current_buffer->local_map; | 3100 | maps[nmaps-2] = current_buffer->keymap; |
| 3101 | #endif | 3101 | #endif |
| 3102 | maps[nmaps-1] = global_map; | 3102 | maps[nmaps-1] = global_map; |
| 3103 | } | 3103 | } |
| @@ -3632,10 +3632,14 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 3632 | echo_start = echo_length (); | 3632 | echo_start = echo_length (); |
| 3633 | keys_start = this_command_key_count; | 3633 | keys_start = this_command_key_count; |
| 3634 | 3634 | ||
| 3635 | #if 0 /* This doesn't quite work, because some of the things | ||
| 3636 | that read_char does cannot safely be bypassed. | ||
| 3637 | It seems too risky to try to make this work right. */ | ||
| 3635 | /* Read the first char of the sequence specially, before setting | 3638 | /* Read the first char of the sequence specially, before setting |
| 3636 | up any keymaps, in case a filter runs and switches buffers on us. */ | 3639 | up any keymaps, in case a filter runs and switches buffers on us. */ |
| 3637 | first_event = read_char (!prompt, 0, submaps, last_nonmenu_event, | 3640 | first_event = read_char (!prompt, 0, submaps, last_nonmenu_event, |
| 3638 | &junk); | 3641 | &junk); |
| 3642 | #endif | ||
| 3639 | 3643 | ||
| 3640 | /* We jump here when the key sequence has been thoroughly changed, and | 3644 | /* We jump here when the key sequence has been thoroughly changed, and |
| 3641 | we need to rescan it starting from the beginning. When we jump here, | 3645 | we need to rescan it starting from the beginning. When we jump here, |
| @@ -3661,7 +3665,7 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 3661 | #ifdef USE_TEXT_PROPERTIES | 3665 | #ifdef USE_TEXT_PROPERTIES |
| 3662 | submaps[nmaps-2] = get_local_map (PT, current_buffer); | 3666 | submaps[nmaps-2] = get_local_map (PT, current_buffer); |
| 3663 | #else | 3667 | #else |
| 3664 | submaps[nmaps-2] = current_buffer->local_map; | 3668 | submaps[nmaps-2] = current_buffer->keymap; |
| 3665 | #endif | 3669 | #endif |
| 3666 | submaps[nmaps-1] = global_map; | 3670 | submaps[nmaps-1] = global_map; |
| 3667 | } | 3671 | } |
| @@ -3733,16 +3737,12 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 3733 | /* If not, we should actually read a character. */ | 3737 | /* If not, we should actually read a character. */ |
| 3734 | else | 3738 | else |
| 3735 | { | 3739 | { |
| 3740 | struct buffer *buf = current_buffer; | ||
| 3741 | |||
| 3736 | last_real_key_start = t; | 3742 | last_real_key_start = t; |
| 3737 | 3743 | ||
| 3738 | if (! NILP (first_event)) | 3744 | key = read_char (!prompt, nmaps, submaps, last_nonmenu_event, |
| 3739 | { | 3745 | &used_mouse_menu); |
| 3740 | key = first_event; | ||
| 3741 | first_event = Qnil; | ||
| 3742 | } | ||
| 3743 | else | ||
| 3744 | key = read_char (!prompt, nmaps, submaps, last_nonmenu_event, | ||
| 3745 | &used_mouse_menu); | ||
| 3746 | 3746 | ||
| 3747 | /* read_char returns -1 at the end of a macro. | 3747 | /* read_char returns -1 at the end of a macro. |
| 3748 | Emacs 18 handles this by returning immediately with a | 3748 | Emacs 18 handles this by returning immediately with a |
| @@ -3818,6 +3818,10 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 3818 | keybuf[t+1] = key; | 3818 | keybuf[t+1] = key; |
| 3819 | mock_input = t + 2; | 3819 | mock_input = t + 2; |
| 3820 | 3820 | ||
| 3821 | /* If we switched buffers while reading the first event, | ||
| 3822 | replay in case we switched keymaps too. */ | ||
| 3823 | if (buf != current_buffer && t == 0) | ||
| 3824 | goto replay_sequence; | ||
| 3821 | goto replay_key; | 3825 | goto replay_key; |
| 3822 | } | 3826 | } |
| 3823 | } | 3827 | } |
| @@ -3855,6 +3859,15 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 3855 | } | 3859 | } |
| 3856 | } | 3860 | } |
| 3857 | } | 3861 | } |
| 3862 | |||
| 3863 | /* If we switched buffers while reading the first event, | ||
| 3864 | replay in case we switched keymaps too. */ | ||
| 3865 | if (buf != current_buffer && t == 0) | ||
| 3866 | { | ||
| 3867 | keybuf[t++] = key; | ||
| 3868 | mock_input = t; | ||
| 3869 | goto replay_sequence; | ||
| 3870 | } | ||
| 3858 | } | 3871 | } |
| 3859 | 3872 | ||
| 3860 | /* We have finally decided that KEY is something we might want | 3873 | /* We have finally decided that KEY is something we might want |