]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/etags.el
Buttonize the whole line, including the number at the beginning
[gnu-emacs] / lisp / progmodes / etags.el
index 9a57d8ad88601b47bf3fe65077fc93193a9cc4ac..6acafdbaba0bb88c38ca1acfcb4259ef18936f76 100644 (file)
@@ -2082,10 +2082,15 @@ for \\[find-tag] (which see)."
 (defun etags-xref-find (action id)
   (pcase action
     (`definitions (etags--xref-find-definitions id))
-    (`references (mapcan
-                  (lambda (file)
-                    (xref-collect-references id (file-name-directory file)))
-                  tags-table-list))
+    (`references
+     (let ((dirs (if tags-table-list
+                     (mapcar #'file-name-directory tags-table-list)
+                   ;; If no tags files are loaded, prompt for the dir.
+                   (list (read-directory-name "In directory: " nil nil t)))))
+       (cl-mapcan
+        (lambda (dir)
+          (xref-collect-references id dir))
+        dirs)))
     (`apropos (etags--xref-find-definitions id t))))
 
 (defun etags--xref-find-definitions (pattern &optional regexp?)
@@ -2138,6 +2143,10 @@ for \\[find-tag] (which see)."
         (etags-goto-tag-location tag-info)
         (point-marker)))))
 
+(cl-defmethod xref-location-line ((l xref-etags-location))
+  (with-slots (tag-info) l
+    (nth 1 tag-info)))
+
 \f
 (provide 'etags)