Function: pp--region

pp--region is a byte-compiled function defined in pp.el.gz.

Signature

(pp--region BEG END OBJECT-FUNCTION)

Documentation

Pretty-print the object(s) contained within BEG..END.

OBJECT-FUNCTION is called with a single object as argument and should pretty print it at point into the current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/pp.el.gz
(defun pp--region (beg end object-function)
  "Pretty-print the object(s) contained within BEG..END.
OBJECT-FUNCTION is called with a single object as argument
and should pretty print it at point into the current buffer."
  (save-excursion
    (with-restriction beg end
      (goto-char (point-min))
      (while
          (progn
            ;; We'll throw away all the comments within objects, but let's
            ;; try at least to preserve the comments between objects.
            (forward-comment (point-max))
            (let ((beg (point))
                  (object (ignore-error end-of-buffer
                              (list (read (current-buffer))))))
              (when (consp object)
                (delete-region beg (point))
                (funcall object-function (car object))
                t)))))))