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

Provide the option for a user to add a custom face or minor-mode for buttons #28

Open
alex-a-soto opened this issue May 20, 2020 · 4 comments

Comments

@alex-a-soto
Copy link

alex-a-soto commented May 20, 2020

Background

First, thank you for creating and maintaining Hyperbole all of these years. I'm grateful.

I've used Hyperbole for the past few months, and I've enjoyed the functionality that it's provided in creating an interface for my day to day information work. When working with documents that contain a lot of text or "dashboards" that I make, I find it challenging to identify and remember what a button does visually without having to dig deeper and look at the code.

Proposal:

To provide the user with the option of customizing Hyperbole's explicit/implicit buttons,
<(fake button)>, for example, through a custom face or another method.

Example

From my research, I came across linkd-mode.

When linkd-mode is activated its links which look like this: (@file :file-name "/etc/fstab":display "File System Table") are transformed to be distinguished from each other by color and shape and optionally displays an icon.

Below are examples taken from the web-archive, and here is it's source code.

Creating a wiki-like personal "hyperweb"
image

Concept-oriented navigation in lisp source code
image

Closing Thoughts

Incorporating a minor-mode for Hyperbole's buttons or providing the user the option to customize the appearance of the buttons would support the user by knowing what to do just by looking and could ease the use of embedding and using buttons in documents and the creation of a web of "interactive" documents/dashboards.

Thank you for your time.

@alex-a-soto alex-a-soto changed the title Provide option for user to add custom face for implicit/explicit buttons Provide option for user to add a custom face or minor-mode for buttons May 20, 2020
@alex-a-soto alex-a-soto changed the title Provide option for user to add a custom face or minor-mode for buttons Provide the option for a user to add a custom face or minor-mode for buttons May 20, 2020
@rswgnu
Copy link
Owner

rswgnu commented May 20, 2020 via email

@alex-a-soto
Copy link
Author

alex-a-soto commented May 20, 2020

Hi Robert,

Thank you for your time and feedback. I'm glad you like the idea of displaying buttons with different action types, varying faces, and icons.

Thank you for the reminder of using {C-h A} and or using the assist key. I have used it in the past, and I remember reading it in the documentation, I will do my best to remember for next time. In regards to the implementation possibilities, I think this involves looking at existing examples in this space and having a discussion about it.

Idea
One possibility would be to use the all-the-icons.el package. I've seen this package being used by other packages to add icons to the modeline, Dired, or ivy.

Taking this further, we can retain the non-disruptive appearance of <(fake button)> and include a minor mode that the user could toggle that would take the <(fake button)> and transform their appearance. I would imagine reference to the appearance of the button i.e., icon and face could be stored in the respective .hypb file.

When looking at the Hyperbole's explicit button types, per the documentation:

annot-bib
completion
display-variable-value

eval-elisp

exec-kbd-macro
exec-shell-cmd
exec-window-cmd

function-in-buffer

hyp-config
hyp-request
hyp-source
kbd-key

link-to-bookmark
link-to-buffer-tmp
link-to-directory
link-to-doc
link-to-ebut
link-to-elisp-doc
link-to-file
link-to-file-line
link-to-gbut
link-to-Info-index-item
link-to-Info-node
link-to-ibut
link-to-kcell
link-to-kotl
link-to-mail
link-to-regexp-match
link-to-rfc
link-to-string-match
link-to-texinfo-node
link-to-web-search

man-show
rfc-toc
text-toc
www-url

The link-to-* action types I can imagine them being displayed similarly as to how linkd-mode has used them in the picture below, for example,>> all-the-icons-icon-for-file, button-name

Concept-oriented navigation in lisp source code
image

Closing Thoughts
Please take everything said above with a grain of salt, these are only ideas that I've had marinating for a while regarding Hyperbole's buttons.

As always, thank you for your time and feedback.

@rswgnu
Copy link
Owner

rswgnu commented Jun 28, 2020

One issue to consider is that we try to use constructs in Hyperbole that will work on any valid Emacs display including dumb terminals. That is why we typically use faces exclusively rather than icons. You may lose some capability on one display or another but the code will work without the need for a lot of conditionals. But we do support great visual packages like treemacs that use icons well and we have in the past written modules for specific display types, so we might eventually handle it that way. I do think making it easier to apply different visual formatting as desired would be a good thing.

@rswgnu
Copy link
Owner

rswgnu commented Apr 29, 2023

Hi Alex:

Thinking about this again and now that Hyperbole has had implicit button names for a good while, I am wondering if you could give specific examples of where you lack the context you want when looking at a button. It seems like this would be a naming issue and if you give your buttons reasonable names, this issue might go away or be reduced. Let's look at it with specific examples and discuss what is needed in each context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants