Subject: bug#63861: [PATCH] pp.el: New "pretty printing" code

From: Stefan Monnier <[email-masked]>
Date: Wed, 07 Jun 2023 11:21:23 -0400

>> FWIW, the change affects other functionality that uses `pp`, such as
>> `C-h v`.  While working on (previous versions of) this code, I've had
>> performance problems show up during the generation of `emoji-labels.el`.
>
> When tried on emoji-labels.el, at the end it failed with
>
>   (scan-error "Containing expression ends prematurely" 255866 255867)

Hmm... when I do

    rm lisp/international/emoji-labels.el
    make

the file is rebuilt correctly.
Could you give more details about how you got the above?

>>> Also, I think this warrants a NEWS entry and should be documented in
>>> the ELisp manual.
>> Definitely for NEWS, yes.  For the ELisp manual, currently we don't
>> document `pp-buffer`, the closest I see is `indent-pp-sexp` (in
>> `programs.texi`).
> For indent-pp-sexp with a prefix arg used on defuns, the new version
> is much better - it makes code more readable.  It has only one snag:
> it inserts an empty line between the defun line and the docstring.

Oh, indeed, I'm not careful to check before I insert the `\n` in
this case (I always use it on code that starts as a single line).
I'll fix it in the next round, thanks.

        Stefan