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

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

bug#69168: [BUG] 30.0.50; pp-emacs-lisp-code produces invalid elisp for


From: Eli Zaretskii
Subject: bug#69168: [BUG] 30.0.50; pp-emacs-lisp-code produces invalid elisp for backquoted forms
Date: Sun, 25 Feb 2024 08:39:34 +0200

> Cc: 69168@debbugs.gnu.org
> Date: Sun, 25 Feb 2024 06:00:38 +0100
> From:  Michael Heerdegen via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> 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:
> 
> 
> 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

Thanks.  Stefan, any comments?





reply via email to

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