[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: project.el project-find-files and symlinks
From: |
Dmitry Gutov |
Subject: |
Re: project.el project-find-files and symlinks |
Date: |
Mon, 24 May 2021 04:01:42 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
Hi!
On 21.05.2021 14:57, Juris Bune wrote:
Hello!
I've been using emacs for few months now and slowly building up my skill and
knowledge of ecosystem. It has been great so far.
Recently I started using project.el (v0.6) and found one annoying thing -
project-find-files does not include file symlinks. I understand that it is due
to fact that under the hood it uses GNU find and current implementation of
project--files-in-directory has a somewhat hard-coded values for find flags.
To solve my case I would add "-L" option appropriately to have find utility
list also symlinks. Unfortunately this is not configurable without (as I understand)
changing package.el. Are there any other options?
You can try out a patch like
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index eab60756c8..616c6f8d32 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -297,7 +297,7 @@ project--files-in-directory
;; expanded and not left for the shell command
;; to interpret.
(localdir (file-name-unquote (file-local-name
(expand-file-name dir))))
- (command (format "%s -H %s %s -type f %s -print0"
+ (command (format "%s -H -L %s %s -type f %s -print0"
find-program
(shell-quote-argument
(directory-file-name localdir)) ; Bug#48471
and see if you like the effect. I'm not sure how to make it better
configurable, though. The current literal that's used looks like
"%s -H -L %s %s -type f %s -print0"
...and that's not something a random user will know how to change
safely. It's also very find-specific.
I suppose you'd also want the project-vc backend (e.g. in Git repos) to
follow symlinks as well?
I also wonder whether there have been any discussions in the past about
adding -L to grep-find-template.
Also, would it be somehow possible to make project.el use fd
<https://github.com/sharkdp/fd> instead of find?
People have asked about this before. Please read:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44210#26
...and email to the bug address if you'd like to contribute to that
discussion.