summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/process.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index 9e2bdad45e3..f2c01258774 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1875,7 +1875,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
to give it higher priority than subprocesses */
if (XINT (read_kbd) && detect_input_pending ())
- break;
+ {
+ swallow_events ();
+ if (detect_input_pending ())
+ break;
+ }
/* Exit now if the cell we're waiting for became non-nil. */
if (wait_for_cell && ! NILP (*wait_for_cell))