| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Positional LEVEL is semi-deprecated.
|
|
The existing `transient-option' class is suitable for options passed to
commands. A suffix that uses that class may represent an argument such
as "--option". In the list returned by `transient-args', that argument
and its value, "value", is represented as one element "--option=value".
For "options" that are not passed to a command that is not appropriate.
A caller that wants to extract the value of such an option would have
to parse that string. `transient-arg-value' can help with that, but it
always returns a string (or nil).
The new `transient-cons-option' class provides a more direct way to deal
with "non-command-line options", by representing the key value pair
using a cons-cell (ARGUMENT . VALUE), not just internally, but in
particular when handing it of to a caller. VALUE can have any printable
type and ARGUMENT can have any printable type, expect string.
We cannot use the term "key" because that is already used to the key
binding for the command. Also avoid using "property" because that
implies a property list, while the value returned by `transient-args'
is an alist when all infixes use the `transient-cons-options' class.
Sticking to "argument" also has the advantage, that we don't have to
implement or generalize a dozen methods.
|
|
|
|
|
|
No longer support vectors. This change isn't backward compatible but
I haven't seen a vector being used even just once.
It also makes sense to take inspiration from `keymap-set' et al., which
didn't exist when Transient was created.
However, we continue to be more permissive than those functions, only
insisting on strings understood by `kbd', including strings that do not
satisfy `key-valid-p'. Being more permissive makes it possible, for
example, to write the key binding, which toggles the "-a" command line
argument, as "-a", instead of having to write "- a". Likewise
additional spaces can be added, which are not removed when displaying
the binding in the menu, which is useful for alignment purposes.
|
|
This counters Org commit 39264d3d41213085502dc0c2572f50855ea587a1.
|
|
|
|
|
|
|
|
|
|
In [1: 8daf9890] we started to signal an error instead of merely
showing a message on failure. That was a mistake, see #374.
Add new option `transient-error-on-insert-failure', so users can
opt-in to fatal errors for minor issues.
1: 2025-03-24 8daf9890ee65335a23eebc8919e9cfdd7c7249eb
transient--insert-suffix: Signal error if location is invalid
|
|
|
|
Closes #374.
|
|
|
|
|
|
|
|
|
|
Re #358, but others have made the same mistake before.
|
|
Nowadays we have more explicit pre-commands for prefixes we can
choose from, and don't have to rely on `transient' being unbound.
The documented behavior no longer worked; nil has been a shorthand
for `stack' (itself a shorthand for `transient--do-stack') for a
long time, and leaving the slot unbound meant that the default was
used, which is also `transient--do-stack'.
Now `replace' prevents even "C-g" from returning to the parent, and
`recurse' makes all suffixes of the sub-prefix default to returning
to the parent, not just "C-g".
Closes #356.
|
|
Closes #355.
|
|
|
|
|
|
|
|
|
|
|
|
This is still experimental.
See #340.
(defun third-party-command (arg)
(interactive (list default-directory))
(message "arg: %s -- value: %s" arg default-directory))
(defun demo-in-tmp (fn &rest args)
(let ((default-directory "/tmp/"))
(apply fn args)))
(transient-define-prefix demo ()
:transient-suffix t
[("h" "here" third-party-command)
("m" "in /tmp" third-party-command :advice demo-in-tmp)
("b" "in /tmp (both)" third-party-command :advice* demo-in-tmp)])
|
|
|
|
Also mention the type.
Closes #345.
|
|
|
|
|
|
|
|
|
|
Two examples:
("d" "show magit-status' docstring" transient-describe := magit-status)
("m" "show transient's manual" transient-describe := "transient"
:helper transient--show-manual)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Keep the existing description in "Common Suffix Commands".
|
|
|
|
|
|
|
|
This change lets each transient-prefix display according to its own
display-buffer-action.
Closes #303.
|
|
- Use the `window-preserve-size' window properly instead of the
more aggressive `window-size-fixed' variable, as recommended in
the documentation.
- Delay fixing the size until the window is actually being displayed.
- Add a new option `transient-show-during-minibuffer-read', replacing
`transient-hide-during-minibuffer-read'. This is necessary because
there are now multiple values that show the menu, but in different
ways, which can only be expressed using distinct non-nil values.
- When the user chose that the size should be `fixed', but we know that
won't fly because the menu window uses the full frame height, then
override that choice. This is necessary because it will soon become
possible for an individual prefix to use a different display action,
which may have different needs from the global value the user
optimized for.
- Allow displaying the fixed menu if possible, while also falling back
to not displaying it either at all or while potentially resizing it,
if that is not possible.
Closes #330.
|
|
Replace "also see" with "see also". Before links in the manual that
sadly isn't possible because, if the word before a link is neither
"see" not "in", makeinfo injects "see" before the link. While wrong,
"also see <link>" is still better than "see also see <link>".
|