Skip to content
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

Helm-Icons: Add central file to manage icon support #2701

Closed
wants to merge 5 commits into from

Conversation

Thaodan
Copy link
Contributor

@Thaodan Thaodan commented Jan 26, 2025

Helm-icons provides provider independent icon support for Helm.
Each provider can be added to the abstraction logic with small
changes.
The only requirement is that the API is mostly the same as
all-the-icons or nerd-icons.

Where possible use the provider specific handler functions such
icon-for-mode or icon-for-file are used.

For actions there are no specific functions so there's a separate
wrapper for that between the supported providers. The wrapper
can also where possible use a better matching icon where available
in a provider.

The idea is to centralize the icon enabler and then individually
have the option to disable the icon support for each source.
Currently this doesn't work exactly.

The branch also contains other related changes such as:

  • Allow for icons in basic file sources such as recentf
  • Add icon to set bookmark action if enabled
  • Use more detailed transformer function for bookmarks in all cases

My goal is to completely replace the external helm-icons package which
provided these features but missed some since it did not directly integrate with Helm.

The PR is WIP, especially the first commit could require some improvements.
The code is already much cleaner then before since much of the icon handling
is now done by the icon provider but some such as helm-hightlight-bookmark
could require some improvement as the bookmark to be mapped to it's major mode
could be done using a list with the symbol of the corresponding major-mode.

Helm-icons provides provider independent icon support for Helm.
Each provider can be added to the abstraction logic with small
changes.
The only requirement is that the API is mostly the same as
all-the-icons or nerd-icons.

Where possible use the provider specific handler functions such
icon-for-mode or icon-for-file are used.

For actions there are no specific functions so there's a separate
wrapper for that between the supported providers. The wrapper
can also where possible use a better matching icon where available
in a provider.

The idea is to centralize the icon enabler and then individually
have the option to disable the icon support for each source.
Currently this doesn't work exactly.
This way `helm-bookmark` can also make use of the annotations provided
by the more detailed transformer function.
@Thaodan Thaodan marked this pull request as draft January 26, 2025 02:10
@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Jan 26, 2025 via email

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 26, 2025 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Jan 26, 2025 via email

@thierryvolpiatto
Copy link
Member

Also, note that helm-icons.el is not usable as it will clash with the existing helm-icons package.

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 26, 2025 via email

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 26, 2025 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Jan 27, 2025 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Jan 27, 2025 via email

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 27, 2025 via email

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 27, 2025 via email

thierryvolpiatto added a commit that referenced this pull request Jan 28, 2025
which provide compatibility with icon providers all-the-icons and nerd-icons.
@thierryvolpiatto
Copy link
Member

I have pushed new changes that provide compatibility between all-the-icons and nerd-icons, the new file is called helm-x-icons.el.
If you want to do changes, please do on the base of this work.
Thanks.

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 28, 2025 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Jan 28, 2025 via email

@Thaodan
Copy link
Contributor Author

Thaodan commented Jan 28, 2025 via email

@emacs-helm emacs-helm locked as too heated and limited conversation to collaborators Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants