all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brennan Vincent <brennan@umanwizard.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, 68072@debbugs.gnu.org
Subject: bug#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function
Date: Thu, 28 Dec 2023 10:37:09 -0500	[thread overview]
Message-ID: <8734vmwd7e.fsf@prescott.mail-host-address-is-not-set> (raw)
In-Reply-To: <jwvh6k2g5yd.fsf-monnier+emacs@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> 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.
>

Thanks for the tip and I can definitely remove the customization of
lisp-indent-function to common-lisp-indent-function. I actually don't
remember why I originally set it since I don't write common lisp... but
anyway, if we don't expect changing lisp-indent-function globally to
behave nicely with other features (like pp), perhaps
lisp-indent-function shouldn't be Customize-able , or we should at least
mention this in the documentation?

>> 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






  reply	other threads:[~2023-12-28 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  0:10 bug#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function Brennan Vincent
2023-12-28  6:23 ` Eli Zaretskii
2023-12-28  7:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-28 15:37   ` Brennan Vincent [this message]
2023-12-28 17:10   ` Stefan Kangas
2024-01-05  3:50   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-05 13:06     ` João Távora
2024-01-07  5:07       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734vmwd7e.fsf@prescott.mail-host-address-is-not-set \
    --to=brennan@umanwizard.com \
    --cc=68072@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.