]> git.eshelyaron.com Git - emacs.git/commitdiff
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)
committerEshel Yaron <me@eshelyaron.com>
Mon, 27 May 2024 20:27:37 +0000 (22:27 +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.

(cherry picked from commit 3580dc155c3c9f48fb1b7855b4d858eec3948dfb)

lisp/emacs-lisp/pp.el

index 0ac74977d0b08d5754c75fa4edfb41afd5880545..0b4a6187e1dfa9b0a348058c72db739d060a06e6 100644 (file)
@@ -578,7 +578,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 "()")