aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/subr-x.el8
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el2
2 files changed, 6 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 9ff742c4331..37bcfc2003d 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -133,7 +133,7 @@ be of the form (VALUEFORM), which is evaluated and checked for
133nil; i.e. SYMBOL can be omitted if only the test result is of 133nil; i.e. SYMBOL can be omitted if only the test result is of
134interest." 134interest."
135 (declare (indent 2) 135 (declare (indent 2)
136 (debug ((&rest [&or symbolp (symbolp form) (sexp)]) 136 (debug ((&rest [&or symbolp (symbolp form) (form)])
137 form body))) 137 form body)))
138 (if varlist 138 (if varlist
139 `(let* ,(setq varlist (internal--build-bindings varlist)) 139 `(let* ,(setq varlist (internal--build-bindings varlist))
@@ -156,7 +156,9 @@ VARLIST is the same as in `if-let*'."
156 "Bind variables according to VARLIST and conditionally eval BODY. 156 "Bind variables according to VARLIST and conditionally eval BODY.
157Like `when-let*', except if BODY is empty and all the bindings 157Like `when-let*', except if BODY is empty and all the bindings
158are non-nil, then the result is non-nil." 158are non-nil, then the result is non-nil."
159 (declare (indent 1) (debug when-let*)) 159 (declare (indent 1)
160 (debug ((&rest [&or symbolp (symbolp form) (form)])
161 body)))
160 (let (res) 162 (let (res)
161 (if varlist 163 (if varlist
162 `(let* ,(setq varlist (internal--build-bindings varlist)) 164 `(let* ,(setq varlist (internal--build-bindings varlist))
@@ -168,7 +170,7 @@ are non-nil, then the result is non-nil."
168 "Bind variables according to SPEC and eval THEN or ELSE. 170 "Bind variables according to SPEC and eval THEN or ELSE.
169Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)." 171Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)."
170 (declare (indent 2) 172 (declare (indent 2)
171 (debug ([&or (&rest [&or symbolp (symbolp form) (sexp)]) 173 (debug ([&or (&rest [&or symbolp (symbolp form) (form)])
172 (symbolp form)] 174 (symbolp form)]
173 form body)) 175 form body))
174 (obsolete "use `if-let*' instead." "26.1")) 176 (obsolete "use `if-let*' instead." "26.1"))
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 0e8871d9a9c..0187f39d15d 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -403,7 +403,7 @@
403 (should-error (eval '(and-let* (nil (x 1))) lexical-binding) 403 (should-error (eval '(and-let* (nil (x 1))) lexical-binding)
404 :type 'setting-constant) 404 :type 'setting-constant)
405 (should (equal nil (and-let* ((nil) (x 1))))) 405 (should (equal nil (and-let* ((nil) (x 1)))))
406 (should-error (eval (and-let* (2 (x 1))) lexical-binding) 406 (should-error (eval '(and-let* (2 (x 1))) lexical-binding)
407 :type 'wrong-type-argument) 407 :type 'wrong-type-argument)
408 (should (equal 1 (and-let* ((2) (x 1))))) 408 (should (equal 1 (and-let* ((2) (x 1)))))
409 (should (equal 2 (and-let* ((x 1) (2))))) 409 (should (equal 2 (and-let* ((x 1) (2)))))