6.2 Comparison With Other Packages

Magit-Popup

Transient is the successor to Magit-Popup (see (magit-popup)Top).

One major difference between these two implementations of the same ideas is that while Transient uses transient keymaps and embraces the command-loop, Magit-Popup implemented an inferior mechanism that does not use transient keymaps and that instead of using the command-loop implements a naive alternative based on read-char.

Magit-Popup does not use classes and generic functions and defining a new command type is near impossible as it involves adding hard-coded special-cases to many functions. Because of that only a single new type was added, which was not already part of Magit-Popup’s initial release.

A lot of things are hard-coded in Magit-Popup. One random example is that the key bindings for switches must begin with - and those for options must begin with =.

Hydra

Hydra (see https://github.com/abo-abo/hydra) is another package that provides features similar to those of Transient.

Both packages use transient keymaps to make a set of commands temporarily available and show the available commands in a popup buffer.

A Hydra “body” is equivalent to a Transient “prefix” and a Hydra “head” is equivalent to a Transient “suffix”. Hydra has no equivalent of a Transient “infix”.

Both hydras and transients can be used as simple command dispatchers. Used like this they are similar to regular prefix commands and prefix keys, except that the available commands are shown in the popup buffer.

(Another package that does this is which-key. It does so automatically for any incomplete key sequence. The advantage of that approach is that no additional work is necessary; the disadvantage is that the available commands are not organized semantically.)

Both Hydra and Transient provide features that go beyond simple command dispatchers:

Both packages make it possible to specify how exactly the available commands are outlined: