]> git.eshelyaron.com Git - emacs.git/commitdiff
Further tweak pp code printing
authorMichael Heerdegen <michael_heerdegen@web.de>
Sun, 12 May 2024 17:55:30 +0000 (19:55 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 27 May 2024 20:26:39 +0000 (22:26 +0200)
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)

lisp/emacs-lisp/pp.el

index 151791e842687345b6b00b2637b1488c3b44c7f5..0ac74977d0b08d5754c75fa4edfb41afd5880545 100644 (file)
@@ -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 "[")