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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 13 Jun 2023 13:55:14 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 12 Jun 2023 16:21:50 -0400
> 
> > We document "pp" in "Output Functions".  Maybe there?
> 
> Haven't looked at that yet: I'm still trying to figure out how the
> functionality should be exposed.

Well, just don't forget that when you eventually install ;-)

> +(defcustom pp-default-function #'pp-fill
> +  ;; FIXME: The best pretty printer to use depends on the use-case
> +  ;; so maybe we should allow callers to specify what they want (maybe with
> +  ;; options like `fast', `compact', `code', `data', ...) and these
> +  ;; can then be mapped to actual pretty-printing algorithms.
> +  ;; Then again, callers can just directly call the corresponding function.
> +  "Function that `pp' should dispatch to for pretty printing.
> +That function can be called in one of two ways:
> +- with a single argument, which it should insert and pretty-print at point.
> +- with two arguments which delimit a region containing Lisp sexps
> +  which should be pretty-printed.
> +In both cases, the function can presume that the buffer is setup for
> +Lisp syntax."

Perhaps say in the doc string something about when each algorithm is
slower/faster?

Otherwise LGTM, thanks.