bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70868: 30.0.50;


From: Michael Heerdegen
Subject: bug#70868: 30.0.50;
Date: Tue, 14 May 2024 20:28:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> This said, I don't see the connection with printing small numbers as
> chars.  To print chars using the ELisp syntax you need `prin1-char`:
> AFAIK neither `prin1` nor `princ` work (at all).

Did I forget to attach the patch?

From e041c3a9d295f4c9946bcb693591eb47237cc4fe Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Sun, 12 May 2024 19:55:30 +0200
Subject: [PATCH] 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'.
---
 lisp/emacs-lisp/pp.el | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 47805d3dbde..1ca206cf5db 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -495,15 +495,12 @@ pp--insert-lisp
     ;; 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 "[")
--
2.39.2


Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]