[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup f6c54f1fbf: Fix :and implementation
From: |
ELPA Syncer |
Subject: |
[elpa] externals/setup f6c54f1fbf: Fix :and implementation |
Date: |
Sat, 3 Sep 2022 08:57:55 -0400 (EDT) |
branch: externals/setup
commit f6c54f1fbf6bb6deca9eb9ff613c277b2e291ee7
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Fix :and implementation
The body was more complicated than is necessary, and the shorthand did
not behave the way one would intuitively have assumed.
---
setup.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/setup.el b/setup.el
index 695e991e5d..2a9a4c84ba 100644
--- a/setup.el
+++ b/setup.el
@@ -664,9 +664,7 @@ yourself."
(setup-define :and
(lambda (&rest conds)
- `(if (and ,@(butlast conds))
- ,@(last conds)
- ,(setup-quit)))
+ `(or (and ,@conds) ,(setup-quit)))
:documentation "Abort evaluation of CONDS are not all true.
The expression of the last condition is used to deduce the
feature context."
@@ -674,8 +672,12 @@ feature context."
(lambda (head)
(unless (cdr head)
(error ":and requires at least one condition"))
- (let ((shorthand (get (caar (last head)) 'setup-shorthand)))
- (and shorthand (funcall shorthand (car (last head))))))
+ (let ((tail (car (last head))))
+ (cond
+ ((symbolp tail) tail)
+ ((consp tail)
+ (let ((shorthand (get (car tail) 'setup-shorthand)))
+ (and shorthand (funcall shorthand tail)))))))
:debug '(setup))
(provide 'setup)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/setup f6c54f1fbf: Fix :and implementation,
ELPA Syncer <=