mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-20 04:30:55 -08:00
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).
This commit is contained in:
parent
883b3490d8
commit
b46c75b16c
1 changed files with 9 additions and 1 deletions
|
|
@ -1218,6 +1218,9 @@ IGNORES is a list of glob patterns for files to ignore."
|
||||||
#'xref-matches-in-directory
|
#'xref-matches-in-directory
|
||||||
"27.1")
|
"27.1")
|
||||||
|
|
||||||
|
(declare-function tramp-tramp-file-p "tramp")
|
||||||
|
(declare-function tramp-file-local-name "tramp")
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun xref-matches-in-files (regexp files)
|
(defun xref-matches-in-files (regexp files)
|
||||||
"Find all matches for REGEXP in 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)))))
|
(shell-quote-argument (xref--regexp-to-extended regexp)))))
|
||||||
(when remote-id
|
(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
|
(with-current-buffer output
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue