> Yes, but let's also mention BEG and END: > > Break lines in Lisp code between BEG and END so it fits within `fill-column'. Even better, thanks. >> > 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`). >> I'm not sure what to put in there. nor where to put it. > > 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. >> >> +(defcustom pp-buffer-use-pp-region nil >> >> + "If non-nil, `pp-buffer' uses the new `pp-region' code." >> >> + :type 'boolean) >> > Please add :version. >> Hmm... so you think it should stay as a `defcustom` and we should thus >> plan to keep both kinds of pretty-printing in the long term? > > No, I just said that _if_ we keep it as a defcustom, _then_ it should > have a :version tag. I have no idea how many users will want to > customize this. Since Emacs-29 already has a similar defcustom to use the `pp-emacs-lisp-code` algorithm (and since Thierry uses yet another algorithm), I guess there's enough evidence to convince me that we should have a defcustom. But I don't like the `pp-use-max-width` defcustom: its name doesn't say what it does since the fact that `pp-emacs-lisp-code` obeys `pp-max-width` is just one part of the difference with the default pp code. So I suggest "merging" that var with the new custom var that chooses which algorithm to use (I could make it an obsolete alias, but it seemed cleaner to use a new var and mark the old one obsolete). See below my new version of the patch. I renamed `pp-region` to `pp-fill`. The patch introduces a custom var `pp-default-function` which specifies which algorithm to use among: - `pp-emacs-lisp-code` (Lars' new-in-29 pretty-but-slow pretty printer). - `pp-fill` (my new pretty printer). - `pp-28` (the old pretty printer; suggestions for a better name welcome). - `pp-29` (dispatches according to `pp-use-max-width`, to either `pp-28` or `pp-emacs-lisp-code`, like we do in Emacs-29). - Thierry could plug his `tv/pp-region` in here. The patch also changes `pp` so you can call it with BEG..END and it will pretty-print that region, which makes `pp-buffer` obsolete (I have not yet updated the callers accordingly). If there's no objection, I'll adjust the doc, fix the obsolete uses of `pp-buffer`, and install. Stefan