From 0194e2ea2d6fb0012e8cd9ded211c2e377fce1fd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 18 Feb 2022 18:20:45 -0600 Subject: Allow :require to take no arguments --- lisp/+setup.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lisp/+setup.el b/lisp/+setup.el index bc57078..7c658b6 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el @@ -135,5 +135,20 @@ The arguments REST are handled as by `:bind'." :debug '(sexp &rest form sexp) :indent 1) +(setup-define :require + (lambda (&rest features) + (require 'cl-lib) + (if features + `(progn ,@(cl-loop for feature in features collect + `(unless (require ',feature nil t) + ,(setup-quit)))) + `(unless (require ',(setup-get 'feature) nil t) + ,(setup-quit)))) + :documentation "Try to require FEATURE, or stop evaluating body. +This macro can be used as NAME, and it will replace itself with +the first FEATURE." + :repeatable nil + :shorthand #'cadr) + (provide '+setup) ;;; +setup.el ends here -- cgit 1.4.1-21-gabe81