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

From: Daniel Colascione <[email-masked]>
Date: Tue, 10 Jun 2025 12:34:34 -0700

Stefan Monnier <[email-masked]> writes:

>> BTW: the problem isn't just with transient. It also manifests with
>> read-extended-command! It's a nasty race that, AFAICT, has been with us
>> since the 90s. I think defining read_char to translate quits to quit_char
>> solves the problem.
>
> I like your way of thinking.  I'm not completely sure it will solve
> world hunger, and it may come with regressions, but it's worth a try.
> Given the pervasive impact, it might be best to have a global config var
> to enable/disable it (with some scary internal name) until we're
> confident that it's an improvement.

Check out the branch dancol/quit-improvements2 with a fix for this
problem and multiple others I found along the way.  There, we make
read_char report quits as quit_char, protect timer callbacks against
quits properly, inhibit quits in redisplay by default, attempt to quit
more often reading process output, and fix the original
throw-on-input bug.

It's now robust against the (compile "cat /dev/urandom") test, which is
actually a pretty good poor man's fuzz and load test!

(It's dancol/quit-improvements2 not dancol/quit-improvements because I
can't force-push even to a non-mainline branch.  Shouldn't we allow
off-mainline force pushes?)