From a9c4c78a68c7ee337c9b539a7cb544bbd3c16033 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 26 Mar 1998 06:31:26 +0000 Subject: [PATCH] (perform-replace): Before recursive edit, get the match data as markers, and set real-match-data. --- lisp/replace.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index 9a2da5fc2e6..ebe3088c04e 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -846,9 +846,11 @@ which will run faster and probably do exactly what you want." ((eq def 'recenter) (recenter nil)) ((eq def 'edit) - (set-match-data - (prog1 (match-data) - (save-excursion (recursive-edit)))) + (goto-char (match-beginning 0)) + (funcall search-function search-string limit t) + (setq real-match-data (match-data)) + (save-excursion (recursive-edit)) + (set-match-data real-match-data) ;; Before we make the replacement, ;; decide whether the search string ;; can match again just after this match. -- 2.39.2