From 6e61f9ec8a2c14699499f597edc6fdc7f4b1f0bd Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 17 May 2022 19:45:20 +0200 Subject: [PATCH] Fix pp-emacs-lisp-code printing of cons cells * lisp/emacs-lisp/pp.el (pp--insert-lisp): Fix printing of cons cells (bug#55478). --- lisp/emacs-lisp/pp.el | 2 +- test/lisp/emacs-lisp/pp-resources/code-formats.erts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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") +=-=-= -- 2.39.2