Replies: 1 comment 1 reply
-
The code you are quoting was an experiment by someone else. I am not sure to what extend it was expected to work back then. If some part of it doesn't work now, it probably also didn't work then. It would be easier for me to help, if you described what you are trying to achieve. Depending on what you want to do, maybe this is all you need: (transient-define-prefix demo ()
[("-a" "Arg" "--arg")
("-b" "Bar" "--bar")
("s" "Submenu" demo-sub)
(transient-echo-arguments)])
(transient-define-prefix demo-sub ()
[("-a" "Arg" "--arg")
("-b" "Bar" "--bar")
(transient-echo-arguments)]
(interactive)
(transient-setup 'demo-sub nil nil :value (transient-args 'demo))) Note that once you have called Here we deal with that by calling |
Beta Was this translation helpful? Give feedback.
-
I'm currently working with transient version 0.7.7 (fc03c0b) and looking to access the infix values from a parent prefix within a sub-prefix without saving the parent prefix first. I've read this relevant issue, but it seems the behavior discussed there has changed.
Here’s a revised example based on the original post:
When pressing
a
within the sub-prefix, I expectedtransient-toys--msg-parent-args
to print the infix values set in the parent prefix when the switch option is enabled, which happened according to the original post. However, it doesn’t print the expected values when I tried it. After some investigation, I noticed in the documentation fortransient-args
that it mentions the following:This leads me to believe that the observed behavior may be expected due to the change in how transient-args works since the original post.
I then modified
transient-toys--msg-parent-args
to usetransient-current-command
instead of'transient-toys-wave-parent
directly and added some debug messages:In this case, since
transient-toys--msg-parent-args
is invoked withtransient--do-stay
, I expectedtransient--export
not executed, sotransient-current-command
would still be the parent. However, it appears that callingtransient-toys--msg-parent-args
resetstransient-current-command
tonil
in the sub-prefix rather than preserving the initial command context.Questions:
transient-args
?transient-args
doesn't seem to work. Is there an approach to pass infix values from a parent prefix to a sub-prefix, allowing access to them in the sub-prefix without saving the parent prefix?Thank you for any insights or clarifications regarding this behavior!
Beta Was this translation helpful? Give feedback.
All reactions