GNU bug report logs -
#78916
31.0.50; C-g fails to exit loop
Previous Next
Full log
View this message in rfc822 format
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Mike Kupfer <kupfer <at> rawbw.com>, 78916 <at> debbugs.gnu.org
> Date: Mon, 30 Jun 2025 12:01:02 -0400
>
> >> > - Both keys behave like the "old C-g".
> >> > ?
> >> I'm fine with that.
> > Same, but does it mean 'C-g' will do the same as 'q'? If not, what is
> > the difference between them?
>
> Hmm... so `q` is bound to `exit` which consumes the key and exits the
> Q&R loop. In contrast `C-g` and `C-]` were bound to `quit` which is
> not handled exlicitly by the Q&R loop, instead it just pushes the event
> back on the `unread-commend-events` before exiting the loop, so in
> Mike's test case, `q` exits the inner Q&R and passes to the next,
> whereas `C-]` aborts all the subsequent Q&R calls after which it runs
> the global binding of `C-[`.
I think I understand what you are saying about the difference between
'q' and 'C-g', but I don't see any nested query-replace in Mike's test
case, or what did I miss? Or maybe I misunderstood what you mean by
"the next"?
In practice, typing 'q' stops query-replace and leaves point at the
last match where Emacs asked me whether to replace. And 'C-g' does
the same, AFAICT.
If I'm right, then what would be an example where 'q' and 'C-g' would
behave differently?
In any case, this difference between 'q' and 'C-g' is not explained in
the user manual. The manual uses different wording to describe them,
but my interpretation of the text is that they have the same effect.
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.