[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0b79445 3/3: Support filename matches in etags xref
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master 0b79445 3/3: Support filename matches in etags xref backend |
Date: |
Tue, 30 Jul 2019 10:00:09 -0400 (EDT) |
branch: master
commit 0b79445f55274f7c0c4f9d4d63931321a4c82a97
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
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 7bf5753..a052ad2 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)