From 86914dcca234e932bee38d01caa734aa74f4f7f6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 25 Mar 2002 00:38:46 +0000 Subject: [PATCH] (query-replace-read-args): New optional arg NOERROR. (perform-replace): Use save-window-excursion around recursive edit. --- lisp/replace.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index 4e6b3cbfafe..0e5f05aea7f 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -62,8 +62,9 @@ strings or patterns." :group 'matching :version "21.3") -(defun query-replace-read-args (string regexp-flag) - (barf-if-buffer-read-only) +(defun query-replace-read-args (string regexp-flag &optional noerror) + (unless noerror + (barf-if-buffer-read-only)) (let (from to) (if query-replace-interactive (setq from (car (if regexp-flag regexp-search-ring search-ring))) @@ -1128,7 +1129,9 @@ see the documentation of `replace-match' to find out how to simulate (save-excursion (funcall search-function search-string limit t) (setq real-match-data (match-data))) - (save-excursion (recursive-edit)) + (save-excursion + (save-window-excursion + (recursive-edit))) (goto-char opos)) (set-match-data real-match-data) ;; Before we make the replacement, -- 2.39.2