Function: combobulate-build-sparse-tree

combobulate-build-sparse-tree is a natively compiled function defined in combobulate-navigation.el.

Signature

(combobulate-build-sparse-tree DIRECTION MATCH-NODES &optional MATCH-FN START-NODE LIMIT)

Documentation

Build a sparse tree of MATCH-NODES in DIRECTION.

Optionally use MATCH-FN instead of the builtin search (combboulate--node-after-point-p or combobulate-node-before-point-p depending on direction).

If START-NODE is set, use it in lieu of combobulate-root-node.

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-navigation.el
(defun combobulate-build-sparse-tree (direction match-nodes &optional match-fn start-node limit)
  "Build a sparse tree of MATCH-NODES in DIRECTION.

Optionally use MATCH-FN instead of the builtin
search (`combboulate--node-after-point-p' or
`combobulate-node-before-point-p' depending on direction).

If START-NODE is set, use it in lieu of `combobulate-root-node'."
  (with-navigation-nodes (:nodes match-nodes :backward (eq direction 'backward))
    (combobulate-induce-sparse-tree
     (or start-node (combobulate-root-node))
     (lambda (node)
       (and (combobulate-navigable-node-p node)
            (if match-fn
                (funcall match-fn node)
              (cond
               ((eq direction 'forward)
                (combobulate-node-after-point-p node))
               ((eq direction 'backward)
                (combobulate-node-before-point-p node))
               (t (error "Unknown direction `%s'" direction))))))
     nil
     limit)))