From 2243b1e4effdeda0cec9cde4a49fd9ac8a5f9271 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 16 Jan 2022 23:13:11 -0600 Subject: Dammit, lots of changes --- lisp/+setup.el | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'lisp/+setup.el') diff --git a/lisp/+setup.el b/lisp/+setup.el index 6c8e31e..367fb01 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el @@ -49,6 +49,11 @@ :repeatable t :after-loaded t) +(defun +setup-straight-shorthand (sexp) + "Shorthand for `:straight' and other local macros." + (let ((recipe (cadr sexp))) + (or (car-safe recipe) recipe))) + (setup-define :straight (lambda (recipe) `(unless (ignore-errors (straight-use-package ',recipe) t) @@ -59,11 +64,18 @@ This macro can be used as HEAD, and will replace itself with the first RECIPE's package." :repeatable t - :shorthand (lambda (sexp) - (let ((recipe (cadr sexp))) - (if (consp recipe) - (car recipe) - recipe)))) + :shorthand #'+setup-straight-shorthand) + +(setup-define :straight-after + (lambda (recipe feature) + `(with-eval-after-load ,feature + (setup (:straight ,recipe)))) + :indent 1 + :documentation + "Install RECIPE with `straight-use-package', after FEATURE. +This macro can be used as HEAD, and will replace itself with the +first RECIPE's package." + :shorthand #'+setup-straight-shorthand) (setup-define :straight-when (lambda (recipe condition) @@ -80,9 +92,7 @@ evaluating the body. This macro can be used as HEAD, and will replace itself with the RECIPE's package." :repeatable 2 :indent 1 - :shorthand (lambda (sexp) - (let ((recipe (cadr sexp))) - (if (consp recipe) (car recipe) recipe)))) + :shorthand #'+setup-straight-shorthand) (provide '+setup) ;;; +setup.el ends here -- cgit 1.4.1-21-gabe81