aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-24 12:35:48 +0000
committerGerd Moellmann2001-10-24 12:35:48 +0000
commit99a7559fb31cbaf65133e05d936f273b2c3947ae (patch)
tree3615d5e7f82b3cc030feccfd30d3e0cd090b0223
parentf8f7ab5469962c6038cba9ac1223783d07b95d70 (diff)
downloademacs-99a7559fb31cbaf65133e05d936f273b2c3947ae.tar.gz
emacs-99a7559fb31cbaf65133e05d936f273b2c3947ae.zip
(perform-replace): Move START and END parameters
to the end of the argument list and make them optional.
-rw-r--r--lisp/replace.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index e0b815adfa1..aabe37f011d 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -95,7 +95,7 @@ Fourth and fifth arg START and END specify the region to operate on.
95 95
96To customize possible responses, change the \"bindings\" in `query-replace-map'." 96To customize possible responses, change the \"bindings\" in `query-replace-map'."
97 (interactive (query-replace-read-args "Query replace" nil)) 97 (interactive (query-replace-read-args "Query replace" nil))
98 (perform-replace from-string to-string start end t nil delimited)) 98 (perform-replace from-string to-string t nil delimited nil nil start end))
99 99
100(define-key esc-map "%" 'query-replace) 100(define-key esc-map "%" 'query-replace)
101 101
@@ -122,7 +122,7 @@ In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
122and `\\=\\N' (where N is a digit) stands for 122and `\\=\\N' (where N is a digit) stands for
123 whatever what matched the Nth `\\(...\\)' in REGEXP." 123 whatever what matched the Nth `\\(...\\)' in REGEXP."
124 (interactive (query-replace-read-args "Query replace regexp" t)) 124 (interactive (query-replace-read-args "Query replace regexp" t))
125 (perform-replace regexp to-string start end t t delimited)) 125 (perform-replace regexp to-string t t delimited nil nil start end))
126(define-key esc-map [?\C-%] 'query-replace-regexp) 126(define-key esc-map [?\C-%] 'query-replace-regexp)
127 127
128(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) 128(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end)
@@ -172,7 +172,7 @@ Fourth and fifth arg START and END specify the region to operate on."
172 (replace-match-string-symbols to) 172 (replace-match-string-symbols to)
173 (list from (car to) current-prefix-arg start end))) 173 (list from (car to) current-prefix-arg start end)))
174 (perform-replace regexp (cons 'replace-eval-replacement to-expr) 174 (perform-replace regexp (cons 'replace-eval-replacement to-expr)
175 start end t t delimited)) 175 t t delimited nil nil start end))
176 176
177(defun map-query-replace-regexp (regexp to-strings &optional n start end) 177(defun map-query-replace-regexp (regexp to-strings &optional n start end)
178 "Replace some matches for REGEXP with various strings, in rotation. 178 "Replace some matches for REGEXP with various strings, in rotation.
@@ -223,7 +223,7 @@ Fourth and fifth arg START and END specify the region to operate on."
223 (1+ (string-match " " to-strings)))) 223 (1+ (string-match " " to-strings))))
224 (setq replacements (append replacements (list to-strings)) 224 (setq replacements (append replacements (list to-strings))
225 to-strings "")))) 225 to-strings ""))))
226 (perform-replace regexp replacements start end t t nil n))) 226 (perform-replace regexp replacements t t nil n nil start end)))
227 227
228(defun replace-string (from-string to-string &optional delimited start end) 228(defun replace-string (from-string to-string &optional delimited start end)
229 "Replace occurrences of FROM-STRING with TO-STRING. 229 "Replace occurrences of FROM-STRING with TO-STRING.
@@ -251,7 +251,7 @@ which will run faster and will not set the mark or print anything.
251\(You may need a more complex loop if FROM-STRING can match the null string 251\(You may need a more complex loop if FROM-STRING can match the null string
252and TO-STRING is also null.)" 252and TO-STRING is also null.)"
253 (interactive (query-replace-read-args "Replace string" nil)) 253 (interactive (query-replace-read-args "Replace string" nil))
254 (perform-replace from-string to-string start end nil nil delimited)) 254 (perform-replace from-string to-string nil nil delimited nil nil start end))
255 255
256(defun replace-regexp (regexp to-string &optional delimited start end) 256(defun replace-regexp (regexp to-string &optional delimited start end)
257 "Replace things after point matching REGEXP with TO-STRING. 257 "Replace things after point matching REGEXP with TO-STRING.
@@ -278,7 +278,7 @@ What you probably want is a loop like this:
278 (replace-match TO-STRING nil nil)) 278 (replace-match TO-STRING nil nil))
279which will run faster and will not set the mark or print anything." 279which will run faster and will not set the mark or print anything."
280 (interactive (query-replace-read-args "Replace regexp" t)) 280 (interactive (query-replace-read-args "Replace regexp" t))
281 (perform-replace regexp to-string start end nil t delimited)) 281 (perform-replace regexp to-string nil t delimited nil nil start end))
282 282
283 283
284(defvar regexp-history nil 284(defvar regexp-history nil
@@ -870,9 +870,9 @@ type them."
870 (aset data 2 (if (consp next) next (aref data 3)))))) 870 (aset data 2 (if (consp next) next (aref data 3))))))
871 (car (aref data 2))) 871 (car (aref data 2)))
872 872
873(defun perform-replace (from-string replacements start end 873(defun perform-replace (from-string replacements
874 query-flag regexp-flag delimited-flag 874 query-flag regexp-flag delimited-flag
875 &optional repeat-count map) 875 &optional repeat-count map start end)
876 "Subroutine of `query-replace'. Its complexity handles interactive queries. 876 "Subroutine of `query-replace'. Its complexity handles interactive queries.
877Don't use this in your own program unless you want to query and set the mark 877Don't use this in your own program unless you want to query and set the mark
878just as `query-replace' does. Instead, write a simple loop like this: 878just as `query-replace' does. Instead, write a simple loop like this: