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
View this message in rfc822 format
> Quite often, performing query-replace, i just hit the [space] quicky
> with no much attention. If i replace one string by mistake, i can
> comeback to it with "^", but if i edit the string with "E" to reset it to
> its original value, the interactive query-replace session ends.
>
> I found useful if we can undo such replacements without exiting the
> query-replace.
>
> The attached patch implement such behaviour for `query-replace'.
> Having this also working for `query-replace-regexp' would be very nice,
> but harder to implement.
This would be a useful feature. But I wonder why it's harder to
implement for regexps? If you need, you could add all previous
replacements strings to the same stack at the end of data elements in
the stack like we did when necessary by adding new data at the end of the
similar isearch stack elements in isearch-cmds. This would simplify
restoring the previous replaced strings from the stack.
PS: an alternative solution would be to call ordinary (undo) since
perform-replace places undo boundaries with (undo-boundary), but
it seems this would be a less reliable approach?
This bug report was last modified 8 years and 263 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.