diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-12-12 09:56:04 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-12-12 09:56:04 -0500 |
commit | adbb4eacc2a984c0fc0b65ec761368fd9067d6c5 (patch) | |
tree | f2496954a664e3c02f01a76b4f22ec1a479fd3d9 /src/process.c | |
parent | 7ee0fc0dc1a7cba8a3e965f411aca498a7db3f4f (diff) | |
download | emacs-adbb4eacc2a984c0fc0b65ec761368fd9067d6c5.tar.gz |
* src/keyboard.c: Fix bug#5803.
A long time ago, `read_key_sequence` used to read the keymaps at the
start, so if something happened between this start and the moment
the user actually hits a key, `read_key_sequence` could end up using
the wrong keymaps. To work around this problem, the code used
`record_asynch_buffer_change` to try and trigger `read_key_sequence`
to re-read the keymaps in some known cases.
Several years ago, `read_key_sequence` was changed so as to read the keymaps
only once the user hits a key, making this machinery now redundant
(and also harmful apparently in bug#5803 because it introduces
"spurious" events).
So we here remove `record_asynch_buffer_change` and the
`BUFFER_SWITCH_EVENT` and `Qbuffer_switch` pseudo-events it generated.
* src/termhooks.h (enum event_kind): Delete `BUFFER_SWITCH_EVENT`.
* src/keyboard.c: (record_asynch_buffer_change): Delete function.
(syms_of_keyboard): Delete `Qbuffer_switch`.
(force_auto_save_soon, readable_events)
(kbd_buffer_store_buffered_event, kbd_buffer_get_event)
(make_lispy_event):
* src/xterm.c (handle_one_xevent):
* src/w32term.c (w32_read_socket):
* src/process.c (wait_reading_process_output)
(read_and_dispose_of_process_output, exec_sentinel): Simplify accordingly.
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/process.c b/src/process.c index bf64ead24e5..48b727d9e3b 100644 --- a/src/process.c +++ b/src/process.c @@ -5333,14 +5333,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, timer_delay = timer_check (); - /* If a timer has run, this might have changed buffers - an alike. Make read_key_sequence aware of that. */ - if (timers_run != old_timers_run - && (old_buffer != current_buffer - || !EQ (old_window, selected_window)) - && waiting_for_user_input_p == -1) - record_asynch_buffer_change (); - if (timers_run != old_timers_run && do_display) /* We must retry, since a timer may have requeued itself and that could alter the time_delay. */ @@ -5706,14 +5698,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, leave = true; } - /* If a timer has run, this might have changed buffers - an alike. Make read_key_sequence aware of that. */ - if (timers_run != old_timers_run - && waiting_for_user_input_p == -1 - && (old_buffer != current_buffer - || !EQ (old_window, selected_window))) - record_asynch_buffer_change (); - if (leave) break; } @@ -6213,18 +6197,6 @@ read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars, /* Restore waiting_for_user_input_p as it was when we were called, in case the filter clobbered it. */ waiting_for_user_input_p = waiting; - -#if 0 /* Call record_asynch_buffer_change unconditionally, - because we might have changed minor modes or other things - that affect key bindings. */ - if (! EQ (Fcurrent_buffer (), obuffer) - || ! EQ (current_buffer->keymap, okeymap)) -#endif - /* But do it only if the caller is actually going to read events. - Otherwise there's no need to make him wake up, and it could - cause trouble (for example it would make sit_for return). */ - if (waiting_for_user_input_p == -1) - record_asynch_buffer_change (); } DEFUN ("internal-default-process-filter", Finternal_default_process_filter, @@ -7390,16 +7362,6 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason) when we were called, in case the filter clobbered it. */ waiting_for_user_input_p = waiting; -#if 0 - if (! EQ (Fcurrent_buffer (), obuffer) - || ! EQ (current_buffer->keymap, okeymap)) -#endif - /* But do it only if the caller is actually going to read events. - Otherwise there's no need to make him wake up, and it could - cause trouble (for example it would make sit_for return). */ - if (waiting_for_user_input_p == -1) - record_asynch_buffer_change (); - unbind_to (count, Qnil); } |