From: Michael Heerdegen Date: Sun, 12 May 2024 17:55:30 +0000 (+0200) Subject: Further tweak pp code printing X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=023bcfa6c703f009db2894535fc5a61fe814056f;p=emacs.git 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'. (cherry picked from commit 34fc71c004b6e0ae787de4889eca2d1e413103f2) --- diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 151791e8426..0ac74977d0b 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -496,15 +496,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 "[")