Subject: bug#78737: sit-for behavior changes when byte-compiled

From: Stefan Monnier <[email-masked]>
Date: Sun, 15 Jun 2025 13:52:16 -0400

> C-g C-g C-g --- urgent quit (breaks out of read-event. should probably
> break out of redisplay too?)

Side note: "breaking out of redisplay" is not straightforward for
various reasons, such as the fact that most places where we run ELisp
try and catch every non-local exit (tho we fail to catch some `throw`s,
IIRC), or the fact that non-local exits may leave some redisplay
data-structures in an inconsistent state, or the fact that even if we
sucessfully interrupt a redisplay hang, we're likely to fall right back
into it at the next redisplay (hence really soon).

> C-g C-g C-g C-g C-g C-g --- emergency quit. ignores inhibit-quit. good
> chance of horking your Emacs by violating atomicity assumptions.

Sometimes a single `C-g` is sufficient, but it can still take a short
while for Emacs to reply, so the user may hit `C-g` repeatedly without
necessarily meaning to break a "hard hang", so it would be nice to have
some way to distinguish the two.

> Display "are you sure?" message before final C-g.

That's indeed one way to distinguish the two, but of course, maybe
displaying that message could get us back into the hang.

Another (similar option) is to jump into the debugger (from where the
users can "continue" or jump to toplevel, but which can also fall back
into the hang the user is trying to get out of).

        Stefan