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.
This commit is contained in:
Daniel Colascione 2025-06-10 11:31:39 -07:00
parent f3c188ceb0
commit da92ad2eaa

View file

@ -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);
}