branch: externals/setup
commit 262407694bb91b7ec4bae9582d7a38e782ed887c
Author: Philip K <phil...@posteo.net>
Commit: Philip K <phil...@posteo.net>

    Add general conditional macro :if
---
 setup.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/setup.el b/setup.el
index 1e884f9..dfbcdb1 100644
--- a/setup.el
+++ b/setup.el
@@ -335,6 +335,14 @@ form (append VAR), "
   :documentation "If PROGRAM is not in the path, stop here."
   :repeatable t)
 
+(setup-define :if
+  (lambda (condition)
+    `(unless ,condition
+       (throw 'setup-exit nil)))
+  :signature '(CONDITION ...)
+  :documentation "If CONDITION is non-nil, stop evaluating the body."
+  :repeatable t)
+
 (setup-define :when-loaded
   (lambda (&rest body) `(progn ,@body))
   :signature '(&body BODY)

Reply via email to