From 0b79445f55274f7c0c4f9d4d63931321a4c82a97 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 30 Jul 2019 16:59:32 +0300 Subject: [PATCH] Support filename matches in etags xref backend * lisp/progmodes/etags.el (etags--xref-find-definitions): Support filename matches (bug#32510). --- lisp/progmodes/etags.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 7bf575340ec..a052ad2ce56 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -2070,14 +2070,15 @@ for \\[find-tag] (which see)." (beginning-of-line) (pcase-let* ((tag-info (etags-snarf-tag)) (`(,hint ,line . _) tag-info)) - (unless (eq hint t) ; hint==t if we are in a filename line - (let* ((file (file-of-tag)) - (mark-key (cons file line))) - (unless (gethash mark-key marks) - (let ((loc (xref-make-etags-location - tag-info (expand-file-name file)))) - (push (xref-make hint loc) xrefs) - (puthash mark-key t marks))))))))))) + (let* ((file (file-of-tag)) + (mark-key (cons file line))) + (unless (gethash mark-key marks) + (let ((loc (xref-make-etags-location + tag-info (expand-file-name file)))) + (push (xref-make (if (eq hint t) "(filename match)" hint) + loc) + xrefs) + (puthash mark-key t marks)))))))))) (nreverse xrefs))) (defclass xref-etags-location (xref-location) -- 2.39.2