branch: externals/gtags-mode
commit 04c2d9fbafbce3649b3fefca5b40bea304b9cf32
Author: Jimmy Aguilar Mena <kratsbinov...@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinov...@gmail.com>

    Use file-truename
    
    project-files: Use file-truename
    project-buffers : New function.
---
 global-xref.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index fcd16232c6..71f54376ab 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -293,16 +293,21 @@ any additional command line arguments to pass to GNU 
Global."
 
 (cl-defmethod project-files ((project (head global-xref)) &optional dirs)
   "Root for PROJECT."
-  (let* ((root (cadr project))
+  (let* ((root (project-root project))
         (remote (file-remote-p root)))
     (mapcan (lambda (dir)
-             (when (string-prefix-p root dir)
+             (when-let* ((tdir (file-truename dir))
+                         ((string-prefix-p root tdir)))
                (global-xref--filter-find-symbol
-                '("--path") (string-remove-prefix root dir)
+                '("--path") (string-remove-prefix root tdir)
                 (lambda (_name _code file _line)
                   (concat remote file)))))
            (or dirs (list root)))))
 
+(cl-defmethod project-buffers ((project (head global-xref)))
+  "Return the list of all live buffers that belong to PROJECT."
+  (global-xref--buffers-in-root (project-root project)))
+
 ;;;###autoload
 (define-minor-mode global-xref-mode
   "Use GNU Global as backend for several Emacs features in this buffer."

Reply via email to