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

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

[elpa] externals/substitute 3f2e429e2d 32/39: Refine substitute-command


From: ELPA Syncer
Subject: [elpa] externals/substitute 3f2e429e2d 32/39: Refine substitute-command macro
Date: Mon, 16 Jan 2023 11:58:52 -0500 (EST)

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

    Refine substitute-command macro
---
 substitute.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/substitute.el b/substitute.el
index 4a04ce0041..82a3daa2f9 100644
--- a/substitute.el
+++ b/substitute.el
@@ -185,7 +185,7 @@ Report a `user-error' if no target is found."
    (t (or (format "\\_<%s\\_>" (thing-at-point 'symbol t))
           (user-error "No substitution target at point")))))
 
-(defmacro substitute-command (fn doc scope)
+(defmacro substitute-command (fn doc &optional scope)
   "Produce substitute command using FN, DOC, and SCOPE."
   `(defun ,fn (target sub)
      ,(format
@@ -199,14 +199,13 @@ boundaries." doc)
      (interactive
       (let ((target (substitute--target)))
         (list target
-              (substitute--prompt target current-prefix-arg))))
+              (substitute--prompt target ,scope))))
      (substitute--operate target sub ,scope)))
 
 ;;;###autoload
 (substitute-command
  substitute-target-in-buffer
- "throughout the buffer"
- nil)
+ "throughout the buffer")
 
 ;;;###autoload
 (substitute-command



reply via email to

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