Top 10 ways Hyperbole amps up Emacs
Robert Weiner - Pronunciation: like fine 'wine' and 'er', https://gnu.org/s/hyperbole https://github.com/rswgnu/hyperbole, rsw@gnu.org
Work in progress: main talk does not have captions (Volunteered: sachac)
This talk does not have captions yet. Would you like to help caption this talk? You may be able to start with these autogenerated captions.
Format: 66-min talk ; Q&A: BigBlueButton conference room
Status: TO_REVIEW_QA
Talk
Q&A
Description
We will count down the top ten ways that GNU Hyperbole can improve your Emacs productivity and experience through:
its magical ability to turn ordinary text into hypertext
its legal-style auto-numbered outlining
its fast, record-based lookups
and its rapid, programmable ability to control all of your frames and windows.
Hyperbole has no required external package dependencies and is compatible with and tested against every major Emacs version from 27 to the latest master branch and works on every major computer operating system and window system in use today, so you can run it regardless of your environment.
Discussion
Questions and answers
- Q: Do buttons keep their metadata within the same file? E.g. would I
see it if I change to fundamental-mode?
- A: Summarizing: if it's an explicit button the metadata is in a different file in the same directory, ".hypb". If it's an implicit button, no, no metadata in the buffer; such buttons have no metadata, Hyperbole creates all of the button properties from the existing text in the buffer.
- Q: Is it possible to link to a file by its ID (denote, Org ID, or
some similar unique string inside)?
- A:
- Q: Re: the frames example: any thoughts or consideration for a
transient interface? Or, is this something one could already toggle?
- A: Hyperbole predates many of the newer features and packages and Emacs but they integrate as they find them useful for Hyperbole. They think the current minibuffer menu is pretty good and don't have plans to have a transient menu
- Q: Re: multi-file search functionality. Why not implementing it
within the existing framework of M-x grep or similar built-in
commands? Yet another search interface sounds a bit redundant.
- A:
- The point is: why not upstream search interface?
- Q:
- A:
- Q: Hyperbole's been around for a number of years now. What
inspired you to write it back around the time of its birth?
- A: Born before the Web. The Web was born in the middle of a Hyperbole version's development. Seemed like an explosion of unstructured information was imminent, e.g. needing to deal with many emails, non-database-structured info. Needed a general system that could work with other general systems like emails, document production. Was researching at a university on "Personalized Information Environments" (PIEs). PIEs was an architecture with managers (like Hyperbole) and point tools that would leverage the managers (e.g. an email reader as a point tool to leverage the hypertext manager). Wrote a Gmail-like system years before Gmail (also similar to Rmail). Allowed buttons embedded in Rmail drawn from the subject of the email message. Rule-based processing was included, etc.
- Are you familiar with embark package? I think there is some
overlapping functionality with Hyperbole.
- A: Yes, recently started using it. Have talked to oantolin (Omar Antolin Camarena), the author. Thinks that Embark and Hyperbole are compatible, much like Hyperbole and Org are. All of these tools can be used together well.
- Q: Wow. What you are describing now reminds me a lot about HyperCard
that I grew up on. Do you know if Hyperbole inspired Bill Atkinson
or if you were inspired by HyperCard? Or were there just a lot of
thought about hypercontextuality around that time?
- A: Bob's research on PIEs was seen by Apple and helped to inspire their work on the Newton, which later also inspired the iPhone, et al.
- Q: Is it possible to only use one feature of hyperbole without the others (i.e. using only the implicit/explicit buttons without hycontrol, hyrolo...)? (without having to rewrite part of the code in hyperbole) in order to be able to load a smaller hyperbole (hyperbole is now quite large).
Q: Is there a link to the video for this talk? I woke up too late for it! It was done live, so the recording will be added after the conference organizers have time.
- Should now be up at https://emacsconf.org/2023/talks/hyperamp
thanks bob i heard about hyperbole long time ago now it is time to revisit with this beautiful presentation
- nice presentation, bob!
- no metadata no problemo
- Q: for anyone who uses hyperbole is there a way to delimit a button like you create text that is shaped like a button but you don't want it to be a button?
- i'm intersted in hyperbole it's on my todo list of looking into for emacs stuff
- Great talk thank you bob!
- thanks for showing hyperbole, always been curious about it. makes me think there's an overlap with ffap, hyperbole and even treesitter in a way
- i'm going to look into hyperbole for sure now. it's been on my to do list
- Bob has a long history of doing impressive work
- I didn't know about rsw other packages, look at that http://ftp.ntua.gr/mirror/python/workshops/1996-06/papers/h.pasanen/oobr4.html
Transcript (unedited)
I keep forgetting that we have an introduction now. The introduction is flying. So hi again, everyone. I promised you we would be back in about 30 seconds. I lied, it was actually 1 minute, but we are here with Bob. Hi, Bob, how are you doing? and so are we. We're glad to have you again this year. So what we're going to do, we're not going to waste any time right now with chit-chats. What we're going to do, we're going to move straight into your presentation, Bob, so that you have as much time as you can. I'm going to recede into the background. I am going to full screen your presentation on a stream. And Bob, the floor is all yours. Glad to be here. I hope everybody has an idea of what Hyperbole is, but it's a broad information management system inside Emacs that works in all major modes. It's a global minor mode that you can turn on and off very rapidly so that you can just get in and out of hyperbole. And it works mostly from a mini buffer menu that if we just hit ctrl H H we see at the bottom of the screen here and as you see in some of this text right here, Dee will show you a demo with all these video links of Hyperbole now. But let's just get into the top 10 reasons to use Hyperbole. Number 10 is a key series curly braces. So you just put curly braces around any set of key sequences that you want and hyperbole magically turns that into what we call an implicit button a hyper button and any kind of text that you have so if we go down here and we just click click here we see it that was a complex button that said let's start a shell, let's set an environment variable as you see the command right up there, and then let's do a grep over the hyperbole code and find all instances of a particular label. So if we hit made a return, that's called the action key. That's what you use throughout hyperbole when you just want to activate any kind of button. So you see it jumped to the grep output and this is in a shell buffer it's not in a compilation buffer so anywhere that you have this sort of thing it's also an implicit button and any sort of grep output or compiler output you can just jump to with the same key, made a return. So that's key series, the first part. And then just to note that you can also just do a, well I'll just do it here and show you that you can do a recursive grep with this hyperbole command, HYPBR grep. And if you're in an Emacs list buffer, it will only grep across the Emacs list. So a very handy way to just go through your code very rapidly and then jump to various points in it. So we have a lot to cover today, so I'm going to go through this rapidly. This isn't a tutorial, it's just to get you interested in some of the features, and then there's a ton of reference material and videos now available for Hyperlink. So let's go to number 9. Path names become implicit buttons. You don't even have to quote them. You can add environment variables or elist variables with the syntax right here. So here we have a shell script that's somewhere on our path. And notice path is an environment variable with many different paths within it, right? But Hyperbole knows that and it searches the path, gets the first match, finds it, and finds the actual shell script. So you can just embed that anywhere. Here we have a list variable, hyperbdur, which is the home directory for hyperbole, and then a markdown file, and a link to a direct section in the file, and the 5 colon 5 means go to line 5 within that section and column 5. So let's just try it. Boom, we're right there, and we're on another link that we could activate as well. So notice the next line is the same link but this is how you normally have to do it in a markdown file. You have to change the section header to have dashes but with hyperbole you don't have to. You can just put it exactly like you see it in your file. Here the pound syntax for sections is really a generic syntax in the hyperbole. And so it works in all different kinds of files, your programming files. Here's a shell script and we said let's just go to the first comment that has alias in it. Notice we didn't have to say the whole line, just the first part of it. And it matched to it. Here we have a link to our hyperbole structured outliner called the K Outliner. And you can see it auto-numbers all these cells. But in addition to just displaying, you can also add a pipe symbol near the end and use this view syntax to clip to 2 lines and show blank lines. So let's see if each node gets clipped to 2 lines. So you see they're all just 2 now with the ellipses and then we can expand them. So a lot of power there just with path names. Let's continue to number 8. up in case your internet misbehaves and we've set this up before we started, but I think the vibration is a little loud whenever it does. Can you maybe move it a little bit? I think so. It will have to vibrate again. Okay. It shouldn't have been vibrating. but definitely we had vibration. Anyway, carry on. Sorry for the interruption. special prefixes. There are 3 prefixes you can attach to path names. The first, if you want to load, instead of just finding a file, an ELIST file, you can actually load it. And so I can just hit made a return on this, and you see in the mini buffer, it loaded it as compiled e-list. I could put a .el on here, a .elc, .gz, all of that'll work, and just put a dash in front to load it. If you want to run a shell command, just put an exclamation mark in front of something and again you can have the environment variable. So here we're saying run the program date and you see, let's see, let's do it again. There we go. It ran date and you see the output right there. And what if you want to run a graphical program on your system? Well here, we want to open a PDF file and I'm just using XDG Open on Linux, you could use Open on Mac and you just put an ampersand in front and there's the Hyperbole manual instantly displayed. So lots of power there and all of that actually .pdf's and many other file types are automatically linked to various programs by Hyperbole. So you could just use the path name itself and it would probably behave the same way. Number 7, bookmarks on steroids. So Hyperbole gives you a personal button file, which is on the menu you see here under button files, and then personal. So here we'll just display it. And you can put whatever you want in here, these implicit buttons of any type. You can name them the way here and you can activate either the name with MetaReturn or the button itself. So, of course, if we did MetaReturn here, we'd just display that in a web browser. I'll just do a few of these. So here's a section of line. Let's just jump there. But these can be all sorts of different actions that are going on. And you just, whatever cross references you want, you put in here. And the neat thing is that this then becomes a list of what we call global buttons. So when I go into the menu and I go control HHGA to activate a global button, you can see that all the names from this file appear here. So only the name buttons appear, and I could like go to the hyperbole to-do list and things like that. So very, very quick access to all your information whenever you need it. And that could be an org file as well if you prefer that. So we just took care of that. Number 6, instant test case running and debugging. This is a fairly new feature. What we're seeing here is a pre-release of version 9, which should be out within the next week. But the instructions at the beginning of the presentation tell you how to get the development version of HyperBlade, which is right now 8.01 pre, but that's virtually the same as what 9 will be. So you can grab that as of today. So let's just jump to a test file. What you see here is called an explicit button. You can actually make buttons where similar to org, where you just see a bit of the button and all of the metadata is hidden. I can say control A J and I see all about that button, exactly what it's going to do before I activate it and even who created it or last modified it. Then just queue out of here and you're back where you were. So now, what this did is link us to an ERT test. If you write tests in Emacs, you probably use ERT tests. So if I hit made a return on here it'll just run the test tell me it passed great okay but maybe I had a problem so let me use control you made a return and that will e-debug the test instantly. So now I'll step through it and it says, well, let's, this single line actually creates that explicit button. You see we have an empty buffer here that we're in. Now I step through that and now there's the explicit button that got put in there. Now the next line I step through it and this is going to check if we have the right action type and it returns true so that's good and now we should be it should be associated with the temp buffer returns true good And that's why what you saw before is this passed. The whole thing passed. So lots of power there. Simple to use. You're just using your made a return and prefix arguments. It's something everybody who develops should have. So number, let's go on. I think we're making pretty good time here, but I turned off my timer. Let's go to number 5. This is a very new feature, which is very cool too. You used to have to use the mouse probably and you could drag across windows to go from a source to a referent buffer and that would create a hyperlink for you. But now we've installed it and made it even easier on, we've installed it on a, on the hyperbole menus. So let's just go back to our presentation here and say we want to link to this line that we're on there. And I'll just create the button in our scratch buffer here so it doesn't really mess anything up. So I just put my point in where I want the button to appear and then I put point where I want it to link to in the other the other buffer and then I just say control HH to get my menu, I for implicit button, and then L for link. Boom, it inserts it, right at point. What did it do? It knew that this was in the hyperbole directory and I have a variable for that, so that if you sent this link to your friend who uses Hyperbole, it would still work right because they have a different hyperbole there. And then I want to go directly to line 116. So boom, it just took me there. So that's it. And Hyperbole is doing all this for you. You just say I want a link to this thing and it figures out what's at point and it determines the right type of implicit link to put there. And that's the whole point is that you're just working like when you're programming or you're writing an article and you just hit made a return or or pull up a menu and hit a key binding and you're off to the races. So that was implicit linking We can also create those explicit link buttons, and as well as the global link, where we would just give it a name, and it would automatically put it in our global button file without us even having that on screen. So lots of power there as well, lots of consistency. Now let's take a look at the K Outliner a little more. I'm just going to show you 1 feature actually. I don't have time to show you the K Outliner in detail, but it's a really cool structured outliner that even if you love Org Mode, you should try it. And this is 1 thing that you can't get with Org Mode, is let's say Hyperlink comes with an example file which teaches you about the K Outliner. So we'll just use that right here. And when you're in the K Outliner, you can bring up and go into the K Outliner menu right here at the bottom. And there's a format menu there. You always take the first letter of a menu, the first capital letter of a menu item. So F for format and then D for display in browser. So just let's do it. We have with 1 button or 1 key we've produced the entire outline in a collapsible outline in HTML. So I can go here. I just have to use my mouse. So I can expand and collapse these trees live with very basic coding. We tried to keep this as simple as possible. But you see it maintains the structure of the outline and even tables. So all the formatting is maintained and again it's instant. Or you can just export it to a file without displaying it. Very efficient kinds of operations. So that was number 4. Number 3 is a subsystem, another subsystem in Hyperbole called Hycontrol, which is for window and frame management. And I just wanted to show you 1 thing in there. It's got a lot of capabilities. But I always had the problem that Emacs wouldn't let me scale my fonts, all of my faces at the same time. I wanted to zoom. I didn't want to increase the default font size and all the others stay the same. So let's just display our faces right here and then we have a choice of either controlling frames or windows. So let's start by controlling frames. So you get another submenu when you're in high control to tell you what to do here. And there's just lowercase z and uppercase z. So let's try it. So it's scaling the entire frame. And you can see from the list of faces that they're all scaling at the same time. And I can go back down. Now if I switch to window mode, and there's a special fast way to do that, just hit T to toggle. And if you look at the bottom menu it says frames right now now it says windows when I hit T so now if I do the same Z to increase it's just this window and but it's you know it's the faces in there so a lot of power again but I just haven't found anywhere else that you can get that kind of control over your faces very rapidly. So that's number 3. Now number 2, let's put that in there. So the HiROLO is the final subsystem in Hyperbole and this has gotten much cooler. So it started off as a contact management system, but it's really just a hierarchical record management system that lets you have as many files, directories as you want, and you can search across all of them without any external utilities necessary, just what's built into Emacs and Hyperlink. So as you can see, we've expanded it to handle org files, markdown, K outlines, Emacs outlines. So what I'm going to do is just say, I want to search using my Hyberlo file list. You just set that to what you wanted to search. But now you have all this flexibility. You can use environment variables in it. You can just specify a directory and it will find all those matching files below that directory recursively. You can give it the markdown file here and you can use file wildcards as well. I mean, look at this. It's got a list variable in it and a wildcard, and it's just all I'm gonna do is I change this from a Lisp expression to make it a hyper button. You just change the outer parens to angle brackets, and then it's automatically an implicit button that you can activate with made a return so just ran that and now I've set my file list so now let's do a search it would be ctrl H H roll it X R and then S for search But I'll just do it this way. And boom, it found everything that fast. And I can just get like, show the top items in there. So I kind of have outlining in this buffer. I can just move to each match that I hit. And notice, although everything was collapsed, it's expanding here. When I move in and out of each of the entry matches, it expands or collapses as I move to the next 1. So a lot of power there. What else? So just tabbing through these things. And you notice that it's working across all of these different types, and it's telling you which file everything came from right up here. So I could just made a return here, should work. Yes, revisit the file normally. And it just pulls it right up. So everything is live and hyperbole. You've got hyperlinks everywhere. Let's just get rid of that. Go back to our demo. So if you are fans of Vertico and Consult, you can now use that with the High Rollo. So all you have to do is let's just format our windows, and then I'll say, let's use ConsultGrep over the Rolodex. Now, it found all the matches there, and I can just move live through them in the buffer like you may be used to or I can filter back down and say using orderless joystick or anything that has joy in it just match to those lines and then I can you know either jump there or quit out of here. I'll just quit out of it right now. So very cool. And all of that is using whatever you personally set as the set of files and directories you want to search. And finally, our number 1 feature of Hyperbole is you can customize this to give you these kinds of implicit buttons, whatever kind you want. And there are 3 levels of doing this. The first is for non-programmers. You can just set a string, like a URL with a parameter in it. So the %s represents the parameter, and This is how you do a search on DuckDuckGo. So all I have to do is evaluate this defal for action link. And now I have a new implicit button type that I can put between angle brackets. And I just give it that name, DDG, and some parameter, whatever I want to search for, and this is a button that does that search. Very cool, right? So you can embed these. This could be a hyperlink in, you know, a comment in a programming file. Anything on the entire web that you want to link to, whatever kind of compact notation you want to give it. So that's what we're going to learn as we get more advanced here you can give it even more compact notations. So as you get more advanced you can say, well I don't like this angle bracket, I want to have an implicit button that uses these square brackets and then an angle bracket inside it. So then you need the defile for implicit link. This lets you specify your start and end delimiters for your new type and and then you can give it a function that you wanted to run and that will take the text of whatever is in the button, in this case, test release here, and feed it to the function that I gave here. So what this function does is grep over my git log and find any commits that include the term test release in it. So let's try it. First I have to add the button type and that's all it takes and it defined it now. So anywhere in Emacs now I can use this button type essentially. So let me try to activate it. Okay, and it says yeah let's save it. Okay so now it's running a git log command. It found all the commits and now of course if I had made a return on this commit it recognizes it as an implicit link, and if I search for what was a test release, there it is. So this commit had that in there. So all these matches, so I don't know how other people do this, but for me this makes it a lot simpler. So a lot of power that any programmer can use. And finally, if you've mastered Emacs Lisp, or you're starting to, you can look in the hib types file in Hyperbole and see all sorts of uses of defib, which is defined implicit button. And that's the full power of e-LISP when you want to define 1. So what we're going to do here is I wanted to know, given a date, what the day of the week is. And because the date primitives weren't quite written the way I might like, it's a little longer than some. But I'm just going to evaluate this list. And I've now defined DOW as an action type. Now, how do I know I'm doing that? So I can always say Control-H, capital A here to see what a button's going to do. And it tells me When I'm there, I'm at a hyperbole button, and the type is from category DOW. And what's it gonna do? It takes a mark, it's gonna do a message action. Okay, so let's try it. It tells me that's a date, and it falls on a Sunday, which is today. That's correct. So 2 days from today is a Tuesday. Beautiful. So we've just totally transformed what we can do with text. You notice there's no markup here. And this is working with all of the other implicit types that we have everywhere in Emacs. It's only going to match to this kind of pattern and anywhere else, you know, it just won't trigger that type. So lots of power. You just need to get started with Hyperbole. There's great documentation both inside the code and in the manual. There's a fast demo that you can start with and there's about 10 different videos. There'll be 3 presentations on hyperbole here at the conference, and I hope you've enjoyed this presentation. I'd love to answer your questions and get some new users for Hyperbole. So lastly, I'd like to thank my co-maintainer, Matt, who's going to speak later about the extensive test protocols we have in Hyperbole. Hyperbole works on every version of Emacs from 27.1 up, and every operating system and Windows system that you use. And thanks so much to the volunteers and the speakers at EmacsConf. You do a great job, and we're all really appreciative that you take all the time that you do to make this happen. Thank you very much. So I'll let you do the gymnastics to join us back on BBB and put your webcam. In the meantime, I'll invite people, as Sasha told you in the introduction, to go put your question in the pad. The link is on the talks page and also on IRC. So take your time. We've already got some people who've asked questions. You can also start joining the room. Let me just ping Sasha. Ping to open ID HyperAmp. So, you'll be able to join us on BigBlueButton as well to go chat with Bob more directly. I'm not sure if people have joined already. Not yet. So, Bob, what I'll do, we already have 4 questions. I'm gonna read them to you and you can take your time answering them, but we do have about 7 minutes until we go to the next talk, so we need to be a little bit questions, and I'm also going to display them for the stream to see, do buttons keep their metadata within the same file? E.g., would I see it if I change to fundamental mode, for instance? implicit buttons have no metadata. That's the great thing about them, is you just type them in the buffer and what you see is all there is to that button and hyperbole generates all the smarts associated with them. When you create an explicit button, which I showed you 1 or 2 examples of, that metadata is, there is metadata with that, and that is stored in a separate file in the same directory called .hypb. So it's hidden away and it doesn't affect the format of the buffer that it's in. So again, what you see is what you get. You just see the delimiters around the explicit button and that's it. So Hyperbole takes care of all that for you. However, if you embed them into like a mail message, which you can, you can mail buttons, then there is a hidden area at the end of the mail message that encodes the metadata for the explicit buttons. Is it possible to link to a file by its ID, like the node, org ID or some similar unique string inside?- You just made a return on an ID and it
Questions or comments? Please e-mail rsw@gnu.org