diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2018-05-26 11:28:21 +0900 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2018-05-26 11:31:26 +0900 |
commit | ea133e04f49afa7928e49a3ac4a85b47f6f13f01 (patch) | |
tree | bb297df626833d9160287fa9c9c0e8f85dd70f6e /lisp/replace.el | |
parent | 48d6212655c347ded7f4ec398467e05c6bce1dc7 (diff) | |
download | emacs-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.el | 3 |
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) |