summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index e1e14c92faf..d50f0d6ee30 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -850,10 +850,13 @@ which will run faster and probably do exactly what you want."
((eq def 'recenter)
(recenter nil))
((eq def 'edit)
- (goto-char (match-beginning 0))
- (funcall search-function search-string limit t)
- (setq real-match-data (match-data))
- (save-excursion (recursive-edit))
+ (let ((opos (point-marker)))
+ (goto-char (match-beginning 0))
+ (save-excursion
+ (funcall search-function search-string limit t)
+ (setq real-match-data (match-data)))
+ (save-excursion (recursive-edit))
+ (goto-char opos))
(set-match-data real-match-data)
;; Before we make the replacement,
;; decide whether the search string