Function: combobulate-get-parent-nodes

combobulate-get-parent-nodes is a natively compiled function defined in combobulate-navigation.el.

Signature

(combobulate-get-parent-nodes POINT-NODE POSSIBLE-PARENTS)

Documentation

Find POSSIBLE-PARENTS on or near POINT-NODE.

POSSIBLE-PARENTS must be a list of strings or forms. If a form, it must be a valid combobulate query that contains one or more
@parent labels.

Returns a list of parents ordered closest to farthest.

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-navigation.el
(defun combobulate-get-parent-nodes (point-node possible-parents)
  "Find POSSIBLE-PARENTS on or near POINT-NODE.

POSSIBLE-PARENTS must be a list of strings or forms. If a form,
it must be a valid combobulate query that contains one or more
`@parent' labels.

Returns a list of parents ordered closest to farthest."
  (let* ((actual-parents (combobulate-get-parents point-node))
         (matched-parents))
    (reverse (seq-uniq
              (seq-sort #'combobulate-node-after-node-p
                        (dolist (possible-parent possible-parents matched-parents)
                          (cond
                           ((stringp possible-parent)
                            (when-let (m (seq-find (lambda (p) (equal (combobulate-node-type p) possible-parent))
                                                   actual-parents))
                              (push m matched-parents)))
                           ((consp possible-parent)
                            (dolist (actual-parent actual-parents)
                              (pcase-dolist (`(,label . ,match) (combobulate-query-search actual-parent possible-parent t))
                                (when (eq label '@parent)
                                  (push match matched-parents))))))))))))