Function: reporter-beautify-list

reporter-beautify-list is a byte-compiled function defined in reporter.el.gz.

Signature

(reporter-beautify-list MAXWIDTH COMPACT-P)

Documentation

Pretty print a list.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/reporter.el.gz
;; dumping/pretty printing of values
(defun reporter-beautify-list (maxwidth compact-p)
  "Pretty print a list."
  (reporter-update-status)
  (let ((move t)
	linebreak indent-enclosing-p indent-p here)
    (condition-case nil			;loop exit
	(progn
	  (down-list 1)
	  (setq indent-enclosing-p t)
	  (while move
	    (setq here (point))
	    ;; The following line is how we break out of the while
	    ;; loop, in one of two ways.  Either we've hit the end of
	    ;; the buffer, in which case scan-sexps returns nil, or
	    ;; we've crossed unbalanced parens and it will raise an
	    ;; error we're expecting to catch.
	    (setq move (scan-sexps (point) 1))
	    (goto-char move)
	    (if (<= maxwidth (current-column))
		(if linebreak
		    (progn
		      (goto-char linebreak)
		      (newline-and-indent)
		      (setq linebreak nil))
		  (goto-char here)
		  (setq indent-p (reporter-beautify-list maxwidth compact-p))
		  (goto-char here)
		  (forward-sexp 1)
		  (if indent-p
		      (newline-and-indent))
		  t)
	      (if compact-p
		  (setq linebreak (point))
		(newline-and-indent))
	      ))
	  t)
      (error indent-enclosing-p))))