diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2019-07-30 16:59:32 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2019-07-30 16:59:59 +0300 |
commit | 0b79445f55274f7c0c4f9d4d63931321a4c82a97 (patch) | |
tree | 3eadd611ad0bdd1f8f15e480fbd79cf0392ed40a /lisp/progmodes/etags.el | |
parent | 4fe88791df32f083ae329a0f4415fc29b599e9c5 (diff) | |
download | emacs-0b79445f55274f7c0c4f9d4d63931321a4c82a97.tar.gz |
Support filename matches in etags xref backend
* lisp/progmodes/etags.el (etags--xref-find-definitions):
Support filename matches (bug#32510).
Diffstat (limited to 'lisp/progmodes/etags.el')
-rw-r--r-- | lisp/progmodes/etags.el | 17 |
1 files 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) |