otavioschwanck / harpoon.el

Harpoon for emacs
GNU General Public License v3.0
93 stars 7 forks source link

Support for `project.el` #2

Closed leungbk closed 2 years ago

leungbk commented 2 years ago

It would be nice if users could customize whether to use the built-in project.el or projectile.

otavioschwanck commented 2 years ago

Added a way to select the function that returns the project name:

https://github.com/otavioschwanck/harpoon.el#customizing

just:

(setq harpoon-project-name-function 'function-that-returns-project-name-in-project.el)
(setq harpoon-project-root-function 'function-that-returns-project-root-in-project.el)

Thanks for bring me the idea!

leungbk commented 2 years ago

Thanks for working on this. There remain several invocations of projectile-project-p; could we maybe address those, too?

Additionally I think that, rather than having users specify both harpoon-project-name-function and harpoon-project-root-function, it would make for an easier user experience to have a defcustom whose value can be one of projectile, project, and find-file-in-project, the three project-related libraries that come to mind. harpoon.el could then have wrappers that choose the appropriate project-name or -root function depending on the user's choice of the one defcustom. WDYT?

otavioschwanck commented 2 years ago

Hi @leungbk , nice idea!

Just pushed. Now it detects, if projectile is installed, get the projectile stuff, if not, get the project.el.

Also is possible to set harpoon-project-package to project or projectile if you want to force.

Project.el is native from emacs, it will work anywhere, so i didn't implement for find-file-in-project.

leungbk commented 2 years ago

Thanks!