| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #287.
|
|
`transient-get-value' was added in [1: d33fe5ab]. At this time it was
only used by commands that save the value. We didn't make a distinction
between `transient--suffixes' and `transient-current-suffixes' at this
time.
In [2: 1b9929ec] the `unsavable' suffix slot was added and this function
started to drop the values of unsavable suffixes.
In [3: 8db5f0fd] we started to also use it to preserve the value across
refreshes. That made it necessary to use `transient--suffixes'. It
would have made sense to only use that variable. Instead we started
to use it, if non-nil, and fall back to `transient-current-suffixes'
otherwise (which previously was used exclusively).
Sometime along the way, package authors started to need the value of
the prefix or of another suffix while setting up the menu and its
suffixes. `transient-args' is not intended for that purpose and I
started to tell them to use `transient-get-value'.
So now `transient-get-value' is being used for at least three distinct
purposes. They have in common that they deal with the value of the
extant prefix (so `transient-args' is not appropriate); but they need
different subsets of that value.
We could deal with that by adding arguments to `transient-get-value'.
Instead we use three different functions, and give them names that
make these differences obvious.
- New `transient--get-savable-value' obviously filters out the non-
savable parts of the value and is obviously used when saving the
value.
- New `transient--get-extended-value' returns the full value. This
includes the parts that are currently inactive, but have to be
preserved because they may become active again. This is used to
preserve the value across refreshes. This also includes unsavable
parts of the value, since we still want to use those parts.
- `transient-get-value' now returns the "effective" value. This
includes the "unsavable" (but "intend for use") parts. It does
not include the "inactive" parts. Keep the current name of this
function because that is being used in third-party package.
Note that while this now filters out the value of suffixes whose
`inapt' slot is non-nil, that doesn't make a difference just yet.
Such suffixes are not being added to `transient--suffixes' yet,
but we will start doing that in a few commits.
In other words, there effectively is no change in how this deals
with inapt parts of the value.
However, the behavior changes with regards to unsavable parts of
the value. Those are no longer dropped. That is a bugfix.
1: 2019-08-12 d33fe5abaf5d0de2a8e80e7e52555d725ebdc6e5
Split new transient-get-value from transient-args
2: 2020-10-20 1b9929eca9b1076fb04794b6736d42a1d394fadb
Add new `unsavable' infix slot
3: 2024-06-22 8db5f0fd4469f3b2af34e07a283372ca273fa685
transient--refresh-transient: Preserve value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|