bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31538: 26.1; query-replace undo fails if user edits the replacement


From: Tino Calancha
Subject: bug#31538: 26.1; query-replace undo fails if user edits the replacement string
Date: Sun, 20 May 2018 21:39:26 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Tino Calancha <tino.calancha@gmail.com> writes:

> M-<
> M-% is RET foo RET SPC E bar RET U
> ;; Just drop 'foo' but keeps 'bar'.

Update the replacement string after the user has input
the new value.
--8<-----------------------------cut here---------------start------------->8---
commit 5655739cedb02946dd16071a64e51fcab08abf8b
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Sun May 20 21:32:55 2018 +0900

    Fix Bug#31538
    
    * lisp/replace.el (perform-replace): Update the replacement string
    after the user edit it.

diff --git a/lisp/replace.el b/lisp/replace.el
index 3503b656d9..8605577066 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2801,7 +2801,8 @@ perform-replace
                                 (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)

--8<-----------------------------cut here---------------end--------------->8---





reply via email to

[Prev in Thread] Current Thread [Next in Thread]