branch: externals/setup
commit 17a41e64d0d3f80e58d6b1e92c3cd14368a0c30d
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Fix :and when last expression is a symbol
---
setup.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/setup.el b/setup.el
index 8cd8a84545..31c46aad00 100644
--- a/setup.el
+++ b/setup.el
@@ -638,9 +638,13 @@ yourself."
(setup-define :and
(lambda (&rest conds)
- `(if (and ,@(butlast conds))
- ,@(last conds)
- ,(setup-quit)))
+ (let ((tail (car (last conds))))
+ `(if (and ,@(butlast conds))
+ ,@(cond
+ ((symbolp tail) '(nil))
+ ((consp tail) (last conds))
+ ((error "Illegal tail")))
+ ,(setup-quit))))
:documentation "Abort evaluation of CONDS are not all true.
The expression of the last condition is used to deduce the
feature context."