-
-
Notifications
You must be signed in to change notification settings - Fork 66
Home
Welcome to the Transient wiki!
- Transient User and Developer Manual
- (TODO) Tutorial
- FAQ and more FAQ
- Users are encouraged to add to the Tips and Tricks wiki page.
Complexity tends to grow with time. How do you manage the complexity of commands? Consider the humble shell command ls
. It now has over fifty command line options. Some of these are boolean flags (ls -l
). Some take arguments (ls -l --sort=s
). Some have no effect unless paired with other flags (ls -lh
). Some are mutually exclusive (ls -ltc
). Some shell commands even have so many options that they introduce subcommands (git branch
vs. git commit
), each with their own rich set of options (git branch -f
).
What about Emacs commands used interactively? How do these handle setting options? One solution is to make many versions of the same command, so you don’t need to! Consider: delete-other-windows
vs. delete-other-windows-vertically
(among many similar examples!). Some Emacs commands will simply prompt you for the next “argument” (M-x switch-to-buffer
). Another common solution is to use prefix arguments, which usually start with C-u
. Sometimes these are sensibly numerical in nature (C-u 4 M-x forward-paragraph
). But sometimes they function instead as boolean “switches” (C-u C-SPACE
to jump to the last mark instead of just setting it, C-u C-u C-SPACE
to unconditionally set the mark). Since there aren’t many standards for the use of prefix options, you have to read the command’s documentation to find out what the possibilities are.
But when an Emacs command grows to have a truly large set of options and arguments, with dependencies between then, lots of option values, etc., these simple approaches just don’t scale. Transient is designed to solve this issue. Think of it as the humble prefix argument C-u
, raised to the power of 10. Like C-u
, it is key driven. Like the shell, it supports boolean “flag” options, options that take arguments, and even “sub-commands”, with their own options. But instead of searching through a man page or command documentation, well-designed transients guide their users to the relevant set of options (and even their possible values!) directly, taking into account any important pre-existing Emacs settings. And while for shell commands like ls
, there is only one way to “execute” (hit Return
!), transients can “execute” using multiple different keys tied to one of many self-documenting actions (imagine having 5 different colored return keys!). Transients make navigating and setting large, complex groups of command options and arguments easy. Fun even. Once you’ve tried it, it’s hard to go back to the C-u what can I do here again?
way.
- Conquering Kubernetes with Emacs Adrien Brochard talks about how to integrate the Kubernetes client into an Emacs workflow. The key takeaways have little to do about Kubernetes itself, but rather focus on the design and implementation of an integration between two complex systems: from how to deal with async sub-processes, defining an appropriate major mode, to proposing a modern and intelligent user experience. https://gist.github.com/abrochard/dd610fc4673593b7cbce7a0176d897de#modern-ux
- Transient API Example (Alternative Bindings Part 1)
The wiki is released under the same terms as the code.
This wiki is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.