GNU bug report logs -
#21684
25.0.50; undo in query-replace w/o exit
Previous Next
Reported by: Tino Calancha <f92capac <at> gmail.com>
Date: Wed, 14 Oct 2015 13:24:01 UTC
Severity: wishlist
Tags: patch
Found in version 25.0.50
Fixed in version 26.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 21684 <at> debbugs.gnu.org (full text, mbox):
> What change in functionality is being considered here?
Hi Richard,
the purpose is provide 'undo' into `query-replace'/`query-replace-regexp'.
Original code do not support such functionality in a convenient way.
For instance, in the scratch buffer:
M-x query-replace RET f RET @ RET [space] RET [space] RET C-/
(C-/ undo last replacement but end session: [space] would insert one space)
Indeed, you may correct last replacement with existing code without exit current
search replace, as follows:
I)
M-x query-replace RET f RET @ RET [space] RET [space] "^" C-r
(now you can edit last replacement; comeback to query-replace session with C-M-c)
C-M-c [space] [space] ...
This seems too complicated/slow to just undo last 1-2 replacements.
In my experience as an user 99% of the times, the situation is that i hit [space]
many times and fast, and then i realize i just want to undo last 1-2
replacements and keep going. It would be useful if that can be done just
with one key.
The patch replace-3.patch in this thread implements such interactive undo and binds
the new funtionality to keys "u" and "U".
Every time you hit "u" the latest replacement is undo: now you can hit "n" to skip
it (tipically) or [space] to replace it again, or maybe "u" to undo
another previous replacement (if any). The query-replace session is not
exit.
Tino
This bug report was last modified 8 years and 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.