Alexander-Miller / treemacs

GNU General Public License v3.0
2.09k stars 153 forks source link

Difference between extensions and Treelib? #1070

Closed webdevred closed 4 months ago

webdevred commented 10 months ago

Hi, I have some questions about making extensions for Treemacs.

I have used treelib so far and I want to make sure that it is correct option. Why are both treemacs-extensions and treemacs-treelib available? What are the differences?

Also I am trying to add ability to add mouse and visit with split actions to treelib because I made my own extension for Treemacs and I can only get it to work with RET, not mouse action or stuff like o h. What do you think of that idea?

Best regards, webdevred

Alexander-Miller commented 10 months ago

Why are both treemacs-extensions and treemacs-treelib available? What are the differences?

The former is my first attempt to create an extensions api. The latter is a re-write based on all the lessons learned that needed to become a new module because the changes were not backwards compatible.

What do you think of that idea?

There's nothing official yet IIRC. What kind of api are you looking at and what exactly are you trying to achieve?

webdevred commented 10 months ago

I am wanting to make a make a extension that creates some kind shortcuts to special files outside of the project that I am editing. So that I could create shortcuts for lets say a log file in /var/log or /tmp or a configuration file placed outside of the project.

I want the shortcuts to be able to be opened with both RET and key strokes like o h and o v and maybe even mouse. Adding a visit action for opening nodes to leaf nodes in my extension does not work at moment. When I have learned how the codebase works more, I am willing to write code for adding support for allowing leaf nodes to be opened using o h and o v key strokes and mouse actions. I do not have a clear plan of how I want this to work yet but if you think this could be a good idea, I will look further into it.

webdevred commented 10 months ago

@Alexander-Miller Also I think it would be easier for new developers of extensions if there were only one API.

Alexander-Miller commented 10 months ago

I am wanting to make a make a extension that creates some kind shortcuts to special files outside of the project that I am editing.

Sounds like you want integration for bookmarks.

Adding a visit action for opening nodes to leaf nodes in my extension does not work at moment.

I'll look into adding that.

Also I think it would be easier for new developers of extensions if there were only one API.

I left the old one alive because I wanted to give downstream packages time to migrate away from it. If you load it now it'll log an obsolescence warning and the documentation clearly says clearly shows which module you should use.

webdevred commented 10 months ago

Sounds like you want integration for bookmarks.

Yes, thinking about it it maybe. Maybe I should look into into that instead. I can write the code and submit a PR if I believe that bookmarks would be good for me. Writing code is always fun and I want to learn more lisp.

I'll look into adding that.

I think that would be great.

I left the old one alive because I wanted to give downstream packages time to migrate away from it. If you load it now it'll log an obsolescence warning and the documentation clearly says clearly shows which module you should use.

Thanks for the clarification. I found them both existing confusing myself but it is good that there is a warning.

webdevred commented 10 months ago

Hi, I am back again and I looked a little bit at bookmarks. In my Emacs my bookmarks lives in .emacs.d/var/bookmark-default.el. I believe the best solution would be to create a similar different file for each project. Where do you think theese files should be placed?

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

Alexander-Miller commented 8 months ago

Where do you think theese files should be placed?

For a reasonable standard look at what https://github.com/emacscollective/no-littering is doing.

Anyway, I've now added the :visit-action argument for extensions. @yyoncho maybe this is of interest to you as well.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

Alexander-Miller commented 4 months ago

I think the original question has been answered now, so I'll close here to avoid long-running tickets.