From da92ad2eaa151b2f5865e6d9bc95fa7009860bd8 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Tue, 10 Jun 2025 11:31:39 -0700 Subject: [PATCH] Make quit more prompt by processing signals first * src/eval.c (probably_quit): Process pending signals before checking quit flag, which may set the quit flag itself. This makes C-g more responsive when there are pending events. --- src/eval.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/eval.c b/src/eval.c index fbb881d682d..3a22e990236 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1859,10 +1859,14 @@ void probably_quit (void) { specpdl_ref gc_count = inhibit_garbage_collection (); - if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) - process_quit_flag (); - else if (pending_signals) + + /* Quit promptly if processing pending signals makes us want to + quit. */ + if (!QUITP && pending_signals) process_pending_signals (); + if (QUITP) + process_quit_flag (); + unbind_to (gc_count, Qnil); }