Function: dom-search
dom-search is a byte-compiled function defined in dom.el.gz.
Signature
(dom-search DOM PREDICATE)
Documentation
Return elements in DOM where PREDICATE is non-nil.
PREDICATE is called with the node as its only parameter.
Probably introduced at or before Emacs version 27.1.
Source Code
;; Defined in /usr/src/emacs/lisp/dom.el.gz
(defun dom-search (dom predicate)
"Return elements in DOM where PREDICATE is non-nil.
PREDICATE is called with the node as its only parameter."
(let ((matches (cl-loop for child in (dom-children dom)
for matches = (and (not (stringp child))
(dom-search child predicate))
when matches
append matches)))
(if (funcall predicate dom)
(cons dom matches)
matches)))