emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup 2624076 07/17: Add general conditional macro :if


From: Stefan Monnier
Subject: [elpa] externals/setup 2624076 07/17: Add general conditional macro :if
Date: Sat, 13 Mar 2021 18:15:12 -0500 (EST)

branch: externals/setup
commit 262407694bb91b7ec4bae9582d7a38e782ed887c
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@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

[Prev in Thread] Current Thread [Next in Thread]