GNU bug report logs - #31538
26.1; query-replace undo fails if user edits the replacement string

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sun, 20 May 2018 12:13:02 UTC

Severity: normal

Tags: patch

Found in version 26.1

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 31538 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 31538 <at> debbugs.gnu.org
Subject: Re: bug#31538: 26.1;
 query-replace undo fails if user edits the replacement string
Date: Sun, 20 May 2018 21:39:26 +0900
Tino Calancha <tino.calancha <at> 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 <at> 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---




This bug report was last modified 7 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.