reddit / emacs

GNU Hyperbole Introduction to buttons Video

[deleted] · 2022-02-06 13:50
Link: <https://www.youtube.com/watch?v=zoEht66N2PI> GNU Hyperbole team has started putting new videos. GNU Hyperbole is a Everyday Hypertextual Information Manager by Bob Weiner. See www.gnu.org/software/hyperbole. Package can be installed with M-x package-install hyperbole. Here is my summary. Video is of 15 minutes. Button is a metaphor for shortcuts. You always wanted a big red button to launch something based on the context. Hyperbole makes that possible. Buttons are both for novice and experts. And probably helps novice to become experts by learning more about Emacs. Buttons can be created in personal button file (~/.hyperb/HYPB), directory specific button file (HYPB), in the current buffer (org, python, any other). Location of the button defines how they can be accessed. For example, buttons available in the personal button file are accessible globally using interactive Hyperbole menu. Implicit Button Examples: - URL button similar to Org Mode. Org Mode URL are limited to org files. Hyperbole extends that capability to other files like source code comments and so on. - File Path Buttons with capability to add line and column number. Relative Paths, Emacs/Shell environment variable in file name. Windows paths are handled automatically. - Key Series. Regular emacs keystroke. {C-x C-s C-c C-v t} will save current buffer and call org babel tangle. Or {M-x eshell RET make RET} will run make in current directory. - Action Buttons for invoking Emacs function, variables. search for todos in current directory. <modus-themes-load-vivendi> enables Prot's wonderfule dark theme. <modus-themes-load-operandi> takes you back to the white theme. Note these are buttons which you can actually click and not emacs code. - Special Feature for git hub links. - More action types. Like for rfc mode. Explicit Buttons uses same set of action type. They are better to look at than the Implicit Buttons. They are created using Hyperbole interactive menu {C-h h e c}. Difference from Org Mode Links: - Available from more than Org Mode. Example: Python Source Comments. - More visually appealing. - Ability to create them easily. - Much more powerful. Buttons can also be considered as bookmarks on steroids. Workflow Tip: - Create a Hub or the personal buttons file with all your implicit and explit buttons. (~/.hyperb/HYPB). {C-h h b p}. - This is where you start your day to launch your day. And keep coming back for more. What can be done by buttons can be done in other ways. Probably by creating elisp functions and then binding them to a kb shortcuts. But that workflow is not scalable. Hyperbole buttons are scalable and do not eat cognitive energy to invoke them.
[deleted] · 2022-02-06 14:09
Note that I am not part of the GNU Hyperbole team (in case there is one). The commentary is just my personal opinion about the Hyperbole buttons feature.
oantolin · 2022-02-06 15:20
GNU Hyperbole's buttons are interesting enough without having to spread misinformation about Org links to sell the buttons! :) Don't get me wrong: I think Hyperbole's buttons are great, but I also think that Org links are equally great. And I'm not sure about the chronology, but I wouldn't be surprised to learn that Hyperbole's button are older than Org's links (but I also would be surprised to learn it's the other way around). > Available from more than Org Mode. Example: Python Source Comments. Org links can be followed from any buffer at all, it doesn't have to be in Org mode! Just use the command `org-open-at-point-global`. > More visually appealing. This is subjective, if you mean that you find them more visually appealing I believe you. I'd just point out that for URLs and email addresses the syntax is exactly the same (the standard URL or email address syntax, neither Hyperbole nor Org mode invented this!). But for file links and elisp function links, I guess that's fair enough: you don't like the `file:` prefix that Org uses and you prefer angle brackets (`<modus-theme-load-vivendi>`) to the `elisp:` prefix that Org uses (`elisp:modus-themes-load-vivendi`). > Ability to create them easily. I find it easy to create both GNU Hyperbole buttons and Org links: just type the text, or use a specialized helper function that comes with the package. What do you find hard about Org links? > Much more powerful. Why do you think that? They can both easily and conveniently run arbitrary Lisp code so they seem equally powerful to me. For example here's how you'd define a key series link type for org: (org-link-set-parameters "kbd" :follow (lambda (kmacro) (kmacro-call-macro nil t nil (kbd kmacro)))) Then you can use all your examples with a slightly different syntax, like `<kbd:M-x eshell RET make RET>`.
ftrx · 2022-02-06 15:24
Personally I see the idea of being usable as a global minor mode as the most interesting key, in features terms org-mode is another story, IMVHO far, far, far superior both because of the outlining idea and of the development of countless features, but org-mode is the glue, the way to structure anything importing it, Hyperbole permit the opposite: inserting themselves elsewhere. Being defined in a single file makes them easy but not sure how much can be maintainable at scale, however they have still very nice points, perhaps them and hyrolo menu concept should be more used to drive the development a bit and perhaps a bit of code hyper-semplification since IMO Hyperbole is a bit bit for most today use-case and so hard to find devs like AutoComplete or AucTeX or Helm: big and powerful idea from the past that are still valid, sometimes surpassed but not completely and that can survive if they became more manageable...
LemonBreezes · 2022-02-06 15:54
I haven't used Hyperbole a lot but I really like the `{ key sequence }` buttons. I'll do the tutorial again later. I don't really use anything other than the buttons though.
toastnada · 2022-02-06 16:17
I looked into using Hyperbole a couple weeks ago. What I really wanted is the ability to hover the mouse over implicit buttons and have them highlight and then activate with a single mouse button click. Sadly couldn't figure out a way to do this.
[deleted] · 2022-02-06 16:31
By scale, you mean number of buttons. Buttons are just lines in a file. Emacs files and completion system can handle 1000s of lines, so I feel that should work. I still need to try Hyrolo. I like the concept of records and want to convert my current ms Excel tracker to such records and see if I can use Hyrolo to search them. Like I have an excel for all my bank accounts. I would like to convert that ms Excel to vertical records and then search with Hyrolo. I do not have a use case for using Hyrolo for contact management.
[deleted] · 2022-02-06 16:34
I am so far using buttons and web search. Probably those are the low hanging fruits.
[deleted] · 2022-02-06 16:42
from the hyperbole manual, I can see "Action Mouse Key" is bound to shift-middle mouse key. Further you can set the \`hmouse-middle-key\` to 't' before loading Hyperbole, then you can use middle mouse key as the Action Key. Is this what will work for you?
[deleted] · 2022-02-06 17:10
No disregard to Org. And looking at your comments, I realize that I have not fully explored the org links. I think what Hyperbole is doing is that it is teaching novice like me to learn more about links. >Org links can be followed from any buffer at all, it doesn't have to be in Org mode! Just use the command org-open-at-point-global. I tried adding [http://google.com](http://google.com) to test.txt and opened it with emacs and realized that it was not highlighted to a link. Although [test.org](https://test.org), it was highlighted. Note that in both cases, I can use Hyperbole Smart Key to open it. That is what I meant by available everywhere. >I find it easy to create both GNU Hyperbole buttons and Org links: just type the text, or use a specialized helper function that comes with the package. What do you find hard about Org links? I generally use C-c C-l to create the links and to update the name or link. I think it is just more to do with my understanding of the Org links. So I agree with you here. Your comments on elisp and kbd is very interesting. And I was not even aware that you can do that in Org. By the way my HYPB file is HYPB.org . Although in the kbd example, I cannot give a nicer name without hiding the actual keys. With Hyperbole, I can keep both visible, atleast in my personal button file. Funny enough, elisp in not here in the [https://orgmode.org/guide/Hyperlinks.html](https://orgmode.org/guide/Hyperlinks.html). I agree with your comments and straightening me. Org links are powerful in their own sense and no less than Hyperbole links. Only thing which is a winner here is the Global buttons as you can invoke them with the Hyperbole menu. But then Org also has a command to move between links which I have currently mapped with M-n and M-p. I do not see any such capability to move between links in Hyperbole. I am tempted to send a mail to Hyperbole team to why not support the Org link syntax in addition to Hyperbole Syntax. Although I know there will be some difference and they will have reasons. Btw, do you have a personal button file which you can share? I am looking for references. Even though I am all excited about Hyperbole buttons, my usage is still limited.
oantolin · 2022-02-06 17:22
> I tried adding http://google.com to test.txt and opened it with emacs and realized that it was not highlighted to a link. Although test.org, it was highlighted. Note that in both cases, I can use Hyperbole Smart Key to open it. That is what I meant by available everywhere. Just to be absolutely clear, the command `org-open-at-point-global` will open the link even in the text file where it is not highlighted. So Org links are also "available everywhere" in exactly the same sense as Hyperbole buttons. There is no difference in availability. > I generally use C-c C-l to create the links and to update the name or link. That runs the command `org-insert-link` which also works just fine in non-Org buffers. You could bind it to globally accessible key binding if you wanted to. > Only thing which is a winner here is the Global buttons as you can invoke them with the Hyperbole menu. Yes, that's a nice Hyperbole feature. Even just global button definition is a little awkward with Org. For example you could do (org-link-set-parameters "config" :follow (lambda (_) (find-file "~/.emacs.d/init.el"))) And then `<config:>`is a link to your `init.el`, but that trailing colon is not optional and it looks pretty weird! > Btw, do you have a personal button file which you can share? Sorry, I am not actually a Hyperbole user, just a fan.
toastnada · 2022-02-06 18:01
Thanks, this is really helpful! Not quite as nice as org-mouse where things that are clickable get highlighted on hover and left mouse button activates them, but still very useful.
[deleted] · 2022-02-06 18:10
Aha.. I am still on terminal... Waiting for windows 11 upgrade to try Emacs GUI.. thanks for sharing the org mouse tip.
Hectosman · 2022-02-06 21:06
This could be handy with hub nodes in a Zettel.
[deleted] · 2022-02-07 01:57
U mean in org roam?
ftrx · 2022-02-07 10:05
Yep, I mean the number of button and the fact that if you do not auto-generate the single-file where they are defined, for instance via org-mode/babel tangle, while Emacs can perfectly open a 10k line long file the human do have issue editing it... About HyRolo, honestly I do not think it's usage can really be as advertised, what is interest is not IMO the actual implementation but the UI/the access model in UI terms, not in actual implementation. I mean: almost all users do depend on '80s IT choices that was made just to replicate classic "paper-based office", files and folders are a good example of that, but we know that such model is far from good. We do already have search&narrow model since decades, we do have DB and query concept since decades. Just is not spread much. We all use Google Search (or some equivalent) but locally 99% of the people is stuck in files&folder or even worse bound to rigid (cr)applications that hide anything underneath without any means to act or change their behavior by their users. HyRolo, buttons, org-roam, org-ql etc are small steps toward a modern system, probably all of them can't reach that stage as they are today, but their concept in UI terms definitively can.
[deleted] · 2022-02-07 11:07
Good comments on interface and usage. I have started seeing Emacs as an interface builder for CLI :-).
arthureroberer · 2022-02-07 17:25
the github repo [https://github.com/rswgnu/hyperbole](https://github.com/rswgnu/hyperbole) and a file with the new things for v8 https://github.com/rswgnu/hyperbole/blob/master/HY-NEWS
paretoOptimalDev · 2022-02-07 19:38
> So Org links are also "available everywhere" in exactly the same sense as Hyperbole buttons. There is no difference in availability. The lack of highlighting is a usability distinction though, so I wouldn't say exactly... but very close.
oantolin · 2022-02-07 19:46
If I understood OP correctly, having Hyperbole does **not** highlight URLs either! Reread what OP said: > I tried adding http://google.com to test.txt and opened it with emacs and realized that it was not highlighted to a link. Although test.org, it was highlighted. Note that in both cases, I can use Hyperbole Smart Key to open it. (I'd test that but GNU ELPA seems to be down so I can't install Hyperbole right now.) Any way if you want URLs highlighted in every buffer, use the built-in `goto-address-mode`.
arthurno1 · 2022-02-07 22:58
> What can be done by buttons can be done in other ways. Obviously :-). It is just text properties. Have you checked what Emacs comes with? There is a file called button.el. in the lisp directory of Emacs source. For example, it is used in built-in help mode. When you press C-h f, there will be a small help buffer poping up. Those links there are all buttons. You can study the source for built in help if you are curious about how to use button.el. There is also widgets.el library that comes with Emacs which offers more powerful TUI widgets you can use in any file (it is used in customize). You could bind functions to insert those widgets or buttons to either a yasnippet macro or a simple command to insert them into files easier. > Probably by creating elisp functions and then binding them to a kb shortcuts. But that workflow is not scalable. Hyperbole buttons are scalable and do not eat cognitive energy to invoke them. I am not sure how Org links, or any other button/link for that matter, eat cognitive energy to invoke them, but it is true that shortcuts are a scarce resource in Emacs. Also, they put cognitive load to remember them. However, there are more scalable ways than both keyboard shortcuts and sprinkling files with markup and lisp function names, which both usually introduce unrelated clutter to the content of the file itself. It is called search and completion, typically fuzzy. If you dislike Helm, by now there are several other frameworks. I would even say that something like Helm is way more scalable than those buttons you show in the video. The reason is that we can configure many actions in Helm per button type, and those actions itself appear in a secondary buffer (when you press tab) which is also a list of candidates that Helm will search and complete, while textual buttons in a buffer can do only one thing, so you need different classes (types) of buttons to do different things. It also puts cognitive load on you to remember correct syntax (markup) for the type of button you like, or to remember the exact name of the command you wish to invoke with that action button, while with a completion system, you can just search and have the tool complete it for you. Maybe someone can build a list of completions and completion system for "buttons" as well, I don't know, I have never used Hyperbole, so no idea how simple it would be or if it is already done. Also, why not just use thing-at-point and offer a list of action candidates? We have just got something similar to that in Emacs 28 - it is called context menus and will let you specify a list of actions to perform on a piece of text matched by a regex. Now we will just need a package to feed that list into Helm so we can complete it by typing instead of using the mouse :).
[deleted] · 2022-02-08 01:40
Thanks. Need to try your suggestions. I use Vertico/Consult for completion. Never tried Helm though. I have heard about context menu, but using terminal Emacs as of now. waiting for Win11 upgrade to try GUI emacs. I am on windows+wsl2. I have not used buttons in any fancy way. The only thing I have done so far is to invoke a python script from the Hyperbole menu button. I could have done the same using M-! /long/dir/path/script.py arg1 arg2. But rather than that I find creating a global button and invoking it using the Hyperbole menu to be less taxing. Hyperbole global button in a way are like C-h f. The menu is invoked using {C-h h g a} though.
arthurno1 · 2022-02-08 05:58
> using terminal Emacs as of now Isn't Emacs in your window GUI Emacs.
[deleted] · 2022-02-08 06:20
I am yet to upgrade to win11
arthurno1 · 2022-02-08 06:30
Don't know why is it relevant, but your Emacs in video is GUI Emacs, not terminal.
[deleted] · 2022-02-08 09:23
I am not the video author... 😀😀
arthurno1 · 2022-02-08 12:11
Aha. Ok. So why don't you use gui Emacs. It works on Windows 10.
ftrx · 2022-02-08 13:16
That's an aspect I do not explore in that sense, but I do essentially the same coming from the opposite end of the spectrum: I've tried to put anything in Emacs instead of Emacs in anything, and so far it does work beautifully well! Having almost all my files org-attached let me access then in a search&narrow style with notes (org-mode/org-roam) that act not only as notes but also as "metadata" for my files so something easy to full-text search, to tag, to query etc something hardly done with classic file&folder approach + the notes "as notes" themselves, org-babel to integrate "active stuff" and elisp itself as clickable links (`elisp:(...)` links) to do something from slides to small computation in various languages/tools. The only parts I've still outside Emacs are Firefox since using it without TabCenterReborn extension/without side-tabs as Emacs buffers does not scale much for me and terminator+zsh since I can't really work on eshell it feel mechanic/limiting for my shell usage style, perhaps is just a matter of habit but so far I can't really use it much...
[deleted] · 2022-02-08 13:17
It needs x server. And there are no good free x server as far as I know.
arthurno1 · 2022-02-08 14:07
It does not. Emacs runs on native win32. You can [download pre-compiled Emacs from official GNU ftp](https://ftp.gnu.org/gnu/emacs/windows/) if you are not able to compile it yourself.
[deleted] · 2022-02-08 15:08
I know that. But I like wsl2 with Emacs. Wsl2 provide Unix kind of environment which I am comfortable. Although all of that can be replicated in windows. But Unix is always easy in term of information available.
arthurno1 · 2022-02-08 20:34
> Wsl2 provide Unix kind of environment which I am comfortable. Although all of that can be replicated in windows. But Unix is always easy in term of information available. You can have pretty much same environment as in gnu/linux withs msys2 or cygwin. What exactly is the difference betwen those and WSL, more than running on bare metal instead of in virtual machine? > And there are no good free x server as far as I know. Same X11 that runs on gnu/Linux runs on cygwin. I don't know what is the status with msys2. Which X11 do you run on your Unix, and which Unix are you using if it is not *bsd/linux based if you don't find the free desktops X11 good enough? > By the way, people seem to be running X11 on WSL2 too. I don't think you need Windows 11 for that, either. I also see that people are running [X11 on WSL1 & 2, for example here.](https://stackoverflow.com/questions/61110603/how-to-set-up-working-x11-forwarding-on-wsl2) There are also other X11 implementations, for example X-Win32. Which offer free version with some limitations. At least they used to when I was a student some 20 years ago.
rswgnu · 2022-02-26 23:19
There is and if you are a knowledgable Emacs Lisp programmer, you can join it too.
rswgnu · 2022-02-27 03:53
Hyperbole has two categories of buttons, explicit and implicit, each of which can have an arbitrary number of button types. Org links are like explicit button links, created one at a time as needed. Implicit buttons are typically references in text with little or no markup, e.g. page 26, {C-x C-s C-h i}, etc. These are the most used in Hyperbole and offer a whole level of convenience that no other Emacs mode or package offers.
ScaldingWontonSoup · 2022-02-27 23:38
Hey RSW, I see that you have released Hyperbole 8.0. But that is not reflected on the emacs package sites. Will you be releasing this to the emacs package(http://elpa.gnu.org/packages) sites? Thanks for your work on this package!
[deleted] · 2022-03-01 05:46
[deleted]
rswgnu · 2022-03-12 18:50
>I am tempted to send a mail to Hyperbole team to why not support the Org link syntax in addition to Hyperbole Syntax. Although I know there will be some difference and they will have reasons. Hyperbole supports following Org links out of the box. If you have a sample Org link that does not work when pressing the Action Key, please join the Hyperbole mailing list and send it there.
rswgnu · 2022-03-12 18:58
Nice quick summary of Hyperbole buttons. If you simply follow the written directions for Hyperbole, you will find it simple and powerful. The people who struggle seem to want it to operate differently than it does, force Org assumptions onto it or simply want something different. Org mode is completely different, though can be used alongside Hyperbole. Hyperbole is for when you want more flexible, easier-to-use buttons with less markup everywhere in Emacs, a legal-type autonumber outliner, a hierarchical record lookup system or a quick, scriptable window and frame manager. Either these things are what you are looking for or not. If they are, try to use Hyperbole as described first, get comfortable and then try to work through how to integrate it with other toolsets you use.
rswgnu · 2022-03-12 19:04
>What can be done by buttons can be done in other ways. > >Obviously :-). It is just text properties. Have you checked what Emacs comes with? There is a file called button.el. in the lisp directory of Emacs source. For example, it is used in built-in help mode. When you press C-h f, there will be a small help buffer poping up. Those links there are all buttons. If you run through the implicit button capabilities defined in the hibtypes.el and hactypes.el files of Hyperbole, you'll likely find that there is no other Emacs package that provides this extensive set of press-to-activate button capabilities. Hyperbole buttons are far from just text properties and this is why they have been developed across many years to optimize developer and knowledge worker productivity. Hyperbole buttons were initially developed as early as 1989 as I recall. Hyperbole's initial hypertextual work predated the web but then was developed alongside it as the web emerged and has been updated in the last decade to work with many current Emacs packages. So if you ever want to know the sequence of related hypertextual history, it was: Engelbart NLS/Augment, Nelson's Xanadu concepts, Hyperbole, WWW, Emacs buttons and then Org Mode. Hyperbole is like a meta-level wrapper around all of this work aside from the Xanadu work which was ambitious and never made practical.
rswgnu · 2022-05-03 03:28
Hyperbole 8 is now officially released to Elpa.
ScaldingWontonSoup · 2022-05-10 19:20
> Hyperbole 8 is officially released now to Elpa. Thanks!