Variable: pp-default-function

pp-default-function is a customizable variable defined in pp.el.gz.

Value

pp-fill

Documentation

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.

This variable was added, or its default value changed, in Emacs 30.1.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/pp.el.gz
(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."
  :type '(choice
          (const :tag "Fit within `fill-column'" pp-fill)
          (const :tag "Emacs<29 algorithm, fast and good enough" pp-28)
          (const :tag "Work hard for code (slow on large inputs)"
                 pp-emacs-lisp-code)
          (const :tag "Work hard for code if `pp-use-max-width' non-nil, else as in Emacs<29"
                 pp-29)
          (function :tag "Custom function"))
  :version "30.1")