emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8616e4f 1/2: project--buffer-list: Tighten the check


From: Dmitry Gutov
Subject: master 8616e4f 1/2: project--buffer-list: Tighten the check
Date: Thu, 6 May 2021 13:45:21 -0400 (EDT)

branch: master
commit 8616e4f747264da5699a9ac93961209f21f9dd6d
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    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 3382713..24feeaf 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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]