

GitHub - magit/transient: Transient commands
source link: https://github.com/magit/transient
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
Transient commands
Taking inspiration from prefix keys and prefix arguments, Transient implements a similar abstraction involving a prefix command, infix arguments and suffix commands. We could call this abstraction a "transient command", but because it always involves at least two commands (a prefix and a suffix) we prefer to call it just a "transient".
Transient keymaps are a feature provided by Emacs. Transients as implemented by this package involve the use of transient keymaps.
Emacs provides a feature that it calls "prefix commands". When we talk about "prefix commands" in Transient's documentation, then we mean our own kind of "prefix commands", unless specified otherwise. To avoid ambiguity we sometimes use the terms "transient prefix command" for our kind and "regular prefix command" for Emacs' kind.
When the user calls a transient prefix command, then a transient
(temporary) keymap is activated, which binds the transient's infix and
suffix commands, and functions that control the transient state are
added to pre-command-hook
and post-command-hook
. The available
suffix and infix commands and their state are shown in the echo area
until the transient is exited by invoking a suffix command.
Calling an infix command causes its value to be changed. How that is done depends on the type of the infix command. The simplest case is an infix command that represents a command-line argument that does not take a value. Invoking such an infix command causes the switch to be toggled on or off. More complex infix commands may read a value from the user, using the minibuffer.
Calling a suffix command usually causes the transient to be exited; the transient keymaps and hook functions are removed, the echo area no longer shows information about the (no longer bound) suffix commands, the values of some public global variables are set, while some internal global variables are unset, and finally the command is actually called. Suffix commands can also be configured to not exit the transient.
A suffix command can, but does not have to, use the infix arguments in
much the same way it can choose to use or ignore the prefix arguments.
For a suffix command that was invoked from a transient the variable
current-transient-suffixes
and the function transient-args
serve about
the same purpose as the variables prefix-arg
and current-prefix-arg
do
for any command that was called after the prefix arguments have been
set using a command such as universal-argument
.
Recommend
-
114
Ghub — Client libraries for the APIs of various Git forges Ghub provides basic support for using the APIs of various Git forges from Emacs packages. Originally it only supported the Github REST API, but now it also supports the Githu...
-
135
Git Config Modes Emacs major modes for various Git configuration files. The list of contributors can be found here. The following libraries...
-
98
GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 79 million projects.
-
214
README.org
-
82
-
72
README.md magit-org-todos Get todo.org into your magit status. If you have a todo.org file with TODO items in the root of your repository, ma...
-
80
README.md Work with Git forges from the comfort of Magit Work with Git forges, such as Github and Gitlab, from the comfort of Magit and the rest of Ema...
-
36
README.md Unmaintained I never used this package myself and no longer want to maintain it. I might still fix bugs but all feature requests will be clos...
-
25
README.md This Emacs package provides a minor mode which configures Magit to use
-
7
Link to Magit buffers from Org documents This package defines several Org link types, which can be used to link to certain Magit buffers. Use the command org-store-link while such a buffer is current to store a link. L...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK