emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 700f74e: Fix Edebug specs for if-let* and and-let


From: Gemini Lasswell
Subject: [Emacs-diffs] emacs-26 700f74e: Fix Edebug specs for if-let* and and-let* (Bug#29236)
Date: Sun, 26 Nov 2017 20:41:18 -0500 (EST)

branch: emacs-26
commit 700f74e4c8d1b33cdf96dab9586dc41ebccaba7d
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>

    Fix Edebug specs for if-let* and and-let* (Bug#29236)
    
    * test/lisp/emacs-lisp/subr-x.el (if-let*, if-let): Change Edebug
    spec to cause Edebug to instrument tests the results of which are
    not bound to symbols (the (VALUEFORM) case).
    (and-let*): Change Edebug spec to allow empty body.
    
    *test/lisp/emacs-lisp/subr-x-tests.el:
    (subr-x-and-let*-test-group-1): Add missing quote to erroneous
    form so Edebug will work on this test.
---
 lisp/emacs-lisp/subr-x.el            | 8 +++++---
 test/lisp/emacs-lisp/subr-x-tests.el | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 9ff742c..37bcfc2 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
 nil; i.e. SYMBOL can be omitted if only the test result is of
 interest."
   (declare (indent 2)
-           (debug ((&rest [&or symbolp (symbolp form) (sexp)])
+           (debug ((&rest [&or symbolp (symbolp form) (form)])
                    form body)))
   (if varlist
       `(let* ,(setq varlist (internal--build-bindings varlist))
@@ -156,7 +156,9 @@ VARLIST is the same as in `if-let*'."
   "Bind variables according to VARLIST and conditionally eval BODY.
 Like `when-let*', except if BODY is empty and all the bindings
 are non-nil, then the result is non-nil."
-  (declare (indent 1) (debug when-let*))
+  (declare (indent 1)
+           (debug ((&rest [&or symbolp (symbolp form) (form)])
+                   body)))
   (let (res)
     (if varlist
         `(let* ,(setq varlist (internal--build-bindings varlist))
@@ -168,7 +170,7 @@ are non-nil, then the result is non-nil."
   "Bind variables according to SPEC and eval THEN or ELSE.
 Like `if-let*' except SPEC can have the form (SYMBOL VALUEFORM)."
   (declare (indent 2)
-           (debug ([&or (&rest [&or symbolp (symbolp form) (sexp)])
+           (debug ([&or (&rest [&or symbolp (symbolp form) (form)])
                         (symbolp form)]
                    form body))
            (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 0e8871d..0187f39 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -403,7 +403,7 @@
    (should-error (eval '(and-let* (nil (x 1))) lexical-binding)
                  :type 'setting-constant)
    (should (equal nil (and-let* ((nil) (x 1)))))
-   (should-error (eval (and-let* (2 (x 1))) lexical-binding)
+   (should-error (eval '(and-let* (2 (x 1))) lexical-binding)
                  :type 'wrong-type-argument)
    (should (equal 1 (and-let* ((2) (x 1)))))
    (should (equal 2 (and-let* ((x 1) (2)))))



reply via email to

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