-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable custom project names #928
Conversation
(defcustom projectile-project-name-function 'projectile-default-project-name | ||
"A function that receives the project-root and returns the project name to be displayed." | ||
:group 'projectile | ||
:type 'symbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a package-version properly.
This should be extended a bit further. If there's a buffer-local variable - |
Thanks for the feedback. I'll implement these changes as soon as I get a moment. |
You'll also have to rebase on top of the current |
I started implementing the precedence of a buffer-local-variable but saw some issues while testing this. I'm guessing this local variable would be for referencing projects in an external directory. Is this the use case you were thinking about? I think using this would also require to use the variable proposed for customizing project-root (#929), otherwise it won't be able to find the project root. Thanks again for your efforts and sorry about being so slow (these are my first baby steps in contributing to OS). |
It's totally unrelated. The idea is to be able to set the project name via |
I now see what you meant and implemented the suggested changes. I think tests are currently giving an error cause helm-projectile was moved to its own repo. Also, since persp-projectile was also moved I'll send a new pull request for changes related to this one, once this pull request is approved. |
The changes look good. Just squash the 3 commits together and we're good to go. |
It's done, thanks. |
And drop that |
Ok, modified commit message. |
👍 Thanks! |
@fvaresi could you tell more how you could specifice a custom project name inside a project? I couldn't figure it out from your code and the changes. |
@ReneFroger if the custom project name is a function depending on the project root, you can set If you want to customize the project name just for one project, it's easier to set the local variable For example: ((nil . ((projectile-project-name . "my-super-project")))) |
Thanks for your answer, but I got the asking message everytime:
Is there any way to turn that confirmation message off? Typing ! didn't help |
In my setup using ! will just add one safe value. If you want to say that all strings are safe values to be used you can add this to your emacs config: (put 'projectile-project-name 'safe-local-variable #'stringp) |
This was submitted as a pull request: bbatsov/projectile#928.
This enables the user to customize the project name based on project-root. This is helpful in situations where the project base dir is not descriptive enough.
As an example, I use it like this: