GNU bug report logs - #78916
31.0.50; C-g fails to exit loop

Previous Next

Package: emacs;

Reported by: Mike Kupfer <kupfer <at> rawbw.com>

Date: Fri, 27 Jun 2025 21:37:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Pip Cet <pipcet <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>, 78916 <at> debbugs.gnu.org, kupfer <at> rawbw.com
Subject: bug#78916: 31.0.50; C-g fails to exit loop
Date: Thu, 03 Jul 2025 17:43:25 +0000
"Stefan Monnier via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs <at> gnu.org> writes:

>> I agree that calling keyboard-quit is better.
>
> So, I suggest the patch below.

I'd just like to note that this breaks badly if quitchar is changed.
That doesn't mean we shouldn't apply this patch, it means we should
remove the vestigial support for changing quitchar from keyboard.c

(However, there are other good reason not to apply this patch, and
simply fix read-key to optionally allow quitting instead.  There is no
reason to make Lisp users choose between having to handle quit
themselves (which currently requires mucking about with low-level input
details such as determining quitchar) and having to handle low-level
events themselves.  Most users don't want to do either thing.

And we definitely need to fix

   (while t (message "%S" (read-key)))

destroying your session.  It's simply a bug in keyboard.c that this
isn't recognized by the triple-C-g code in GUI sessions, or the
double-C-g code in terminal sessions.

IMHO, no further replacements of read-event by read-key should be
performed until we've made the latter function less hostile to novice
Lisp hackers.)

Pip





This bug report was last modified 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.