summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2019-09-15 16:38:23 -0700
committerGlenn Morris <rgm@gnu.org>2019-09-15 16:38:23 -0700
commita625ca5c2675a41c5c0d277def6b8cb4f4c4d6db (patch)
tree80a22e6d963bd93ba62c6df48e26aec7eecbbfa4 /lisp/replace.el
parent211dc01a7bfac81281fa80e45e21157fc0c25b26 (diff)
parent30c4f35a6fc8a6507930923766c3126ac1c2063f (diff)
downloademacs-a625ca5c2675a41c5c0d277def6b8cb4f4c4d6db.tar.gz
Merge from origin/emacs-26
30c4f35 (origin/emacs-26) query-replace-regexp undo: Update next-repl... c596be0 Amend the menu caption for page "Display Property" in the Eli... 13b9510 Add description of chinese-sisheng
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index ad9be77a79b..a82780fc47e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2698,7 +2698,7 @@ characters."
(num-replacements 0)
(nocasify t) ; Undo must preserve case (Bug#31073).
search-string
- next-replacement)
+ last-replacement)
(while (and (< stack-idx stack-len)
stack
(or (null replaced) last-was-act-and-show))
@@ -2709,9 +2709,9 @@ characters."
;; Bind swapped values
;; (search-string <--> replacement)
search-string (nth (if replaced 4 3) elt)
- next-replacement (nth (if replaced 3 4) elt)
+ last-replacement (nth (if replaced 3 4) elt)
search-string-replaced search-string
- next-replacement-replaced next-replacement
+ last-replacement-replaced last-replacement
last-was-act-and-show nil)
(when (and (= stack-idx stack-len)
@@ -2733,16 +2733,18 @@ characters."
(match-data t (nth 2 elt)))
noedit
(replace-match-maybe-edit
- next-replacement nocasify literal
+ last-replacement nocasify literal
noedit real-match-data backward)
replace-count (1- replace-count)
real-match-data
(save-excursion
(goto-char (match-beginning 0))
(if regexp-flag
- (looking-at next-replacement)
- (looking-at (regexp-quote next-replacement)))
+ (looking-at last-replacement)
+ (looking-at (regexp-quote last-replacement)))
(match-data t (nth 2 elt))))
+ (when regexp-flag
+ (setq next-replacement (nth 4 elt)))
;; Set replaced nil to keep in loop
(when (eq def 'undo-all)
(setq replaced nil