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


Message #14 received at 69168 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: iarchivedmywholelife <at> gmail.com, 69168 <at> debbugs.gnu.org
Subject: Re: 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 <at> 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 <at> gnu.org>
> 
> 
> 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:
> 
> 
> 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

Thanks.  Stefan, any comments?




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.