From: Lars Ingebrigtsen Date: Tue, 17 May 2022 17:45:20 +0000 (+0200) Subject: Fix pp-emacs-lisp-code printing of cons cells X-Git-Tag: emacs-29.0.90~1910^2~620 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6e61f9ec8a2c14699499f597edc6fdc7f4b1f0bd;p=emacs.git Fix pp-emacs-lisp-code printing of cons cells * lisp/emacs-lisp/pp.el (pp--insert-lisp): Fix printing of cons cells (bug#55478). --- diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index ad693fa5a61..3c849c2d01b 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -250,7 +250,7 @@ Use the `pp-max-width' variable to control the desired line length." (set-marker (make-marker) (1- (point)))))) (pp--format-list sexp))) (t - (princ sexp (current-buffer))))) + (prin1 sexp (current-buffer))))) ;; Print some of the smaller integers as characters, perhaps? (integer (if (<= ?0 sexp ?z) diff --git a/test/lisp/emacs-lisp/pp-resources/code-formats.erts b/test/lisp/emacs-lisp/pp-resources/code-formats.erts index 002a5cf1650..c3e3023cb19 100644 --- a/test/lisp/emacs-lisp/pp-resources/code-formats.erts +++ b/test/lisp/emacs-lisp/pp-resources/code-formats.erts @@ -128,3 +128,15 @@ Name: code-formats12 =-= (global-set-key (kbd "s-x") #'kill-region) =-=-= + +Name: code-formats13 + +=-= +'("a") +=-=-= + +Name: code-formats14 + +=-= +'("a" . "b") +=-=-=