project--delete-zombie-projects: Handle "Tramp failed to connect"

* lisp/progmodes/project.el (project--delete-zombie-projects):
Handle file-error when DIR is remote and unreachable (bug#80340).
This commit is contained in:
Dmitry Gutov 2026-02-09 00:55:35 +02:00
parent f39eaad491
commit 8ddf2d2925

View file

@ -2417,7 +2417,12 @@ PREDICATE can be a function with 1 argument which determines which
projects should be deleted." projects should be deleted."
(dolist (proj (project-known-project-roots)) (dolist (proj (project-known-project-roots))
(when (and (funcall (or predicate #'identity) proj) (when (and (funcall (or predicate #'identity) proj)
(not (file-exists-p proj))) (condition-case-unless-debug nil
(not (file-exists-p proj))
(file-error
(yes-or-no-p
(format "Forget unreachable project `%s'? "
proj)))))
(project-forget-project proj)))) (project-forget-project proj))))
(defun project-forget-zombie-projects (&optional interactive) (defun project-forget-zombie-projects (&optional interactive)