summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2018-05-26 11:28:21 +0900
committerTino Calancha <tino.calancha@gmail.com>2018-05-26 11:31:26 +0900
commitea133e04f49afa7928e49a3ac4a85b47f6f13f01 (patch)
treebb297df626833d9160287fa9c9c0e8f85dd70f6e /lisp/replace.el
parent48d6212655c347ded7f4ec398467e05c6bce1dc7 (diff)
downloademacs-ea133e04f49afa7928e49a3ac4a85b47f6f13f01.tar.gz
query-replace undo: Handle when user edits the replacement string
* lisp/replace.el (perform-replace): Update the replacement string after the user edit it (Fix Bug#31538). * test/lisp/replace-tests.el (replace-tests-clauses): New function. (replace-tests-bind-read-string): New variable. (replace-tests-with-undo): Macro to create boilerplate code. (query-replace-undo-bug31073): Use it. (query-replace-undo-bug31538): New test.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index a17dd19b0d3..20b868a765c 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2805,7 +2805,8 @@ characters."
(replace-match-maybe-edit
next-replacement nocasify literal noedit
real-match-data backward)
- replaced t))
+ replaced t)
+ (setq next-replacement-replaced next-replacement))
(setq done t))
((eq def 'delete-and-edit)