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.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/+setup.el b/lisp/+setup.el index 919e312..1f110d6 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el
@@ -80,21 +80,22 @@ If PATH does not exist, abort the evaluation."
80 80
81;;; Straight.el 81;;; Straight.el
82 82
83(with-eval-after-load 'straight 83(defun setup--straight-handle-arg (arg var)
84 (defun setup--straight-handle-arg (arg var) 84 (cond
85 (cond 85 ((and (boundp var) (symbol-value var)) t)
86 ((and (boundp var) (symbol-value var)) t) 86 ((keywordp arg) (set var t))
87 ((keywordp arg) (set var t)) 87 ((functionp arg) (set var nil) (funcall arg))
88 ((functionp arg) (set var nil) (funcall arg)) 88 ((listp arg) (set var nil) arg)))
89 ((listp arg) (set var nil) (eval arg :lexical))))
90 89
90(with-eval-after-load 'straight
91 (setup-define :straight 91 (setup-define :straight
92 (lambda (recipe &rest predicates) 92 (lambda (recipe &rest predicates)
93 (let* ((skp (make-symbol "straight-keyword-p")) 93 (let* ((skp (make-symbol "straight-keyword-p"))
94 (straight-use-p 94 (straight-use-p
95 (cl-every (lambda (f) (setup--straight-handle-arg f skp)) 95 (cl-mapcar
96 predicates)) 96 (lambda (f) (setup--straight-handle-arg f skp))
97 (form `(unless (and ,straight-use-p 97 predicates))
98 (form `(unless (and ,@straight-use-p
98 (condition-case e 99 (condition-case e
99 (straight-use-package ',recipe) 100 (straight-use-package ',recipe)
100 (error 101 (error