diff options
author | Michael Heerdegen <michael_heerdegen@web.de> | 2024-05-12 19:58:14 +0200 |
---|---|---|
committer | Michael Heerdegen <michael_heerdegen@web.de> | 2024-05-27 18:44:48 +0200 |
commit | 3580dc155c3c9f48fb1b7855b4d858eec3948dfb (patch) | |
tree | 42324c858d66d2c6ca43004547059da3a4fc7f67 /lisp/emacs-lisp | |
parent | db6599818fa6ca7325c482b4aa1ce564688469ef (diff) | |
download | emacs-3580dc155c3c9f48fb1b7855b4d858eec3948dfb.tar.gz emacs-3580dc155c3c9f48fb1b7855b4d858eec3948dfb.tar.bz2 emacs-3580dc155c3c9f48fb1b7855b4d858eec3948dfb.zip |
Don't try to pretty-print non-lists as binding list
* 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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/pp.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index d578e685ca9..3176ee42533 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -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 "()") |