Don't try to pretty-print non-lists as binding list
authorMichael Heerdegen <michael_heerdegen@web.de>
Sun, 12 May 2024 17:58:14 +0000 (19:58 +0200)
committerMichael Heerdegen <michael_heerdegen@web.de>
Mon, 27 May 2024 16:44:48 +0000 (18:44 +0200)
* lisp/emacs-lisp/pp.el (pp--format-definition): Ensure that what we try
to print as a list of bindings has an appropriate format.  This avoids
raising an error for SEXPs like (let X Y) inside `pcase' forms where our
heuristic expects a binding list in the X position.

lisp/emacs-lisp/pp.el

index d578e685ca9acd90b45b6eabc6d1542cff827054..3176ee42533dd0317a6df1634c72136c3a89223e 100644 (file)
@@ -577,7 +577,8 @@ the bounds of a region containing Lisp code to pretty-print."
     (unless (consp edebug)
       (setq edebug nil))
     (if (and (consp (car edebug))
-             (eq (caar edebug) '&rest))
+             (eq (caar edebug) '&rest)
+             (proper-list-p (car sexp)))
         (pp--insert-binding (pop sexp))
       (if (null (car sexp))
           (insert "()")