Subject: Re: bug#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function

From: Stefan Monnier <[email-masked]>
Date: Thu, 28 Dec 2023 02:20:16 -0500

I can definitely agree: `pp` using the default `pp-default-function`
(i.e. `pp-fill`) is *not* a good idea if you have changed
`lisp-indent-function` (unless you changed it to a faster function, of
course).  We may be able to fix this O(N²) behavior, but the underlying
principle stands: it's much too easy to fall into another O(N²) behavior.

> This also causes eglot (in its default configuration) to hang when
> opening large Rust files, since rust-analyzer tends to send large amounts of
> inlay hints, and eglot logs the messages it receives as pretty-printed
> Lisp objects.

And Eglot should probably use a faster pretty printer than the default
`pp` for that.  Maybe we should make `lisp-data-mode` set
`pp-default-function` or `lisp-indent-function` to avoid such problems?

        Stefan