From 8439f834493805017e0c44fa88a6b2e9b1a893eb Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 1 Nov 2023 03:58:45 +0200 Subject: [PATCH] Catch 'permission-denied' during project lookup * lisp/progmodes/project.el (project--find-in-directory): Catch 'permission-denied' (bug#66317). Co-Authored-By: Spencer Baugh --- lisp/progmodes/project.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ac230bd0b83..76c5144b484 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -245,7 +245,12 @@ of the project instance object." pr)) (defun project--find-in-directory (dir) - (run-hook-with-args-until-success 'project-find-functions dir)) + ;; Use 'ignore-error' when 27.1 is the minimum supported. + (condition-case nil + (run-hook-with-args-until-success 'project-find-functions dir) + ;; Maybe we'd like to continue to the next backend instead? Let's + ;; see if somebody ever ends up in that situation. + (permission-denied nil))) (defvar project--within-roots-fallback nil) -- 2.39.5