Function: pp-buffer

pp-buffer is an autoloaded, interactive and byte-compiled function defined in pp.el.gz.

Signature

(pp-buffer)

Documentation

Prettify the current buffer with printed representation of a Lisp object.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/pp.el.gz
;;;###autoload
(defun pp-buffer ()
  "Prettify the current buffer with printed representation of a Lisp object."
  (interactive)
  ;; The old code used `indent-sexp' which mostly works "anywhere",
  ;; so let's make sure we also work right in buffers that aren't
  ;; setup specifically for Lisp.
  (if (and (eq (syntax-table) emacs-lisp-mode-syntax-table)
           (eq indent-line-function #'lisp-indent-line))
      (funcall pp-default-function (point-min) (point-max))
    (with-syntax-table emacs-lisp-mode-syntax-table
        (let ((indent-line-function #'lisp-indent-line))
          (funcall pp-default-function (point-min) (point-max)))))
  ;; Preserve old behavior of (usually) finishing with a newline and
  ;; with point at BOB.
  (goto-char (point-max))
  (unless (bolp) (insert "\n"))
  (goto-char (point-min)))