unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: No Wayman <iarchivedmywholelife@gmail.com>
Cc: 69168@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	[thread overview]
Message-ID: <87v86dt9xl.fsf@web.de> (raw)
In-Reply-To: <87mss1nono.fsf@web.de> (Michael Heerdegen's message of "Fri, 16 Feb 2024 03:11:55 +0100")

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Michael Heerdegen <michael_heerdegen@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-pp-emacs-lisp-code-printing-of-symbols.patch --]
[-- Type: text/x-diff, Size: 820 bytes --]

From f493708a456608f59b29c3f2308ecc51177667ec Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@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


[-- Attachment #3: Type: text/plain, Size: 11 bytes --]



Michael.

  reply	other threads:[~2024-02-25  5:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 19:19 bug#69168: [BUG] 30.0.50; pp-emacs-lisp-code produces invalid elisp for backquoted forms No Wayman
2024-02-16  2:11 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-25  5:00   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-25  6:39     ` Eli Zaretskii
2024-02-25  8:02       ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-29  2:30         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09  8:49           ` Eli Zaretskii
2024-03-09 15:34             ` Drew Adams
2024-03-11  4:48             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-25 15:08       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v86dt9xl.fsf@web.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69168@debbugs.gnu.org \
    --cc=iarchivedmywholelife@gmail.com \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).