From 8616e4f747264da5699a9ac93961209f21f9dd6d Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 6 May 2021 20:43:02 +0300 Subject: [PATCH] project--buffer-list: Tighten the check * lisp/progmodes/project.el (project--buffer-list): Tighten the check to speed up in the presence of multiple Tramp sessions, too. (https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00152.html) --- lisp/progmodes/project.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 33827136a17..24feeaf1298 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1120,11 +1120,13 @@ current project, it will be killed." (defun project--buffer-list (pr) "Return the list of all buffers in project PR." - (let ((remote-project-p (file-remote-p (project-root pr))) + (let ((conn (file-remote-p (project-root pr))) bufs) (dolist (buf (buffer-list)) - (when (and (let ((remote (file-remote-p (buffer-local-value 'default-directory buf)))) - (if remote-project-p remote (not remote))) + ;; For now we go with the assumption that a project must reside + ;; entirely on one host. We might relax that in the future. + (when (and (equal conn + (file-remote-p (buffer-local-value 'default-directory buf))) (equal pr (with-current-buffer buf (project-current)))) -- 2.39.2