Using Transient For Isearch

Charles Choy has another great post documenting his never ending quest to make Emacs behave exactly the way he wishes. This post is about using Transient to call isearch.

Virtually every Emacs user knows about isearch. It’s the fundamental say of searching for strings in an Emacs buffer. But isearch is actually a complicated command with many subcommands, many of which the average user doesn’t know about. That’s bad enough but, as Choi says, the shortcut bindings for those commands are obscure in the extreme.

What to do? My solution for this sort of thing is to put together a hydra. I have several hydras that do exactly this sort of thing, although not for isearch. But there’s a new kid in town. Since Emacs 29.1 the Transient library from Magit is built into Emacs and it can provide an equivalent solution to that provided by hydra. To the end user, the two solutions look the same: you get a menu with the various choices from which you can select your desired action.

I’m completely agnostic on which solution is better. To me, they seem equivalent but I’ve seen more than one post or comment claiming that the poster never liked hydras. These claims are never accompanied by an explanation so I don’t know if they’re simple prejudice or supported by sound reasoning.

Regardless, Choi gives the code for his Transient implementation of an isearch menu so if you’re interested in a solution to the isearch complexity problem, take a look a Choi’s post.

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