Next: , Previous: , Up: Usage   [Contents][Index]

2.4 Saving Values

After setting the infix arguments in a transient, the user can save those arguments for future invocations.

Most transients will start out with the saved arguments when they are invoked. There are a few exceptions, though. Some transients are designed so that the value that they use is stored externally as the buffer-local value of some variable. Invoking such a transient again uses the buffer-local value. 1

If the user does not save the value and just exits using a regular suffix command, then the value is merely saved to the transient’s history. That value won’t be used when the transient is next invoked, but it is easily accessible (see Using History).

C-x s (transient-set)

This command saves the value of the active transient for this Emacs session.

C-x C-s (transient-save)

Save the value of the active transient persistently across Emacs sessions.

C-x C-k (transient-reset)

Clear the set and saved values of the active transient.

User Option: transient-values-file

This option names the file that is used to persist the values of transients between Emacs sessions.



magit-diff and magit-log are two prominent examples, and their handling of buffer-local values is actually a bit more complicated than outlined above and even customizable.