GNU bug report logs - #69168
[BUG] 30.0.50; pp-emacs-lisp-code produces invalid elisp for backquoted forms

Previous Next

Package: emacs;

Reported by: No Wayman <iarchivedmywholelife <at> gmail.com>

Date: Thu, 15 Feb 2024 19:19:01 UTC

Severity: normal

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: No Wayman <iarchivedmywholelife <at> gmail.com>
Cc: 69168 <at> debbugs.gnu.org
Subject: bug#69168: [BUG] 30.0.50; pp-emacs-lisp-code produces invalid elisp for backquoted forms
Date: Sun, 25 Feb 2024 06:00:38 +0100
[Message part 1 (text/plain, inline)]
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> The second problem is that the recursive calls of `pp--insert-lisp'
> print symbols using `princ' (i.e., without quoting), so even the list
> representation is wrong.

I think we should print any symbol using `prin1', not `princ' - printing
symbols that need quoting without quoting is not useful:

[0001-Fix-pp-emacs-lisp-code-printing-of-symbols.patch (text/x-diff, inline)]
From f493708a456608f59b29c3f2308ecc51177667ec Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Sun, 18 Feb 2024 02:48:15 +0100
Subject: [PATCH] Fix pp-emacs-lisp-code printing of symbols

* lisp/emacs-lisp/pp.el (pp--insert-lisp): Print symbols
readably (bug#69168).
---
 lisp/emacs-lisp/pp.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 1d722051406..944dd750839 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -458,6 +458,8 @@ pp--insert-lisp
     (string
      (let ((print-escape-newlines t))
        (prin1 sexp (current-buffer))))
+    (symbol
+     (prin1 sexp (current-buffer)))
     (otherwise (princ sexp (current-buffer)))))

 (defun pp--format-vector (sexp)
--
2.39.2

[Message part 3 (text/plain, inline)]

Michael.

This bug report was last modified 1 year and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.