We should probably try to handle this is a more transparent way, showing the
exact error message to the user (when the buffer contains lots of output as
well, the message becomes next to useless).
Could you try applying the patch below, removing your recent customization and
seeing whether the error message is better now?
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 79d2e050d9..7c3bb9229d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -322,7 +322,15 @@ project--files-in-directory
(process-file-shell-command command nil t))
(pt (point-min)))
(unless (zerop status)
- (error "File listing failed: %s" (buffer-string)))
+ (goto-char (point-min))
+ (if (and
+ (not (eql status 127))
+ (search-forward "Permission denied\n"))
+ (let ((end (1- (point))))
+ (re-search-backward "\\`\\|\0")
+ (error "File listing failed: %s"
+ (buffer-substring (1+ (point)) end)))
+ (error "File listing failed: %s" (buffer-string))))
(goto-char pt)
(while (search-forward "\0" nil t)
(push (buffer-substring-no-properties (1+ pt) (1- (point)))