Function: org-export-collect-elements

org-export-collect-elements is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-collect-elements TYPE INFO &optional PREDICATE)

Documentation

Collect referenceable elements of a determined type.

TYPE can be a symbol or a list of symbols specifying element types to search. Only elements with a caption are collected.

INFO is a plist used as a communication channel.

When non-nil, optional argument PREDICATE is a function accepting one argument, an element of type TYPE. It returns a non-nil value when that element should be collected.

Return a list of all elements found, in order of appearance.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-collect-elements (type info &optional predicate)
  "Collect referenceable elements of a determined type.

TYPE can be a symbol or a list of symbols specifying element
types to search.  Only elements with a caption are collected.

INFO is a plist used as a communication channel.

When non-nil, optional argument PREDICATE is a function accepting
one argument, an element of type TYPE.  It returns a non-nil
value when that element should be collected.

Return a list of all elements found, in order of appearance."
  (org-element-map (plist-get info :parse-tree) type
    (lambda (element)
      (and (org-element-property :caption element)
	   (or (not predicate) (funcall predicate element))
	   element))
    info))