aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorRichard M. Stallman2002-03-25 00:38:46 +0000
committerRichard M. Stallman2002-03-25 00:38:46 +0000
commit86914dcca234e932bee38d01caa734aa74f4f7f6 (patch)
treee768a2f629b487d0e85561ef51e2803b2df0c503 /lisp/replace.el
parent34b8f593f367c2380dceed862a378e040ea19cc7 (diff)
downloademacs-86914dcca234e932bee38d01caa734aa74f4f7f6.tar.gz
emacs-86914dcca234e932bee38d01caa734aa74f4f7f6.zip
(query-replace-read-args): New optional arg NOERROR.
(perform-replace): Use save-window-excursion around recursive edit.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el9
1 files 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."
62 :group 'matching 62 :group 'matching
63 :version "21.3") 63 :version "21.3")
64 64
65(defun query-replace-read-args (string regexp-flag) 65(defun query-replace-read-args (string regexp-flag &optional noerror)
66 (barf-if-buffer-read-only) 66 (unless noerror
67 (barf-if-buffer-read-only))
67 (let (from to) 68 (let (from to)
68 (if query-replace-interactive 69 (if query-replace-interactive
69 (setq from (car (if regexp-flag regexp-search-ring search-ring))) 70 (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
1128 (save-excursion 1129 (save-excursion
1129 (funcall search-function search-string limit t) 1130 (funcall search-function search-string limit t)
1130 (setq real-match-data (match-data))) 1131 (setq real-match-data (match-data)))
1131 (save-excursion (recursive-edit)) 1132 (save-excursion
1133 (save-window-excursion
1134 (recursive-edit)))
1132 (goto-char opos)) 1135 (goto-char opos))
1133 (set-match-data real-match-data) 1136 (set-match-data real-match-data)
1134 ;; Before we make the replacement, 1137 ;; Before we make the replacement,