]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/keyboard.c (requeued_events_pending_p): New function
authorTim Ruffing <crypto@timruffing.de>
Wed, 27 Dec 2023 13:29:34 +0000 (14:29 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 11 Mar 2024 09:26:13 +0000 (10:26 +0100)
* 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.

(cherry picked from commit d6f326452ecc761498d627a365c8014a467812eb)

src/keyboard.c
src/keyboard.h

index e5efde4ef535d5def7302cae86207e4e5315f321..bd8d3aa7ecf46255db224782578e8afa7e6f043e 100644 (file)
@@ -11573,6 +11573,18 @@ requeued_command_events_pending_p (void)
   return (CONSP (Vunread_command_events));
 }
 
+/* Return true if there are any pending requeued events (command events
+   or events to be processed by other levels of the input processing
+   stages).  */
+
+bool
+requeued_events_pending_p (void)
+{
+  return (requeued_command_events_pending_p ()
+         || !NILP (Vunread_post_input_method_events)
+         || !NILP (Vunread_input_method_events));
+}
+
 DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0,
        doc: /* Return t if command input is currently available with no wait.
 Actually, 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.
 If CHECK-TIMERS is non-nil, timers that are ready to run will do so.  */)
   (Lisp_Object check_timers)
 {
-  if (CONSP (Vunread_command_events)
-      || !NILP (Vunread_post_input_method_events)
-      || !NILP (Vunread_input_method_events))
+  if (requeued_events_pending_p ())
     return (Qt);
 
   /* Process non-user-visible events (Bug#10195).  */
index 600aaf11517e484ec43e6c9507ab5d128329a939..2ce003fd444b504576369dc745682e7c292d4903 100644 (file)
@@ -484,6 +484,7 @@ extern int gobble_input (void);
 extern bool input_polling_used (void);
 extern void clear_input_pending (void);
 extern bool requeued_command_events_pending_p (void);
+extern bool requeued_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);