Function: org-element-properties-map

org-element-properties-map is a byte-compiled function defined in org-element-ast.el.gz.

Signature

(org-element-properties-map FUN NODE &optional UNDEFER)

Documentation

Apply FUN for each property of NODE and return a list of the results.

FUN will be called with three arguments: property name, property value, and node. If FUN accepts only 2 arguments, it will be called with two arguments: property name and property value. If FUN accepts only a single argument, it will be called with a single argument - property value.

When UNDEFER is non-nil, undefer deferred properties unconditionally. When UNDEFER is symbol force, unconditionally replace the property values with undeferred values.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-element-ast.el.gz
;; There is purposely no function like `org-element-properties' that
;; returns a list of properties.  Such function would tempt the users
;; to (1) run it, creating a whole new list; (2) filter over that list
;; - the process requiring a lot of extra consing, adding a load onto
;; Emacs GC, memory used, and slowing things up as creating new lists
;; is not free for CPU.
(defsubst org-element-properties-map (fun node &optional undefer)
  "Apply FUN for each property of NODE and return a list of the results.
FUN will be called with three arguments: property name, property
value, and node.  If FUN accepts only 2 arguments, it will be called
with two arguments: property name and property value.  If FUN accepts
only a single argument, it will be called with a single argument -
property value.

When UNDEFER is non-nil, undefer deferred properties unconditionally.
When UNDEFER is symbol `force', unconditionally replace the property
values with undeferred values."
  (when undefer
    (org-element-properties-resolve node (eq 'force undefer)))
  (org-element--properties-mapc fun node 'collect))