]> git.eshelyaron.com Git - emacs.git/commitdiff
project--buffer-list: Tighten the check
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 6 May 2021 17:43:02 +0000 (20:43 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 6 May 2021 17:43:02 +0000 (20:43 +0300)
* 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

index 33827136a170a967b174c09c64133867fcbc169b..24feeaf1298e7205e238fb0628496d899533bfe3 100644 (file)
@@ -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))))