1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Further tweak pp code printing

This fixes an aspect of Bug#70868.

* lisp/emacs-lisp/pp.el (pp--insert-lisp): Print characters with
`prin1-char'.  In all other cases consistently print with `prin1'.
This commit is contained in:
Michael Heerdegen 2024-05-12 19:55:30 +02:00
parent 3ea451042a
commit 34fc71c004

View file

@ -495,15 +495,12 @@ the bounds of a region containing Lisp code to pretty-print."
;; Print some of the smaller integers as characters, perhaps?
(integer
(if (<= ?0 sexp ?z)
(let ((print-integers-as-characters t))
(princ sexp (current-buffer)))
(princ sexp (current-buffer))))
(princ (prin1-char sexp) (current-buffer))
(prin1 sexp (current-buffer))))
(string
(let ((print-escape-newlines t))
(prin1 sexp (current-buffer))))
(symbol
(prin1 sexp (current-buffer)))
(otherwise (princ sexp (current-buffer)))))
(otherwise (prin1 sexp (current-buffer)))))
(defun pp--format-vector (sexp)
(insert "[")