Subject: bug#78916: 31.0.50; C-g fails to exit loop

From: Pip Cet <[email-masked]>
Date: Sat, 05 Jul 2025 08:23:13 +0000

"Stefan Monnier" <[email-masked]> writes:

>> (However, there are other good reason not to apply this patch, and
>> simply fix read-key to optionally allow quitting instead.
>
> The way I see it, part of this bug-report points out a bug in Q&R which
> applies not just to `C-g` but also to `C-]`, i.e. to any key bound to
> `quit` in `query-replace-map`, so what you suggest would just
> re-circumvent that bug for the `C-g` case, leaving the other case broken.

Serious question: doesn't it apply to ESC, too?  It's exit-prefix, not
quit, but rereading it over and over again also breaks Mike's loop, I
think.

> IOW, I don't think your proposal and my patch are exclusive.

Oh.  That makes sense, and installing the one-liner (or the first patch)
would fix things for now, and if we change the read-key call later,
nothing should break in terrible ways.

> I suspect it would be "more right" to call `keyboard-quit` rather than
> `(signal 'quit nil), but that's a bikeshed color I'm not wedded to).

I think usually, it's unpredictable for the user whether a C-g
interrupts a timer or other Lisp code, which causes us to signal quit,
or gets treated as input.  So making the two behave differently will
result in surprising behavior.

Pip