emacs-diffs
[Top][All Lists]
Advanced

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

master 33a52cb: Give 'when-let' and 'when-let*' their own Edebug specifi


From: Philipp Stephani
Subject: master 33a52cb: Give 'when-let' and 'when-let*' their own Edebug specification.
Date: Sat, 22 May 2021 07:31:43 -0400 (EDT)

branch: master
commit 33a52cb45832d4041b6f0db78ee289ba9aca0f64
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Give 'when-let' and 'when-let*' their own Edebug specification.
    
    The Edebug specification of 'if-let' and 'if-let*' doesn't work if the
    body is empty.  While that's a pathological case, it's not wrong per
    se, and could arguably happen due to macro expansion.
    
    * lisp/emacs-lisp/subr-x.el (when-let*, when-let): Don't reuse Edebug
    specification from 'if-let*' and 'if-let'.
---
 lisp/emacs-lisp/subr-x.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index fb89050..72406df 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -139,7 +139,9 @@ This is like `if-let' but doesn't handle a VARLIST of the 
form
   "Bind variables according to VARLIST and conditionally evaluate BODY.
 This is like `when-let' but doesn't handle a VARLIST of the form
 \(SYMBOL SOMETHING) specially."
-  (declare (indent 1) (debug if-let*))
+  (declare (indent 1)
+           (debug ((&rest [&or symbolp (symbolp form) (form)])
+                   body)))
   (list 'if-let* varlist (macroexp-progn body)))
 
 (defmacro and-let* (varlist &rest body)
@@ -190,7 +192,10 @@ Evaluate each binding in turn, stopping if a binding value 
is nil.
 If all are non-nil, return the value of the last form in BODY.
 
 The variable list SPEC is the same as in `if-let'."
-  (declare (indent 1) (debug if-let))
+  (declare (indent 1)
+           (debug ([&or (symbolp form)  ; must be first, Bug#48489
+                        (&rest [&or symbolp (symbolp form) (form)])]
+                   body)))
   (list 'if-let spec (macroexp-progn body)))
 
 (defsubst hash-table-empty-p (hash-table)



reply via email to

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