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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55478 in the body.
You can then email your comments to 55478 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55478; Package emacs. (Tue, 17 May 2022 10:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Visuwesh <visuweshm <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 17 May 2022 10:14:02 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; pp-emacs-lisp-code prints '("a") as (a)
Date: Tue, 17 May 2022 15:42:40 +0530
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'.

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2022-05-16 built on astatine
Repository revision: f171a36c0ad7a0b5b69c3d4bad2875c54e2ccdd9
Repository branch: imenu-xref
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: NixOS 21.11 (Porcupine)

Configured using:
 'configure --with-sqlite3 --with-x-toolkit=lucid --with-json
 --without-gsettings --with-x --without-libsystemd --with-modules'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON
LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2
XPM LUCID ZLIB

Important settings:
  value of $LC_MONETARY: ta_IN.UTF-8
  value of $LC_NUMERIC: ta_IN.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr dabbrev emacsbug message mailcap yank-media rmc
puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived
epg rfc6068 epg-config gnus-util text-property-search mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
time-date edebug help-fns radix-tree seq cl-print gv subr-x byte-opt
bytecomp byte-compile cconv debug backtrace help-mode find-func pp
cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice simple cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 53277 8750)
 (symbols 48 6843 1)
 (strings 32 19698 1754)
 (string-bytes 1 610797)
 (vectors 16 12914)
 (vector-slots 8 178761 10605)
 (floats 8 26 26)
 (intervals 56 335 1)
 (buffers 992 13))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55478; Package emacs. (Tue, 17 May 2022 10:19:02 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: 55478 <at> debbugs.gnu.org
Subject: Re: 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)))))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55478; Package emacs. (Tue, 17 May 2022 17:46:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 55478 <at> debbugs.gnu.org
Subject: Re: bug#55478: 29.0.50; pp-emacs-lisp-code prints '("a") as (a)
Date: Tue, 17 May 2022 19:45:45 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

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

[...]

>                (t
>                 (princ sexp (current-buffer)))))
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks; I've now pushed a fix for this to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 55478 <at> debbugs.gnu.org and Visuwesh <visuweshm <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 17 May 2022 17:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55478; Package emacs. (Thu, 19 May 2022 23:40:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 55478 <at> debbugs.gnu.org
Subject: Re: bug#55478: 29.0.50; pp-emacs-lisp-code prints '("a") as (a)
Date: Fri, 20 May 2022 01:39:45 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

> Thanks for the quick fix.  But it begs the question: what about other
> instances of princ?  Should they be replaced with prin1 as well?

I had a very quick skim over the other instances of princ, but nothing
immediately stood out as problematic.  Did you have anything in
particular in mind?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55478; Package emacs. (Fri, 20 May 2022 04:42:01 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55478 <at> debbugs.gnu.org
Subject: Re: bug#55478: 29.0.50; pp-emacs-lisp-code prints '("a") as (a)
Date: Fri, 20 May 2022 10:11:06 +0530
[வெள்ளி மே 20, 2022] Lars Ingebrigtsen wrote:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> Thanks for the quick fix.  But it begs the question: what about other
>> instances of princ?  Should they be replaced with prin1 as well?
>
> I had a very quick skim over the other instances of princ, but nothing
> immediately stood out as problematic.  Did you have anything in
> particular in mind?

I was thinking the vector case could be problematic: I just realised why
the cookies file randomly got "corrupted" (strings were printed as
symbols).  But I'm trying it with the cookie that was problematic again,
and I don't see the problem anymore, so I don't think there's anything
to do here (I also took a quick glance).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Jun 2022 11:24:09 GMT) Full text and rfc822 format available.

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

Previous Next


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