Use new convenience functions in replace-string

* lisp/replace.el (replace-string): Use new convenience functions.
This commit is contained in:
Lars Ingebrigtsen 2022-08-09 21:12:54 +02:00
parent 6ac92c65a8
commit 47aa2317c3

View file

@ -666,8 +666,8 @@ and TO-STRING is also null.)"
(declare (interactive-only
"use `search-forward' and `replace-match' instead.")
(interactive-args
(start (if (use-region-p) (region-beginning)))
(end (if (use-region-p) (region-end)))))
(start (use-region-beginning))
(end (use-region-end))))
(interactive
(let ((common
(query-replace-read-args
@ -679,8 +679,7 @@ and TO-STRING is also null.)"
(if (use-region-p) " in region" ""))
nil)))
(list (nth 0 common) (nth 1 common) (nth 2 common)
(if (use-region-p) (region-beginning))
(if (use-region-p) (region-end))
(use-region-beginning) (use-region-end)
(nth 3 common)
(if (use-region-p) (region-noncontiguous-p)))))
(perform-replace from-string to-string nil nil delimited nil nil start end backward region-noncontiguous-p))