[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/substitute 8431c6b54d 20/39: Make local variables less
From: |
ELPA Syncer |
Subject: |
[elpa] externals/substitute 8431c6b54d 20/39: Make local variables less verbose |
Date: |
Mon, 16 Jan 2023 11:58:51 -0500 (EST) |
branch: externals/substitute
commit 8431c6b54dc83cd010567b5bbf44346c6f19cd05
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make local variables less verbose
---
substitute.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/substitute.el b/substitute.el
index 810a74a66c..d948eaa3dd 100644
--- a/substitute.el
+++ b/substitute.el
@@ -151,15 +151,15 @@ This is the subroutine of `substitute-target' and
related."
(let (count)
(save-excursion
(save-restriction
- (let ((search-direction-function 're-search-forward)
- (scope-function (lambda () (widen) (goto-char (point-min)))))
+ (let ((search-fn 're-search-forward)
+ (scope-fn (lambda () (widen) (goto-char (point-min)))))
(pcase scope
- ('below (setq scope-function (substitute--current-and-below-motion
target)))
- ('above (setq search-direction-function 're-search-backward
- scope-function (substitute--current-and-above-motion
target)))
- ('defun (setq scope-function (substitute--current-defun))))
- (funcall scope-function)
- (while (funcall search-direction-function target nil t)
+ ('below (setq scope-fn (substitute--current-and-below-motion
target)))
+ ('above (setq search-fn 're-search-backward
+ scope-fn (substitute--current-and-above-motion
target)))
+ ('defun (setq scope-fn (substitute--current-defun))))
+ (funcall scope-fn)
+ (while (funcall search-fn target nil t)
(push (match-string-no-properties 0) count)
(replace-match sub nil t)))))
(run-hook-with-args 'substitute-post-replace-hook
- [elpa] externals/substitute fd991c2e8c 07/39: Tweak one doc string format, (continued)
- [elpa] externals/substitute fd991c2e8c 07/39: Tweak one doc string format, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute ff63ce986f 06/39: Use more descriptive name for local variable, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute deb7d28b9e 09/39: Change substitute-highlight default value and fix typo, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 3c91a4a100 12/39: Define aliases for two commands, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 11b4277bfe 13/39: Remove obsolete symbol from doc strings, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute cdb23ab35c 17/39: Reference blog post in the README, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute e90152fc90 18/39: Bump version for package-vc-rebuild to do its job, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute e55a121666 25/39: Make minor formatting change, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute be5b7f3e71 11/39: Streamline all commands with a macro, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute a1382f1860 19/39: Tweak substitute backronym, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 8431c6b54d 20/39: Make local variables less verbose,
ELPA Syncer <=
- [elpa] externals/substitute 178453e3a4 22/39: Rename scope functions; make code cleaner, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 0c3e1c79ca 26/39: Add indentation in one place, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute b8cd86b7b8 28/39: Add FIXME, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute f5b7b373b1 30/39: Make link to blog easier to find, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 591d6df15b 38/39: Expand README; add video demo, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute af56e87099 31/39: Refine how description of scope is made, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 86423acf44 37/39: Use correct word in a couple of places, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 731cb688e2 39/39: Bump version to trigger GNU ELPA build, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute 3f2e429e2d 32/39: Refine substitute-command macro, ELPA Syncer, 2023/01/16
- [elpa] externals/substitute b665f84d4b 14/39: Reuse code in substitute--prompt-with-highlight, ELPA Syncer, 2023/01/16