about summary refs log tree commit diff stats
path: root/lisp/+setup.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+setup.el')
-rw-r--r--lisp/+setup.el26
1 files changed, 18 insertions, 8 deletions
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 @@
49 :repeatable t 49 :repeatable t
50 :after-loaded t) 50 :after-loaded t)
51 51
52(defun +setup-straight-shorthand (sexp)
53 "Shorthand for `:straight' and other local macros."
54 (let ((recipe (cadr sexp)))
55 (or (car-safe recipe) recipe)))
56
52(setup-define :straight 57(setup-define :straight
53 (lambda (recipe) 58 (lambda (recipe)
54 `(unless (ignore-errors (straight-use-package ',recipe) t) 59 `(unless (ignore-errors (straight-use-package ',recipe) t)
@@ -59,11 +64,18 @@
59This macro can be used as HEAD, and will replace itself with the 64This macro can be used as HEAD, and will replace itself with the
60first RECIPE's package." 65first RECIPE's package."
61 :repeatable t 66 :repeatable t
62 :shorthand (lambda (sexp) 67 :shorthand #'+setup-straight-shorthand)
63 (let ((recipe (cadr sexp))) 68
64 (if (consp recipe) 69(setup-define :straight-after
65 (car recipe) 70 (lambda (recipe feature)
66 recipe)))) 71 `(with-eval-after-load ,feature
72 (setup (:straight ,recipe))))
73 :indent 1
74 :documentation
75 "Install RECIPE with `straight-use-package', after FEATURE.
76This macro can be used as HEAD, and will replace itself with the
77first RECIPE's package."
78 :shorthand #'+setup-straight-shorthand)
67 79
68(setup-define :straight-when 80(setup-define :straight-when
69 (lambda (recipe condition) 81 (lambda (recipe condition)
@@ -80,9 +92,7 @@ evaluating the body. This macro can be used as HEAD, and will
80replace itself with the RECIPE's package." 92replace itself with the RECIPE's package."
81 :repeatable 2 93 :repeatable 2
82 :indent 1 94 :indent 1
83 :shorthand (lambda (sexp) 95 :shorthand #'+setup-straight-shorthand)
84 (let ((recipe (cadr sexp)))
85 (if (consp recipe) (car recipe) recipe))))
86 96
87(provide '+setup) 97(provide '+setup)
88;;; +setup.el ends here 98;;; +setup.el ends here