Subject: Re: bug#18012: 24.3; Can't print a huge list structure in IELM

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 04 Sep 2021 10:40:57 +0200

[email-masked] ([email-masked]) writes:

> I have a function that creates a nested list in the form (x (x (x (x
> (...))))) arbitrarily deep:
>
> (defun nestify (xs)
>   (cl-reduce (lambda (x y) (if y (list x y) (list x))) xs :from-end t
>   :initial-value nil))
>
> In IELM when I try to call it on a sufficiently big list, it crashes
> with an error:
>
> ELISP> (nestify (number-sequence 1 1000))
> *** IELM Error ***  Error during pretty-printing (bug in pp)
>
> Googling the above error, including on Debbugs.gnu.org and site-only
> search on gnu.org haven't revealed anything. zrgrep-ing showed the
> string "Error during pretty-printing" is in function `ielm-eval-input`
> in file `ielm.el`. Thus, I report this bug.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

This has changed a bit since this was reported.  It now says:

ELISP> (nestify (number-sequence 1 1000))
*** IELM Error ***  Error during pretty-printing (bug in pp): (scan-error "Unbalanced parentheses" 1 385)

and a message in the echo area saying

cl-prin1: (error "Lisp nesting exceeds ‘max-lisp-eval-depth’") [6 times]

I've now removed the confusing (and misleading) "(bug in pp)" from the
error message, and but the rest seems pretty much correct (when dealing
with things that Emacs can't print because of issues like this), so I'm
closing this bug report.

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