Function: hierarchy-print

hierarchy-print is a byte-compiled function defined in hierarchy.el.gz.

Signature

(hierarchy-print HIERARCHY &optional TO-STRING)

Documentation

Insert HIERARCHY in current buffer as plain text.

Use TO-STRING to convert each element to a string. TO-STRING is a function taking an item of HIERARCHY as input and returning a string. If nil, TO-STRING defaults to a call to format with "%s".

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/hierarchy.el.gz
(defun hierarchy-print (hierarchy &optional to-string)
  "Insert HIERARCHY in current buffer as plain text.

Use TO-STRING to convert each element to a string.  TO-STRING is
a function taking an item of HIERARCHY as input and returning a
string.  If nil, TO-STRING defaults to a call to `format' with \"%s\"."
  (let ((to-string (or to-string (lambda (item) (format "%s" item)))))
    (hierarchy-map
     (hierarchy-labelfn-indent (lambda (item _)
                                 (insert (funcall to-string item) "\n")))
     hierarchy)))