Function: combobulate-filter-nodes

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

Signature

(combobulate-filter-nodes NODES &key KEEP-TYPES REMOVE-TYPES (GET-FN nil))

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-navigation.el
(cl-defun combobulate-filter-nodes (nodes &key keep-types remove-types (get-fn nil))
  (when (and keep-types remove-types)
    (error "Cannot specify both `:keep-types' and `:remove-types'."))
  (if (and (not keep-types) (not remove-types))
      nodes
    (seq-filter (lambda (elem)
                  (let ((node-type (combobulate-node-type (if get-fn
                                                              (funcall get-fn elem)
                                                            elem))))
                    (if keep-types
                        (and keep-types (member node-type keep-types))
                      (if (and remove-types (member node-type remove-types))
                          nil
                        t))))
                nodes)))