emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: project-find-file: switch to include non-tracked files


From: Dmitry Gutov
Subject: Re: project-find-file: switch to include non-tracked files
Date: Fri, 15 Oct 2021 00:55:37 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 14.10.2021 15:06, Manuel Uberti wrote:
On 14/10/21 14:01, Dmitry Gutov wrote:
As an aside, I can see what kind of problem this is solving, and this is a (meta) problem by itself. We need, like, ignores which are still honored when we don't use any other ignore instructions. Maybe a separate variable or something? AFAICS helm-ls-git doesn't have anything for this.

The above will continue to work until we try to move the listing logic to a backend-specific method. Then vc-directory-exclusion-list won't be referenced anymore. That's the main reason this feature is not in emacs-28 anyway.

I didn't know about this.

If we end up adding a new user option for this, what would you call it?

As a rough guess, perhaps some directories in this repo are not readable for you?

Yes, great tip, you nailed it. There is one directory I cannot read in there, so I just added that to vc-directory-exclusion-list and everything works as expected now.

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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]