aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorTino Calancha2018-05-26 11:28:21 +0900
committerTino Calancha2018-05-26 11:31:26 +0900
commitea133e04f49afa7928e49a3ac4a85b47f6f13f01 (patch)
treebb297df626833d9160287fa9c9c0e8f85dd70f6e /lisp/replace.el
parent48d6212655c347ded7f4ec398467e05c6bce1dc7 (diff)
downloademacs-ea133e04f49afa7928e49a3ac4a85b47f6f13f01.tar.gz
emacs-ea133e04f49afa7928e49a3ac4a85b47f6f13f01.zip
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."
2805 (replace-match-maybe-edit 2805 (replace-match-maybe-edit
2806 next-replacement nocasify literal noedit 2806 next-replacement nocasify literal noedit
2807 real-match-data backward) 2807 real-match-data backward)
2808 replaced t)) 2808 replaced t)
2809 (setq next-replacement-replaced next-replacement))
2809 (setq done t)) 2810 (setq done t))
2810 2811
2811 ((eq def 'delete-and-edit) 2812 ((eq def 'delete-and-edit)