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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Jul 2025 09:36:22 +0300

> Date: Fri, 04 Jul 2025 18:16:29 +0000
> From: Pip Cet <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> 
> "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.
> >
> > That wouldn't fix the `C-]` case.
> 
> I'm not sure it's that important.  It's not documented in
> query-replace-help, and I'm not really sure whether it should behave
> like C-g or ESC (or should ESC be fixed, too?) or any unbound key (like
> "r").

C-] is documented in the manual as part of this catch-all:

     Aside from this, any other character exits the ‘query-replace’, and
  is then reread as part of a key sequence.  Thus, if you type ‘C-k’, it
  exits the ‘query-replace’ and then kills to end of line.  In particular,
  ‘C-g’ simply exits the ‘query-replace’.

> The C-g case is documented (because C-g is documented for all of Emacs,
> and exceptions are noted)

C-g is documented specially in query-replace, see above.