how to follow symlink? #83

bling opened this Issue Mar 27, 2013 · 5 comments


None yet

4 participants

bling commented Mar 27, 2013

i'm trying to get this use case to work:

cd ~/dev
git clone repo1
git clone repo2
mkdir both
cd both
ln -s ../repo1
ln -s ../repo2

running projectile-find-file from here gives me a list of nothing (i already have projectile-require-project-root set to nil). how do i configure it to follow through all symlinks? is that possible?


bbatsov commented Apr 20, 2013

I think that you're using non-native indexing this should work since it will fallback to find. I guess the Emacs Lisp code should work as well (at least in theory). No idea why its misbehaving. I'll investigate when I find some time to spare.

Find doesn't follow symlinks by default, but you can make it follow with -L; so customize-variable projectile-generic-command, then put something like:

find -L . -type f -print0
bbatsov commented Nov 18, 2013

In light of @sebmaynard's comment I'll consider this issue resolved.

@bbatsov bbatsov closed this Nov 18, 2013
glucas commented Nov 18, 2013

I don't believe this is a complete solution? Modifying the find arguments as suggested does allow projectile to build the list of project files, but when I actually try to visit a file it attempts to create a file at the specified path rather than traversing the symlink. So I get an empty buffer and a warning to use M-x make-directory to create the nonexistent parent dirs.

glucas commented Nov 21, 2013

Never mind. The problem I was seeing had to do with my .projectile file.


  • I had an include rule for a subdirectory that is actually a symlink.
  • I left off the trailing slash, e.g. "+/dir"

WIth this configuration the project index included all the files under 'dir' but with a repeated path element, e.g. "/dir/dir/the/file". So projectile-find-file always failed to open the file.

If I add the trailing slash or remove the include rule, things seems to work find with symlinks.

@dhaley dhaley pushed a commit to dhaley/dot-emacs that referenced this issue Mar 31, 2014
Damon Haley bbatsov/projectile#83 e593213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment