aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTim Ruffing2023-12-27 14:29:34 +0100
committerStefan Monnier2024-03-10 10:40:11 -0400
commitd6f326452ecc761498d627a365c8014a467812eb (patch)
treedf5f9d0fe359e79fcf6324c633803d6b8dc7d50b /src
parent385a02cffde6d0fd80ff189704ad70cfebc3e8d4 (diff)
downloademacs-d6f326452ecc761498d627a365c8014a467812eb.tar.gz
emacs-d6f326452ecc761498d627a365c8014a467812eb.zip
* src/keyboard.c (requeued_events_pending_p): New function
* src/keyboard.c, src/keyboard.h (requeued_events_pending_p): Add function 'requeued_events_pending_p' (whose name was made available in the previous commit). As opposed to the previous function with the same name, the new function covers both command and other events. * src/keyboard.c (Finput_pending_p): Use the new function.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c16
-rw-r--r--src/keyboard.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index e5efde4ef53..bd8d3aa7ecf 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11573,6 +11573,18 @@ requeued_command_events_pending_p (void)
11573 return (CONSP (Vunread_command_events)); 11573 return (CONSP (Vunread_command_events));
11574} 11574}
11575 11575
11576/* Return true if there are any pending requeued events (command events
11577 or events to be processed by other levels of the input processing
11578 stages). */
11579
11580bool
11581requeued_events_pending_p (void)
11582{
11583 return (requeued_command_events_pending_p ()
11584 || !NILP (Vunread_post_input_method_events)
11585 || !NILP (Vunread_input_method_events));
11586}
11587
11576DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0, 11588DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0,
11577 doc: /* Return t if command input is currently available with no wait. 11589 doc: /* Return t if command input is currently available with no wait.
11578Actually, the value is nil only if we can be sure that no input is available; 11590Actually, the value is nil only if we can be sure that no input is available;
@@ -11581,9 +11593,7 @@ if there is a doubt, the value is t.
11581If CHECK-TIMERS is non-nil, timers that are ready to run will do so. */) 11593If CHECK-TIMERS is non-nil, timers that are ready to run will do so. */)
11582 (Lisp_Object check_timers) 11594 (Lisp_Object check_timers)
11583{ 11595{
11584 if (CONSP (Vunread_command_events) 11596 if (requeued_events_pending_p ())
11585 || !NILP (Vunread_post_input_method_events)
11586 || !NILP (Vunread_input_method_events))
11587 return (Qt); 11597 return (Qt);
11588 11598
11589 /* Process non-user-visible events (Bug#10195). */ 11599 /* Process non-user-visible events (Bug#10195). */
diff --git a/src/keyboard.h b/src/keyboard.h
index 600aaf11517..2ce003fd444 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -484,6 +484,7 @@ extern int gobble_input (void);
484extern bool input_polling_used (void); 484extern bool input_polling_used (void);
485extern void clear_input_pending (void); 485extern void clear_input_pending (void);
486extern bool requeued_command_events_pending_p (void); 486extern bool requeued_command_events_pending_p (void);
487extern bool requeued_events_pending_p (void);
487extern void bind_polling_period (int); 488extern void bind_polling_period (int);
488extern int make_ctrl_char (int) ATTRIBUTE_CONST; 489extern int make_ctrl_char (int) ATTRIBUTE_CONST;
489extern void stuff_buffered_input (Lisp_Object); 490extern void stuff_buffered_input (Lisp_Object);