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

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

[elpa] externals/dash 0f13e5e 246/316: Prefer push over add-to-list


From: ELPA Syncer
Subject: [elpa] externals/dash 0f13e5e 246/316: Prefer push over add-to-list
Date: Mon, 15 Feb 2021 15:58:10 -0500 (EST)

branch: externals/dash
commit 0f13e5e0bc835719ea425ae4714ac6c2d12cc912
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Prefer push over add-to-list
    
    * dev/examples-to-docs.el (defexamples, def-example-group):
    * dev/examples-to-info.el (defexamples, def-example-group): Replace
    unneeded add-to-list with push.
---
 dev/examples-to-docs.el | 14 +++++++-------
 dev/examples-to-info.el | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el
index 0d30aee..e93a3e9 100644
--- a/dev/examples-to-docs.el
+++ b/dev/examples-to-docs.el
@@ -66,17 +66,17 @@ FUNCTION may reference an elisp function, alias, macro or a 
subr."
       (help-function-arglist function-symbol))))
 
 (defmacro defexamples (cmd &rest examples)
-  `(add-to-list 'functions (list
-                            ',cmd
-                            (docs--signature ',cmd)
-                            (documentation ',cmd)
-                            (-map 'example-to-string (-partition 3 
',examples)))))
+  `(push (list ',cmd
+               (docs--signature ',cmd)
+               (documentation ',cmd)
+               (mapcar #'example-to-string (-partition 3 ',examples)))
+         functions))
 
 (defmacro def-example-group (group desc &rest examples)
   `(progn
-     (add-to-list 'functions ,(concat "### " group))
+     (push ,(concat "### " group) functions)
      (when ,desc
-       (add-to-list 'functions ,desc))
+       (push ,desc functions))
      ,@examples))
 
 (defun quote-and-downcase (string)
diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index a011a41..e8b32bd 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -70,17 +70,17 @@ FUNCTION may reference an elisp function, alias, macro or a 
subr."
       (help-function-arglist function-symbol))))
 
 (defmacro defexamples (cmd &rest examples)
-  `(add-to-list 'functions (list
-                            ',cmd
-                            (docs--signature ',cmd)
-                            (documentation ',cmd)
-                            (-map 'example-to-string (-partition 3 
',examples)))))
+  `(push (list ',cmd
+               (docs--signature ',cmd)
+               (documentation ',cmd)
+               (mapcar #'example-to-string (-partition 3 ',examples)))
+         functions))
 
 (defmacro def-example-group (group desc &rest examples)
   `(progn
-     (add-to-list 'functions ,(concat "### " group))
+     (push ,(concat "### " group) functions)
      (when ,desc
-       (add-to-list 'functions ,desc))
+       (push ,desc functions))
      ,@examples))
 
 (defun quote-and-downcase (string)



reply via email to

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