Function: etags--xref-item-matches
etags--xref-item-matches is a byte-compiled function defined in
etags.el.gz.
Signature
(etags--xref-item-matches TAG-TEXT FILENAME KIND)
Documentation
Predicate that returns non-nil if TAG-TEXT for FILENAME matches KIND.
TAG-TEXT is the text of the tag's line in its tags table, usually the
beginning of the source line where the tag was defined or referenced.
FILENAME is the basename of the source file where the tag is defined;
it can be used to deduce the programming language of the tag and other
traits of the tag, like its case-sensitivity.
KIND is a symbol that specifies the type (function, variable, etc.)
against which to test the type of the tag; see xref-backend-xref-kinds.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/etags.el.gz
(defun etags--xref-item-matches (tag-text filename kind)
"Predicate that returns non-nil if TAG-TEXT for FILENAME matches KIND.
TAG-TEXT is the text of the tag's line in its tags table, usually the
beginning of the source line where the tag was defined or referenced.
FILENAME is the basename of the source file where the tag is defined;
it can be used to deduce the programming language of the tag and other
traits of the tag, like its case-sensitivity.
KIND is a symbol that specifies the type (function, variable, etc.)
against which to test the type of the tag; see `xref-backend-xref-kinds'."
(let* ((type-regexps (cdr (assq kind etags--types-regexp-alist)))
(must-match (car type-regexps))
(must-not-match (nth 1 type-regexps)))
(when type-regexps
(let ((case-fold-search (etags--keywords-case-insensitive-p filename)))
(and (or (null must-match)
(string-match-p must-match tag-text))
(or (null must-not-match)
(not (string-match-p must-not-match tag-text))))))))