aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/xref.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 13a1600594f..bbd3940be4f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1291,8 +1291,11 @@ Such as the current syntax table and the applied syntax properties."
1291 1291
1292(defun xref--collect-matches (hit regexp tmp-buffer) 1292(defun xref--collect-matches (hit regexp tmp-buffer)
1293 (pcase-let* ((`(,line ,file ,text) hit) 1293 (pcase-let* ((`(,line ,file ,text) hit)
1294 (file (and file (concat (file-remote-p default-directory) file))) 1294 (remote-id (file-remote-p default-directory))
1295 (buf (xref--find-buffer-visiting file)) 1295 (file (and file (concat remote-id file)))
1296 (buf (unless remote-id
1297 ;; find-buffer-visiting is slow on remote.
1298 (xref--find-buffer-visiting file)))
1296 (syntax-needed (xref--regexp-syntax-dependent-p regexp))) 1299 (syntax-needed (xref--regexp-syntax-dependent-p regexp)))
1297 (if buf 1300 (if buf
1298 (with-current-buffer buf 1301 (with-current-buffer buf