* lisp/progmodes/xref.el (xref-matches-in-files):
Greatly improve performance with remote files using Tramp
(bug#34343).
#'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.
"")
(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