emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 b46c75b: xref-matches-in-files: Big Tramp speed-up


From: Dmitry Gutov
Subject: emacs-27 b46c75b: xref-matches-in-files: Big Tramp speed-up
Date: Tue, 7 Jan 2020 08:36:28 -0500 (EST)

branch: emacs-27
commit b46c75b16cb870584c0e00eb81c85715c5421d20
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    xref-matches-in-files: Big Tramp speed-up
    
    * lisp/progmodes/xref.el (xref-matches-in-files):
    Greatly improve performance with remote files using Tramp
    (bug#34343).
---
 lisp/progmodes/xref.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index a8ca6f8..4fbcd08 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1218,6 +1218,9 @@ IGNORES is a list of glob patterns for files to ignore."
   #'xref-matches-in-directory
   "27.1")
 
+(declare-function tramp-tramp-file-p "tramp")
+(declare-function tramp-file-local-name "tramp")
+
 ;;;###autoload
 (defun xref-matches-in-files (regexp files)
   "Find all matches for REGEXP in FILES.
@@ -1240,7 +1243,12 @@ FILES must be a list of absolute file names."
                           "")
                         (shell-quote-argument (xref--regexp-to-extended 
regexp)))))
     (when remote-id
-      (setq files (mapcar #'file-local-name files)))
+      (require 'tramp)
+      (setq files (mapcar
+                   (if (tramp-tramp-file-p dir)
+                       #'tramp-file-local-name
+                       #'file-local-name)
+                   files)))
     (with-current-buffer output
       (erase-buffer)
       (with-temp-buffer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]