aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2019-12-30 09:04:04 -0800
committerGlenn Morris2019-12-30 09:04:04 -0800
commita263ddea388ea40f59867f59b1ed6b522a78d54c (patch)
tree8ca365a3a4b1d919d4011fae929b8b818612e61c
parente1fd6b1107179270b6daeab52053ffb2461531a9 (diff)
parent8224ed7d406e8654a163b05c0c647a5d44c090ed (diff)
downloademacs-a263ddea388ea40f59867f59b1ed6b522a78d54c.tar.gz
emacs-a263ddea388ea40f59867f59b1ed6b522a78d54c.zip
Merge from origin/emacs-27
8224ed7d40 (xref--find-buffer-visiting): Speed up by using get-file-b...
-rw-r--r--lisp/progmodes/xref.el6
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index bbd3940be4f..12f32b1cdf6 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1293,9 +1293,7 @@ Such as the current syntax table and the applied syntax properties."
1293 (pcase-let* ((`(,line ,file ,text) hit) 1293 (pcase-let* ((`(,line ,file ,text) hit)
1294 (remote-id (file-remote-p default-directory)) 1294 (remote-id (file-remote-p default-directory))
1295 (file (and file (concat remote-id file))) 1295 (file (and file (concat remote-id file)))
1296 (buf (unless remote-id 1296 (buf (xref--find-buffer-visiting file))
1297 ;; find-buffer-visiting is slow on remote.
1298 (xref--find-buffer-visiting file)))
1299 (syntax-needed (xref--regexp-syntax-dependent-p regexp))) 1297 (syntax-needed (xref--regexp-syntax-dependent-p regexp)))
1300 (if buf 1298 (if buf
1301 (with-current-buffer buf 1299 (with-current-buffer buf
@@ -1354,7 +1352,7 @@ Such as the current syntax table and the applied syntax properties."
1354(defun xref--find-buffer-visiting (file) 1352(defun xref--find-buffer-visiting (file)
1355 (unless (equal (car xref--last-visiting-buffer) file) 1353 (unless (equal (car xref--last-visiting-buffer) file)
1356 (setq xref--last-visiting-buffer 1354 (setq xref--last-visiting-buffer
1357 (cons file (find-buffer-visiting file)))) 1355 (cons file (get-file-buffer file))))
1358 (cdr xref--last-visiting-buffer)) 1356 (cdr xref--last-visiting-buffer))
1359 1357
1360(provide 'xref) 1358(provide 'xref)