branch: externals/setup commit 046c75cdef0becf1da89b8bbaebadabf5f7b1f03 Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Add :and macro --- setup.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.el b/setup.el index 6adb13f00c..88216bd898 100644 --- a/setup.el +++ b/setup.el @@ -629,6 +629,22 @@ yourself." :after-loaded t :indent 0) +(setup-define :and + (lambda (&rest conds) + `(if (and ,@(butlast conds)) + ,@(last 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." + :shorthand + (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)))))) + :debug '(setup)) + ;;; Obsoleted code