(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?)
(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)