From: Philip K Date: Mon, 3 May 2021 09:35:41 +0000 (+0200) Subject: project--buffer-list: Avoid Tramp buffers when possible X-Git-Tag: emacs-28.0.90~2628 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3c4619edeb0994c4a62cbb149029dfda0811fb57;p=emacs.git project--buffer-list: Avoid Tramp buffers when possible * project.el (project--buffer-list): Add file-remote-p check. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d47d9d77e6c..33827136a17 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1120,11 +1120,14 @@ current project, it will be killed." (defun project--buffer-list (pr) "Return the list of all buffers in project PR." - (let (bufs) + (let ((remote-project-p (file-remote-p (project-root pr))) + bufs) (dolist (buf (buffer-list)) - (when (equal pr - (with-current-buffer buf - (project-current))) + (when (and (let ((remote (file-remote-p (buffer-local-value 'default-directory buf)))) + (if remote-project-p remote (not remote))) + (equal pr + (with-current-buffer buf + (project-current)))) (push buf bufs))) (nreverse bufs)))