emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 47aa2317c3 2/2: Use new convenience functions in replace-string


From: Lars Ingebrigtsen
Subject: master 47aa2317c3 2/2: Use new convenience functions in replace-string
Date: Tue, 9 Aug 2022 15:13:17 -0400 (EDT)

branch: master
commit 47aa2317c343de3cf1bca1e19906dccc7415fe28
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Use new convenience functions in replace-string
    
    * lisp/replace.el (replace-string): Use new convenience functions.
---
 lisp/replace.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/replace.el b/lisp/replace.el
index ae5c804be5..2bb9c1b90d 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]