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

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

bug#70868: 30.0.50; pp--insert-lisp prints small integers as characters


From: Michael Heerdegen
Subject: bug#70868: 30.0.50; pp--insert-lisp prints small integers as characters
Date: Tue, 28 May 2024 12:51:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hello again,

I have committed our fix now and close this bug report since we are
done.  Thanks to everybody.


While I was at it I found a branch in the algorithm where we printed an
arbitrary non-list cons using `prin1' for no reason.  Since we have
everything in pp to pretty-print any list and cons, I fixed that:

From 804f36d5abdbc38a4664a341aaea563195f79b03 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Sun, 26 May 2024 16:31:26 +0200
Subject: [PATCH] Don't let pp fall back to prin1 for conses

* lisp/emacs-lisp/pp.el (pp--insert-lisp): Don't `prin1' non-list
conses; use our pp function for cons and list printing
`pp--format-list' instead.
---
 lisp/emacs-lisp/pp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 3176ee42533..e550bd4d689 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -491,7 +491,7 @@ pp--insert-lisp
                     (pp--insert-lisp (cadr sexp)))
                 (pp--format-list sexp))))
            (t
-            (prin1 sexp (current-buffer)))))
+            (pp--format-list sexp))))
     ;; Print some of the smaller integers as characters, perhaps?
     (integer
      (if (<= ?0 sexp ?z)
--
2.39.2


Michael.

reply via email to

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