-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Feature request: add integration with project.el #1282
Comments
I think I looked into this once and I didn't like the integration points. The problem is that the way Projectile looks up projects it's hard to send the project data |
Basically the value is that there is at least one package (eglot) that uses project.el to find the root of projects. I use projectile to define my projects, so it is useful to "teach" project.el about projectile projects. That's basically all I am after with the integration. I have to disagree with you on this point: the code in the first code snippet is copy-pasted from projectile, and potentially uses all of the functions set in There is also no issue with overlap. The function me:project-finder is tried first by project.el, if it fails, it reverts to its own finder functions. I've been using this code for a short time and haven't seen any other issues, not that there isn't any of course. |
Ah, yes. I misread something in the snippet. At any rate - I think this approach is flawed and the vc stuff should be removed any integration function. And we should also return some sensible project types instead of something generic I guess.
Of course, you can also argue that it'd be better to teach
Why transient, btw?
Yep, that's what I want to do as well. |
"and the vc stuff should be removed any integration function" not sure what you mean here. I returned transient because I didn't want to use 'vc because it's not necessarily true, and 'transient was the only other available option. I don't know enough about project.el to define one for projectile, nor what the ramifications are. I suppose if the code that I broke out (the first function) were broken out in projectile, eglot could offer integration itself. This would just be projectile offering more functionality, it has this functionality already it's just not a function you can call. I can make a PR for this, if that's acceptable. |
The only function that
I've tweaked
To my knowledge it doesn't really matter what symbol you use. I'll likely use 'projectile in the beginning and then switch to something more specific (e.g. |
I'll try out the new projectile-project-root. Thanks. |
It seems to be working, will test more extensively today. I also tried 'projectile instead of 'transient. It doesn't work because something (eglot?) calls the generic function project-roots, and there's no applicable function for 'projectile. |
Works fine with this in my eglot config:
|
Yeah, that will return As for the transient stuff - that puzzles me, as I don't recall |
I just read the code of
|
Transient projects seem to be good enough for eglot, although a 'projectile project type would be preferable. I can call project-xxx generic functions on transient projects, and get results, well except for project-files which for some reason isn't defined. Eglot apparently doesn't call that one, so it works out. |
@dgutov Does the type of the project have any significance in |
I guess it is up to you, but I suppose there could be collisions, however unlikely. I believe it only selects the specialized functions you write for your project type, I don't know any other significance, but I am certainly no expert on anything elisp or emacs related. |
@dgutov is the author of |
Actually I took a look at Seems to me any project type should work with |
Or antagonistic external package maintainers who rather improve something that's within their control than contribute to the core. Which isn't particularly painful once one has signed the papers, which you and I have. If you think I enjoy reading comments like this from you, and then helpfully answering questions, then no. I do not.
Really. |
To answer the question, hopefully: no, you shouldn't use To return both the project root, and the project type, either define a named structure type (using (cl-defmethod project-roots ((project (head projectile)))
(list (nth 1 project))) |
@dgutov Ouch! If I offended you with my remarks - you've got my apologies. For the protocol - I've got nothing but respect for your work! 🙇 But I also don't understand why am I expected to abandon the project on which I've worked for 7 years and focus my efforts on project.el instead? (which can be one interpretation of your words 😉). As for the Emacs contribution process - I wasn't referring to me, but to regular people who probably would contribute if the bar was let low, but would not bother otherwise. Lately I've been thinking that instead of adding things to Emacs we should be taking them out instead (to ELPA), so at least they can have a difference release cadence.
Sorry to hear this, but after all I'm asking because I want to add proper support your package. Which I completely fine with not doing, as I've got plenty of other things to work on. From time to time I might make a snarky remark here and there when I'm in a bad mood or under a lot of stress, and once again apologies for this. I regret that I wasn't able to be more involved in project.el's earlier days and I don't discount the possibility of me doing more work there. It's just not something that's a priority for me, especially given how short on time I've been lately. Anyways, I hope we're on good terms and thanks for your pointers! |
Sorry for the late reply, but these kind of discussions are taxing and invariably leave me less happy than I was before participating. I respect your work quite a bit, and please let me know if you ever see an undue criticism from me. For your own part, I'd rather wish you expressed the respect with actions. Or at least being willing to examine the design of the "competing" project. Which it's isn't, really (see below). Or at least, not yet. One important thing I'd like everybody to see is that the hook-based design was explicitly chosen in acknowledgment that there are good, popular project management solutions (EDIT: for) Emacs already. Alas, since Projectile is not in the core, no core packages, functions, commands, etc, can use it directly. Hence the The built-in VC backend is there because something has to be. I will continue experimenting with it (because why not), but it's really not the part you should be focusing on. Except for inspiration, maybe, if you find anything interesting in it. |
It's a popular notion, and I support it, but we can't take everything out of Emacs. Something has to remain inside. And Emacs needs to remain usable without packages, too. |
A-a-and no. The part where I'd like to see your contribution is the design of package.el API: the hook, the generic methods and their semantics. All from the point of view of Projectile maintainer, to make sure we didn't miss something, and didn't make them incompatible with Projectile in some important way. |
Same here. I've been out of my element lately and I vow to work towards changing this.
👍 Even if they were competing projects that'd be fine. Competition is a good thing! But so is collaboration and I certainly intend to collaboration with you and everyone else involved in
Yeah, that makes perfect sense.
👍 Thanks for you for your input! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it. |
Hopefully bbatsov/projectile#1282 will be done someday instead.
More working around of bbatsov/projectile#1282
Now that bbatsov/projectile#1282 and bbatsov/projectile#1591 have been addressed in bbatsov/projectile@a0105e7, drop my own code to provide Projectile project root for xref and deadgrep.
It would be nice if projectile offered some integration with project.el, as at least one package that I know of uses it to find projects. Basically provide a function that can be added to project-find-functions so that project.el can be aware of projectile projects.
I've done this for my own config by defining a couple of functions as follows. I can work up a PR if desired. The first finds the projectile project given a directory and is ripped from projectile because the functionality was not split out as a separate function:
The second adds that as a project.el root finder:
I then add project-finder to the list of project.el functions in the configuration of the package which uses project.el using
(add-to-list 'project-find-functions #'me:project-finder)
I think probably if projectile offered a similar function it would be sufficient, but it might not be bad if it was done when projectile is enabled, so it "just works".
The text was updated successfully, but these errors were encountered: