emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/substitute 8ac3904158 23/39: Simplify substitute--setup


From: ELPA Syncer
Subject: [elpa] externals/substitute 8ac3904158 23/39: Simplify substitute--setup-scope
Date: Mon, 16 Jan 2023 11:58:51 -0500 (EST)

branch: externals/substitute
commit 8ac39041584b01524408fc5ed9fa71dfb0c01b8d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Simplify substitute--setup-scope
---
 substitute.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/substitute.el b/substitute.el
index 841a3d4b77..51014e1d64 100644
--- a/substitute.el
+++ b/substitute.el
@@ -153,13 +153,12 @@ Pass to it the TARGET and SCOPE arguments."
 
 (defun substitute--setup-scope (target scope)
   "Derive SCOPE for TARGET."
-  (let (scope-fn)
-    (pcase scope
-      ('below (setq scope-fn (substitute--scope-current-and-below target)))
-      ('above (setq scope-fn (substitute--scope-current-and-above target)))
-      ('defun (setq scope-fn (substitute--scope-current-defun)))
-      (_ (setq scope-fn (substitute--scope-top-of-buffer))))
-    (funcall scope-fn)))
+  (funcall
+   (pcase scope
+     ('below (substitute--scope-current-and-below target))
+     ('above (substitute--scope-current-and-above target))
+     ('defun (substitute--scope-current-defun))
+     (_ (substitute--scope-top-of-buffer)))))
 
 (defun substitute--operate (target sub &optional scope)
   "Substitute TARGET with SUB in SCOPE.



reply via email to

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