summaryrefslogtreecommitdiff
path: root/lisp/progmodes/xref.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2019-12-27 19:17:48 +0300
committerDmitry Gutov <dgutov@yandex.ru>2019-12-27 19:17:48 +0300
commit8224ed7d406e8654a163b05c0c647a5d44c090ed (patch)
treed5d41e349b492869416c6d51e9781e7b111941f4 /lisp/progmodes/xref.el
parent3f2788d4acd53fbb3e3b9106530169643fa8948c (diff)
downloademacs-8224ed7d406e8654a163b05c0c647a5d44c090ed.tar.gz
emacs-8224ed7d406e8654a163b05c0c647a5d44c090ed.tar.bz2
emacs-8224ed7d406e8654a163b05c0c647a5d44c090ed.zip
(xref--find-buffer-visiting): Speed up by using get-file-buffer
* lisp/progmodes/xref.el (xref--find-buffer-visiting): Speed up by using get-file-buffer. (xref--collect-matches): Remove the condition on remote-id. (https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00753.html)
Diffstat (limited to 'lisp/progmodes/xref.el')
-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."
(pcase-let* ((`(,line ,file ,text) hit)
(remote-id (file-remote-p default-directory))
(file (and file (concat remote-id file)))
- (buf (unless remote-id
- ;; find-buffer-visiting is slow on remote.
- (xref--find-buffer-visiting file)))
+ (buf (xref--find-buffer-visiting file))
(syntax-needed (xref--regexp-syntax-dependent-p regexp)))
(if buf
(with-current-buffer buf
@@ -1354,7 +1352,7 @@ Such as the current syntax table and the applied syntax properties."
(defun xref--find-buffer-visiting (file)
(unless (equal (car xref--last-visiting-buffer) file)
(setq xref--last-visiting-buffer
- (cons file (find-buffer-visiting file))))
+ (cons file (get-file-buffer file))))
(cdr xref--last-visiting-buffer))
(provide 'xref)