| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Emacs commit 60c10b40d5b addresses this issued. That hasn't landed
on master yet (and so the hash is likely to change), so let's copy
the message here:
> Make C-g in command loops consistently invoke quit keybinding
>
> C-g in command loops could unpredictably either signal an error or
> invoke the quit_char keybinding, depending on the relative timing
> of input and redisplay. This change ensures C-g always runs the
> quit_char keybinding by wrapping read_char to check for quit_flag
> after reading input.
For older Emacs versions we have to work around the issue using this
new advice, approximately as suggested by Daniel Colascione at
https://github.com/magit/transient/commit/45fbefdc5b112f0a15cd93657.
The `unreadp' variable is an additional safety net, which should not
be necessary. It would kick in if the unread C-g again causesd quit
to be signaled, or if somehow our transient keymap got disabled,
without this advice also getting disabled.
Also see #388.
|
|
|
|
For class constructors and `clone', if a keyword argument is specified
multiple times, the latter instance wins, which in our case was the
outdated one.
As a result, it was impossible to change the level of a suffix if that
was set inline, in the prefix definition.
Fixes [1: bcc0bf83].
1: 2025-05-16 bcc0bf836808e156262d9ff631be7d91a0ec201d
Improve format of layout and handling of included groups
|
|
|
|
We already call `transient--post-exit', which also takes care of this,
but to be absolutely sure, also reset here and unconditionally (i.e.,
even if `transient--prefix' is nil or `transient--exitp' is `replace').
Before the emergency exit was added, unexpected bugs could look up
Emacs. That does not happen anymore, and we can also rely on it
to guarantee quitting is enabled again.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #334.
|
|
|
|
|
|
|
|
|
|
In [1: 1b7f9be7] we intentionally started signaling an error in
`transient-suffix-object' if no object can be determined, to learn
whether there actually are any callers for which it actually make
sense to return nil instead.
Now we know about one, but I am still not sure whether that should
be a valid use-case, so we keep the error for now, but ignore the
error in this one case.
Closes #337.
1: 2024-11-02 1b7f9be7b9fbc8acb5d71f028b19e1f78d9dd090
transient-suffix-object: Drop faulty fallback behavior
|
|
|
|
|
|
|
|
|
|
- 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.
|
|
[1: d0cba152] failed to take into account that this function is also
useful when setting up a prefix, in which case it should be called
without an argument.
Also clarify that the argument should be used when this function is
called from a suffix command.
1: 2024-11-22 d0cba152dc708b1cf9028539ac5204469057027b
transient-scope: Add PREFIX argument
|
|
It is desirable to set `window-size-fixed' to t in the transient menu,
as we always used to do, until very recently.
We cannot do this when the transient window uses the full height of the
frame, the minibuffer may be used while the menu remains displayed, and
the height of the minibuffer has to be increased so that the completion
framework can display completion candidates.
If `transient-hide-during-minibuffer-read' is t [1], then that cannot
happen, so we fix the size in that case again.
[1] Which is the default, starting with the parent of this commit.
Re #532.
|
|
That way the menu is consistently hidden during all minibuffer usage
by suffix commands, *including* when setting infix arguments.
Beside the increased consistency, this is beneficial for large menus
(such as `magit-log') in combination with completion setups that
immediately show a set of completion candidates. In such cases there
could be very little space left to display anything beside the menu
and the completion candidates.
Additionally this helps to avoid an incompatibility when displaying the
menu using the full frame height. See the next commit for details on
that.
|
|
Run it before populating the buffer but after setting buffer-local
variables, to allow user hooks to override our default values for
these variables.
|
|
|
|
|
|
|
|
|
|
|
|
|