GNU bug report logs - #66317
Project mode-line

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 3 Oct 2023 06:33:01 UTC

Severity: wishlist

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #118 received at 66317 <at> debbugs.gnu.org (full text, mbox):

From: sbaugh <at> catern.com
To: Juri Linkov <juri <at> linkov.net>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 66317 <at> debbugs.gnu.org
Subject: Re: bug#66317: Project mode-line
Date: Sun, 15 Oct 2023 22:42:52 +0000 (UTC)
An issue with this as installed in master:  If I navigate to a file and
one of its ancestors is not readable by emacs, I'll get an error.

For example, when I visit /home/other/foo.txt, which is readable by me
even though /home/other is not, I get:

Error during redisplay: (eval (project-mode-line-format)) signaled
(permission-denied "Opening directory" "Permission denied"
"/home/other")

Here's one idea for a patch... but maybe we should be just flat-out
wrapping it in ignore-errors?

(BTW, I actually discovered this class of bug through
project-uniquify-dirname-transform, which is also affected by it, since
like project-mode-line, it runs project-current for basically every
buffer.  So if we ignore-errors in project-mode-line-format, we also
need that in project-uniquify-dirname-transform.  Maybe they should
share the lookup?)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index fd9c146a1fd..8bf1f4d0738 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -245,7 +245,8 @@ project-current
     pr))
 
 (defun project--find-in-directory (dir)
-  (run-hook-with-args-until-success 'project-find-functions dir))
+  (ignore-error (permission-denied)
+    (run-hook-with-args-until-success 'project-find-functions dir)))
 
 (defvar project--within-roots-fallback nil)
 




This bug report was last modified 1 year and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.