Function: etags--kind-predicate

etags--kind-predicate is a byte-compiled function defined in etags.el.gz.

Signature

(etags--kind-predicate KIND CANDIDATE)

Documentation

A predicate that returns non-nil if CANDIDATE's type matches KIND.

CANDIDATE is a string which gives the identifier of a completion candidate; KIND is a symbol presumably taken from xref-backend-xref-kindss :kind property.

This function is supposed to be used as PREDICATE by the various completion functions and primitives.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/etags.el.gz
(defun etags--kind-predicate (kind candidate)
  "A predicate that returns non-nil if CANDIDATE's type matches KIND.
CANDIDATE is a string which gives the identifier of a completion candidate;
KIND is a symbol presumably taken from `xref-backend-xref-kinds's `:kind'
property.

This function is supposed to be used as PREDICATE by the various
completion functions and primitives."
  (let ((defs (etags--xref-find-definitions candidate))
        def found-match)
    (while (and (not found-match)
                defs)
      (setq def (car defs)
            defs (cdr defs)
            found-match (etags--xref-item-matches (xref-item-summary def)
                                                  (file-name-nondirectory
                                                   (xref-etags-location-file
                                                    (xref-item-location def)))
                                                  kind)))
    found-match))