Transient As A Hydra

Most every Magit user is, I’m sure, aware that the Magit menuing system has been refactored into a separate library, transient, that is available for anyone to use. I’m dimly aware that some Elisp projects—although I couldn’t name one off the top of my head—are already taking advantage of it. I just stumbled across a case of transient being leveraged in an individual user’s configuration.

Tory Anderson is using transient as a replacement for hydras. Emacs hydras are a package by abo-abo that provides a straightforward way to configure menuing systems in Elisp. They’re easy to set up with a simple description in your Elisp. You can take a look at Anderson’s post to see the code for one of his hydra replacements. I have a hydra that does essentially the same thing and the code looks almost identical.

To me, the interesting thing about Anderson’s post is not a particular hydra replacement nor the particular problem he’s solving but the idea of using transient instead of a hydra. I don’t see any advantage to using transient instead of a hydra and even Anderson says his efforts to replace hydras with transient are mainly a proof of concept. Still, it’s an interesting idea and shows how easy it is to take advantage of the transient library. Anderson has another post on transient and hydras if you’re interested in the idea. That post notes that the transient documentation is available in the Emacs help system as long as Magit is installed.

This entry was posted in General and tagged . Bookmark the permalink.