GNU bug report logs - #55478
29.0.50; pp-emacs-lisp-code prints '("a") as (a)

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Tue, 17 May 2022 10:14:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Visuwesh <visuweshm <at> gmail.com>
To: 55478 <at> debbugs.gnu.org
Subject: bug#55478: 29.0.50; pp-emacs-lisp-code prints '("a") as (a)
Date: Tue, 17 May 2022 15:48:31 +0530
[செவ்வாய் மே 17, 2022] Visuwesh wrote:

I hit send too early.  

> Sorry for the awful subject line.  To reproduce,
>
>         1. emacs -Q
>         2. (pp-emacs-lisp-code '("a"))
>         3. C-x C-e
>
> instead of (pp-emacs-lisp-code '("a")) you can also try
> (pp-emacs-lisp-code '("a" . "b")).  However, if the argument is '("a"
> "b"), then there are no such problems.
>
> A quick through edebug shows that this is due to the usage of `princ'.
    ^^^^^^^^^^^^^^^^^^^^^^

A quick edebug through pp--insert-lisp shows that it is due to use of
`princ' in this condition,

      (cons (cond
               ((consp (cdr sexp))
                (if (and (length= sexp 2)
                         (memq (car sexp) '(quote function)))
                    (cond
                     ((symbolp (cadr sexp))
                      (let ((print-quoted t))
                        (prin1 sexp (current-buffer))))
                     ((consp (cadr sexp))
                      (insert (if (eq (car sexp) 'quote)
                                  "'" "#'"))
                      (pp--format-list (cadr sexp)
                                       (set-marker (make-marker) (1- (point))))))
                  (pp--format-list sexp)))
               (t
                (princ sexp (current-buffer)))))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^




This bug report was last modified 3 years and 56 days ago.

Previous Next


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