changeset 44138:f1d7c706f7f7

(query-replace-read-args): New optional arg NOERROR. (perform-replace): Use save-window-excursion around recursive edit.
author Richard M. Stallman <rms@gnu.org>
date Mon, 25 Mar 2002 00:38:46 +0000
parents 32c7d9355caf
children d7e7a906dbe4
files lisp/replace.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Sun Mar 24 21:33:26 2002 +0000
+++ b/lisp/replace.el	Mon Mar 25 00:38:46 2002 +0000
@@ -62,8 +62,9 @@
   :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 @@
 			   (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,