From 848ede9b578833414e764d9f9dd85b7677a4b110 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Wed, 27 Dec 2023 14:29:34 +0100 Subject: [PATCH 2/5] * src/keyboard.c (requeued_events_pending_p): Improve name and fix comment * src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Rename to 'requeued_command_events_pending_p' to clarify that the function covers only command events. Fix wrong comment that claimed that the function was unused. * src/process.c (wait_reading_process_output): Update caller to use the new name. --- src/keyboard.c | 8 ++------ src/keyboard.h | 2 +- src/process.c | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index b6fc568cde5..e5efde4ef53 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11565,14 +11565,10 @@ clear_input_pending (void) input_pending = false; } -/* Return true if there are pending requeued events. - This isn't used yet. The hope is to make wait_reading_process_output - call it, and return if it runs Lisp code that unreads something. - The problem is, kbd_buffer_get_event needs to be fixed to know what - to do in that case. It isn't trivial. */ +/* Return true if there are pending requeued command events. */ bool -requeued_events_pending_p (void) +requeued_command_events_pending_p (void) { return (CONSP (Vunread_command_events)); } diff --git a/src/keyboard.h b/src/keyboard.h index 68e68bc2ae3..600aaf11517 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -483,7 +483,7 @@ #define EVENT_HEAD_KIND(event_head) \ extern int gobble_input (void); extern bool input_polling_used (void); extern void clear_input_pending (void); -extern bool requeued_events_pending_p (void); +extern bool requeued_command_events_pending_p (void); extern void bind_polling_period (int); extern int make_ctrl_char (int) ATTRIBUTE_CONST; extern void stuff_buffered_input (Lisp_Object); diff --git a/src/process.c b/src/process.c index 48a2c0c8e53..6b8b483cdf7 100644 --- a/src/process.c +++ b/src/process.c @@ -5439,7 +5439,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If there is unread keyboard input, also return. */ if (read_kbd != 0 - && requeued_events_pending_p ()) + && requeued_command_events_pending_p ()) break; /* This is so a breakpoint can be put here. */ @@ -5849,7 +5849,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If there is unread keyboard input, also return. */ if (read_kbd != 0 - && requeued_events_pending_p ()) + && requeued_command_events_pending_p ()) break; /* If we are not checking for keyboard input now, @@ -8036,7 +8036,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If there is unread keyboard input, also return. */ if (read_kbd != 0 - && requeued_events_pending_p ()) + && requeued_command_events_pending_p ()) break; if (timespec_valid_p (timer_delay)) @@ -8109,7 +8109,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If there is unread keyboard input, also return. */ if (read_kbd - && requeued_events_pending_p ()) + && requeued_command_events_pending_p ()) break; /* If wait_for_cell. check for keyboard input -- 2.44.0