From: Lars Ingebrigtsen Date: Tue, 9 Aug 2022 19:12:54 +0000 (+0200) Subject: Use new convenience functions in replace-string X-Git-Tag: emacs-29.0.90~1447^2~274 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=47aa2317c343de3cf1bca1e19906dccc7415fe28;p=emacs.git Use new convenience functions in replace-string * lisp/replace.el (replace-string): Use new convenience functions. --- diff --git a/lisp/replace.el b/lisp/replace.el index ae5c804be57..2bb9c1b90dc 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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))