summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-08-09 21:12:54 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-08-09 21:13:10 +0200
commit47aa2317c343de3cf1bca1e19906dccc7415fe28 (patch)
tree9dfebf57a34f5c5f27600d8b9bb56289489134c9
parent6ac92c65a800e593d6a8aaf7f089c3811fcb7f33 (diff)
downloademacs-47aa2317c343de3cf1bca1e19906dccc7415fe28.tar.gz
Use new convenience functions in replace-string
* lisp/replace.el (replace-string): Use new convenience functions.
-rw-r--r--lisp/replace.el7
1 files changed, 3 insertions, 4 deletions
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))