diff options
author | Case Duckworth | 2022-02-18 18:20:45 -0600 |
---|---|---|
committer | Case Duckworth | 2022-02-18 18:24:52 -0600 |
commit | 0194e2ea2d6fb0012e8cd9ded211c2e377fce1fd (patch) | |
tree | 596c3fe9c3191f845de9e7c1e4d0beec83de78d7 | |
parent | Move :quit around (diff) | |
download | emacs-0194e2ea2d6fb0012e8cd9ded211c2e377fce1fd.tar.gz emacs-0194e2ea2d6fb0012e8cd9ded211c2e377fce1fd.zip |
Allow :require to take no arguments
-rw-r--r-- | lisp/+setup.el | 15 |
1 files changed, 15 insertions, 0 deletions
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'." | |||
135 | :debug '(sexp &rest form sexp) | 135 | :debug '(sexp &rest form sexp) |
136 | :indent 1) | 136 | :indent 1) |
137 | 137 | ||
138 | (setup-define :require | ||
139 | (lambda (&rest features) | ||
140 | (require 'cl-lib) | ||
141 | (if features | ||
142 | `(progn ,@(cl-loop for feature in features collect | ||
143 | `(unless (require ',feature nil t) | ||
144 | ,(setup-quit)))) | ||
145 | `(unless (require ',(setup-get 'feature) nil t) | ||
146 | ,(setup-quit)))) | ||
147 | :documentation "Try to require FEATURE, or stop evaluating body. | ||
148 | This macro can be used as NAME, and it will replace itself with | ||
149 | the first FEATURE." | ||
150 | :repeatable nil | ||
151 | :shorthand #'cadr) | ||
152 | |||
138 | (provide '+setup) | 153 | (provide '+setup) |
139 | ;;; +setup.el ends here | 154 | ;;; +setup.el ends here |