0

I want use a macro to generate a package list.

(defvar xx-packages '())

(genpack evil)
(genpack all-the-icons-ivy-rich
   :recipe (:host github :repo "seagle0128/all-the-icons-ivy-rich"))

this macro genpack will append argument to xx-packages,then xx-packages value is

xx-packages '((evil)
              (all-the-icons-ivy-rich
                   :recipe (:host github :repo "seagle0128/all-the-icons-ivy-rich"))

How can i write this macro genpack, thanks

0

1 Answer 1

1

Like this?

(defmacro genpack (&rest args)
  "Append ARGS to `xx-packages'."
  `(setq xx-packages (nconc xx-packages '(,args))))
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.