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

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

[elpa] externals/substitute 258820139a 2/3: Rename the macro and change


From: ELPA Syncer
Subject: [elpa] externals/substitute 258820139a 2/3: Rename the macro and change how the autoloads are applied
Date: Tue, 17 Jan 2023 05:58:28 -0500 (EST)

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

    Rename the macro and change how the autoloads are applied
    
    I think this is the correct approach.  We cannot add the generic
    autoload cookie to the macro, as it does not do the same thing as when
    we place it over a 'defun'.
---
 substitute.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/substitute.el b/substitute.el
index 129ef2c4f5..1585d55685 100644
--- a/substitute.el
+++ b/substitute.el
@@ -252,8 +252,7 @@ Report a `user-error' if no target is found."
         (format "\\_<%s\\_>" thing)
       (user-error "No substitution target at point")))))
 
-;;;###autoload
-(defmacro substitute-command (fn doc &optional scope)
+(defmacro substitute-define-substitute-command (fn doc &optional scope)
   "Produce substitute command using FN, DOC, and SCOPE."
   `(defun ,fn (target sub)
      ,(format
@@ -270,16 +269,19 @@ boundaries." doc)
               (substitute--prompt target ,scope))))
      (substitute--operate target sub ,scope)))
 
-(substitute-command
+;;;###autoload (autoload 'substitute-target-in-buffer "substitute")
+(substitute-define-substitute-command
  substitute-target-in-buffer
  "throughout the buffer")
 
-(substitute-command
+;;;###autoload (autoload 'substitute-target-in-defun "substitute")
+(substitute-define-substitute-command
  substitute-target-in-defun
  "in the defun (per `narrow-to-defun')"
  'defun)
 
-(substitute-command
+;;;###autoload (autoload 'substitute-target-below-point "substitute")
+(substitute-define-substitute-command
  substitute-target-below-point
  "to the end of the buffer"
  'below)
@@ -287,7 +289,8 @@ boundaries." doc)
 (defalias 'substitute-target-to-end-of-buffer
   'substitute-target-below-point)
 
-(substitute-command
+;;;###autoload (autoload 'substitute-target-above-point "substitute")
+(substitute-define-substitute-command
  substitute-target-above-point
  "to the beginning of the buffer"
  'above)



reply via email to

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