Giter Club home page Giter Club logo

Comments (4)

gessen avatar gessen commented on June 2, 2024

I think this is because the projectile-ensure-project, if project is active, returns a directory after calling file-truename. If the project is prompted no such operation takes place. With this change it works correctly:

diff --git c/projectile.el w/projectile.el
index d422632..1c6a7f1 100644
--- c/projectile.el
+++ w/projectile.el
@@ -1350,8 +1350,8 @@ See also `projectile-acquire-root'."
   (if dir
       dir
     (cond
-     ((eq projectile-require-project-root 'prompt) (projectile-completing-read
-                                                    "Switch to project: " projectile-known-projects))
+     ((eq projectile-require-project-root 'prompt) (file-truename (projectile-completing-read
+                                                                   "Switch to project: " projectile-known-projects)))
      (projectile-require-project-root (error "Projectile cannot find a project definition in %s" default-directory))
      (t default-directory))))

from projectile.

bbatsov avatar bbatsov commented on June 2, 2024

Hmm, I'm slightly puzzled by this, as I'm not sure why the true name would matter would matter here, as the paths in projectile-known-projects are absolute as well. Can you share more details about the project that's causing this issue for you?

from projectile.

gessen avatar gessen commented on June 2, 2024

It's every project that's in home directory (or subdirectory). projectile-known-projects keeps projects with ~/ prefix, but inside projectile-recentf-files there's a call to expand-file-name which changes ~/ to /home/user which then fails the comparison with string-prefix-p.

You can evaluate projectile-acquire-root inside any project and it should return expanded (with /home/user) path but if you do that inside non-project buffer (like scratch) and pick any project when prompted, it will return a path with ~/. This small difference is what causes the projectile-recentf to return empty file list when called outside of any project.

from projectile.

bbatsov avatar bbatsov commented on June 2, 2024

I see what you mean. It seems to me it'd be best to add an expand-file-name to the usage of the project-root in projectile-recentf. PR welcome!

from projectile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.