From: Dmitry Gutov Date: Tue, 30 Jul 2019 13:59:32 +0000 (+0300) Subject: Support filename matches in etags xref backend X-Git-Tag: emacs-27.0.90~1817^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0b79445f55274f7c0c4f9d4d63931321a4c82a97;p=emacs.git Support filename matches in etags xref backend * lisp/progmodes/etags.el (etags--xref-find-definitions): Support filename matches (bug#32510). --- 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)