1. TLDRYour Emacs is full of markup-free hyperlinks embedded in your text, butyou're missing a way to utilize them. Think about a file path in aREADME, a URL in an email, a commit 55a1f0 in a git log, or a functioncall. All of these have a logical referent (a location or action), andyou likely have a good idea of what they should point to. GNUHyperbole's implicit buttons are pattern recognizers that identifydifferent hyperlink buttons in many Emacs contexts. Hyperbole's ActionKey (a single keybinding) then activates such buttons when it ispressed. This post walks through the built-in recognizers, shows how toask Emacs "what will happen if I press the Action Key here?" (C-hA), explains the cascade of Hyperbole's pattern recognizers that picksthe winning action, and demonstrates how to craft your own button typeswith a one-liner (defal), a regular expression (defil), or the fullpower of Lisp (defib).2. About emacs hyperbole implicitButtonsThis is the second post in my series on Hyperbole. The first postintroduced HyWiki, the zero-markup personal wiki, and showed thatHyperbole has almost no adoption burden.That post introduced implicit buttons in passing, because a HyWikiWordis an implicit button. In this post I want to pay closer attention tothe concept, the capability, and the extension API, because the implicitbutton is the mechanism that turns your information into a navigable,actionable hyperverse.3. The Pitch hyperbole implicitButtonsThe text that Emacs displays and edits is already full of hyperlinksthat need to be brought to life. The mechanism to recognize and act onthese hyperlinks is exactly what GNU Hyperbole provides. WithoutHyperbole, these hyperlinks are inert. You probably have a good mentalmodel of what these links might be and what they point to, but you lacka consistent, push-button reflex to act upon them.Hyperbole's Implicit Buttons ship with a very large number ofrecognizers for different types of hyperlinks that are already there inyour text, and allow you to act on them in place, without adding anymarkup or reformatting the buffer. This freedom from markup is whatexpands the reach of implicit buttons and makes them effective inread-only buffers as well.By design, Hyperbole is easy to adopt even if you're integratingthousands of files into a well-used file system. With a few lines ofElisp to install and configure Hyperbole, virtually everything you canopen with Emacs gets automatically hyperlinked; over 40 built-inimplicit button types (and an unbounded number of custom ones) propagatetransparently throughout your system.In other words, Hyperbole brings your text to life!4. Recognizers and Actions hyperbole hypertextAn explicit hyperlink requires markup and time to establish its linkto its referent. For example, an or an [[Org Link]]requires something wrapped in delimiters so that some software knowsit is actionable. By contrast, an implicit button is recognizedsolely from the text provided by the author via natural patterns such asURLs, pathnames, key bindings, etc. Implicit buttons are ordinarypieces of text that already carry their own meaning. Hyperbole authorBob Weiner sums these up as "pattern recognizers across large textcorpuses".(A quick note on terminology: Hyperbole also has its own explicitbuttons, which I will cover in a future post, but this post is entirelyabout implicit buttons, which need no such creation step.)Each implicit button type (ibtype) pairs two things, a recognizerand an action type that are triggered with the press of the Action Key:A recognizer is a predicate that inspects the text around point anddecides whether it matches the pattern.Upon recognition, an action type is combined with parameters,including any text matched by the recognizer, to form an actionthat is fired.John Wiegley, a longtime maintainer of GNU Emacs, frames the division this way1:Hyperbole lifts some of the cognitive burden from Emacs users bydefining an extensible, large set of "recognizers" for various types ofinformational references, and "actions" for doing things with thatinformation, such as visiting referenced documents, or web pages, ordictionary definitions.— John WiegleyI like to think about implicit buttons as a means of navigating theorganic connective tissue that ties together everything my Emacspresides over. A key point for me is that the connections across thisarbitrarily large space of information are already there, asexpressed, without markup. That's what I mean by organic. Hyperboleis a facility for navigating across the edges of this natural, implicitnetwork.Put another way: my mail, my shell output, my code, my notes, and my orgagenda all reference one another frequently. Implicit buttons makethese latent references traversable.There is a deeper point here that I want to emphasize. Most hypertextsystems make you author the relationships between your pieces ofinformation: wrap text in delimiters, maintain both ends of a link,curate a database of connections. Hyperbole inverts that. Becauserecognition happens when you press the Action Key, not when you writethe text, the relationships across your Emacs are an emergentproperty of writing things down the way you naturally would. Ratherthan authoring some formal structural link, you merely have to mentionsomething (a file name, a WikiWord, etc.) or let some other processmention it (a git commit hash, a Python stack trace, etc.), and theconnection to its referent already exists. Hyperbole infers therelationship rather than asking you to hardcode it. To me, this is themost powerful outcome of the implicit button primitive.5. A Tour of the Built-ins hyperbole implicitButtonsHyperbole ships with more than forty ibtypes. Here are some of the mostuseful to me, all activated by the same Action Key (M-RET by default).NOTE: This table is scrollable! Click on it to enable scrolling.If point is on…the Action Key will…WikiWordjump to (or create) its HyWiki page~/.emacs.d/init.elopen the filehbut.el:L2035:C10open the file at line 2035, column 10github@rswgnu or gh@rswgnubrowse the Hyperbole creator's GitHub profilehttps://gnu.orgbrowse the URLmisterchiply@gmail.comemail me!hibtypes.eledit Elisp file in load-path(hkey-either)(in emacs-lisp-mode) jump to definitionrm(1)display the rm man page"(hyperbole)Implicit Button Types"open that node or cross-ref of an Info manuala Python traceback linejump to the offending source linean ERT (Emacs Regression Test) namerun the testan Org link, in any modefollow it as Org wouldcommit 55a1f0 in git log outputdisplay that commit's diff"FAST-DEMO#Implicit Buttons"jump to that section of Hyperbole's fast demoRFC-822download and display the RFC{C-x C-f}execute the key series, as if typedrun the Elisp expression (Action Button)There are also implicit buttons for grep and ripgrep matches, functioncalls, compiler error messages, debugger stack frames, patch hunks,ctags/etags identifiers, Markdown internal links, and many more.Notice how many of these live in program output rather than indocuments. In this way, a shell buffer full of build errors becomes aclickable index into your codebase, a git log becomes a browsablehistory, etc. By recognizing the patterns that already exist in thisoutput, Hyperbole brings this otherwise inert text to life and makes itinteractive.To be fair, Emacs already ships with commands that traverse many ofthe references in this table: org-open-at-point for Org links,find-file-at-point for pathnames, browse-url for URLs,xref-find-definitions for identifiers, man for man pages. WhatHyperbole adds is not raw capability but unification. Without it,you must recognize, in real time, what kind of thing sits under pointand then recall the mode-specific keybinding that follows it. With it,that classification burden moves out of your head and into Hyperbole'srecognizers. A single button-press reflex covers every kind ofreference that ships with Hyperbole, and if there's a reference typethat's missing, you can add one trivially with Hyperbole's extensionsystem. This eliminates a surprising amount of cognitive burden. Youno longer have to do the two-thought dance of recognizing the type ofthing and remembering the key to press to act on it. All you need todo is hit the Action Key.The HyWikiWord, the subject of the previous post, is itself just anibtype (hywiki-word) using the same implicit button machinery. I wantto emphasize this because it is precisely why HyWiki works everywherewith zero markup. HyWiki inherits the reach of the implicit buttonsystem because it is built on that powerful primitive.6. What Will This Keypress Do? emacs hyperboleMost hypertext and knowledge management systems either limit you tobasic links or can't show you what action a hyperbutton will performprior to activating it. Hyperbole is different. You can always seewhat an Action Key press will do in a particular context prior topressing it.How do we know what an implicit button will do before we press it?Luckily for us, Hyperbole is designed in the same spirit as Emacsitself, and can answer this question with introspection.C-h A for hkey-help (the Action Key with a universal prefixargument) displays exactly what the Action Key would do at point: thebutton's type, its parsed attributes, and documentation for the actionabout to run.Figure 1: C-h A on a pathname: the help buffer names the ibtype, shows the parsed label and attributes, and documents the action that M-RET would performIt turns learning Hyperbole into a self-guided exercise. Whenever Inotice something that looks meaningful as an implicit button, I pressC-h A on it, and the implicit button explains itself. No manualrequired (though the manual is excellent). This feature is reallyimportant to me. Emacs behaves this way as well (see my post on howEmacs teaches itself). This is not the only instance of helpfulguidance in Hyperbole: much of its functionality is discoverablevia context menus (run M-x hyperbole and you will see an intuitivemenu that helps you discover your way through all of Hyperbole'sfeatures).7. The Cascade hyperbole implicitButtonsTo anticipate another common question: how does one keybinding handleforty-plus patterns? After all, I tell people that Hyperbole does the'right thing' when you press an implicit button with the Action Key.How does it decide what that 'right thing' is?This is accomplished through an ordered cascade of contexts where thefirst match wins.When you press M-RET, Hyperbole first consults an ordered list ofcontexts (stored in hkey-alist). A few special situations arechecked before buttons, such as completion popups and minibufferprompts, and the mode-specific handlers for Dired, Info, and friends arechecked after them. Then the second stage begins, where Hyperbolebuttons and associated contexts are checked. Each ibtype's recognizerpredicate is run against the text at point, one by one down apriority-ordered list (reverse order of definition), until one matches.The matching type marks the button's label and runs its action.Figure 2: The help buffer for hkey-alist, the variable that determines the implicit button type and actionPriority order is what resolves ambiguity and keeps overlapping patternssane. The rule is that later definitions are checked first.hbut.el:L2035:C10 is both a valid pathname and a validpathname-with-position, but the more specific pathname-line-and-columntype is defined after plain pathname, so it takes precedence and youland on the exact line and column.This priority rule may seem counterintuitive, but it actuallyfacilitates extensibility: any ibtype you define is newer than everybuilt-in, so your recognizers will outrank the built-in ones.8. Buttons by Hand hyperbole implicitButtonsRecognizers in the cascade do most of the work, but you can also placeimplicit buttons deliberately. You simply type out any text that willbe recognized as an implicit button type, and you will find yourselfdoing this more and more as you become better acquainted with Hyperbole.A method I love to use: whenever exactly two windows are open,pressing C-h h i l instantly drops an unnamed implicit link buttonin the selected window that points at wherever point sits in the otherwindow. I reach for that command constantly while browsing thefilesystem. It lets me leave an embedded bookmark, a livecross-reference, in whatever document I happen to be writing.Figure 3: Dropping an implicit link button in a narrative document pointing to the location of point in other-window9. Create Your Own Button Types hyperbole elispYou will get tons of mileage out of the built-in implicit button typesand actions. If you are a power user and want to start defining yourown types through Hyperbole's extension system, this section is for you.Hyperbole exposes button-type creation as a ladder of three macros, inincreasing power. The first two, defal and defil, help you defineimplicit buttons that contain delimiters. The third, and the one I usemost, helps you define implicit buttons for any arbitrary text.Those delimiters deserve a note, because I've mentioned that implicitbuttons need no markup. defal and defil do reintroduce a little(the brackets you wrap around each button) in exchange for letting youcoin your own vocabulary. They remain implicit all the same, becausewhat makes a button implicit is that there is no hidden stored dataassociated with it; all button attributes are computed by Hyperbole atbutton activation time from the text of the button and its associatedtype definition. The action is derived from the text by its type everytime you press the Action Key, never saved per-button the way anexplicit button's attributes are.If these macro names feel recondite, they are actually easy to rememberonce you know what they mean. I explain the mnemonics below.9.1. defal: Define an Action Linkdefal: one line. With Hyperbole active, evaluating this expressiondefines an action link type, activated as , where thetext substitutes into a template:(defal gh-issue "https://github.com/rswgnu/hyperbole/issues/%s")Now in any buffer is a button that browses that issuevia your preferred web browser (using the browse-url package).When defining action link types, the argument after the type name may bea URL, a file path (with optional line and column), or a brace-delimitedkey series.9.2. defil: Define an Implicit Linkdefil: a regular expression. Define an implicit link type fromdelimiters plus a regexp, for patterns living in free text:(defil jira "[" "]" "PROJ-[0-9]+" "https://mycompany.atlassian.net/browse/\\&")After this is defined, every [PROJ-1234] in any buffer is now a livelink into your issue tracker, with \\& (or numbered groups like \\1)splicing the matched text into the target.9.3. defib: Define an Implicit Buttondefib: full Lisp. When the pattern or the action needs logic, youcan write the recognizer yourself with the full power of Elisp. Thebody must call ibut:label-set to mark the button's text, and thenhact to fire an action (which may be a Hyperbole-defined action typeor a regular Elisp function):(defib cve () "When point is within a CVE identifier, display its NVD entry." (let ((case-fold-search nil)) (save-excursion (skip-chars-backward "CVE0-9-") (when (looking-at "CVE-[0-9]\\{4\\}-[0-9]\\{4,\\}") ;; call =ibut:label-set= (ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0)) ;; call =hact= (hact 'www-url (concat "https://nvd.nist.gov/vuln/detail/" (match-string-no-properties 0)))))))Once you evaluate that, every CVE-2024-3094 across your mail, feeds,and source comments becomes a reference to a vulnerability record.9.4. Closing Thoughts on Button CraftingThe set of buttons that you can create with Hyperbole is bounded only byyour imagination. Ramin Honary observes that "you have the power to defineimplicit button types and actions for yourself", and provides usefulexamples: project names that rearrange your windows, dates that openyour calendar, person names that pull up contact info, hashtags thattrigger searches2. John Wiegley explains why thismatters1:We depend on human readers to infer the meaning of references fromcontext all the time. If we say our algorithm implements a red-blacktree, we assume they'll go to Wikipedia or a CS text book if they don'tknow what red-black trees are. It's quite easy to add new,contextually-sensitive recognizers, and actions, so that you can teachEmacs to become more aware of how you use it to manage information.— John WiegleyWhile Hyperbole ships with useful button types, keep in mind that anynotation you already use, in commit messages, tickets, lab notes, orcode review, can become a button with a simple defib macro.10. Try It hyperboleThe install snippet from the first post is all the setup you need. Thenpaste a few lines into *scratch* and press M-RET on each:~/.emacs.d/init.elhttps://www.gnu.org/software/hyperbole/{C-h h d d}"(hyperbole)Implicit Buttons"That third line, a key series button, opens Hyperbole's interactiveDEMO, which is itself a buffer full of implicit buttons to explore. Thesystem demonstrates itself with itself, which is about as Emacsian as itgets. As I like to say, Emacs can teach you more about Emacs than Iever could, and the same is true of Hyperbole.11. Further ReadingThe Implicit Buttons chapter of the Hyperbole manual covers everybuilt-in type and the full defib API. John Wiegley's Using Hyperbole:A Motivation and Ramin Honary's Introduction to Hyperbole, both quotedhere and in the previous post, remain the best independentintroductions.Footnotes: 1 John Wiegley, "Using Hyperbole: A Motivation", lists.gnu.org/archive/html/hyperbole-users/2019-01/msg00037.html. Wiegley is a longtime maintainer of GNU Emacs.2 Ramin Honary, "Introduction to Hyperbole", tilde.town/~raminhal9001/articles/intro-to-hyperbole.html.