-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to prepopulate infix arguments on the fly? #89
Comments
Such internal commands can be defined using just |
I can't find |
This was part of the renaming in dd0c44c (Use the package prefix for everything, 2020-05-16). |
Thanks, looks like I'm a few commits behind. I checked out
Where Here is an example of the kind of value I'm trying to set from a preset:
EDIT: Discovered that |
I don't quite understand what you are trying to do. It looks to me like you want the "preset load" command to change the value of a single other command (an infix argument). That seems very strange to me but I am going to assume its the right thing to do.
Why not just: (cl-find-if #'your-predicate transient-current-suffixes) You seem to be looking for: (cl-find-if (lambda (obj)
(eq (oref obj command)
'ffmpeg-dispatch:-r))
transient-current-suffixes) |
Thanks! I was grasping for the
This returns
I'm afraid I might be wandering into an XY problem here. I'm planning to set all infix arguments from a preset list, but was trying just one as a test first. |
Use
Going back to my earlier suggestion: (transient-define-suffix magit-log-an-argument-preset ()
:transient 'transient--do-stay
(interactive)
(oset transient--prefix value '("--patch" "--stat"))
(mapc #'transient-init-value transient--suffixes))
(transient-append-suffix 'magit-log "h"
'("X" "use some argument preset" magit-log-an-argument-preset)) |
I'm looking to do something similar (but slightly different) to this. I'm looking to pre-populate a bunch of infix arguments before I call the transient. Is this possible? |
If that means that you want to set the default value of a transient that you defined yourself, then you can do that using |
Thanks for the reply @tarsius - I was trying to set the value in a lasting way. Turns out I was looking for the (defvar my--build-container nil)
(transient-define-argument my/transient-arg/build-container ()
"Set a lisp variable"
:description "Docker container to use for build"
:class 'transient-lisp-variable
:variable 'my--build-container) This works great. |
I'm writing a transient menu that looks like this:
I would like to be able to select a profile:
And have the other arguments automatically be populated to certain values that I can do minor edits on before running the command. Is there some way to do this? I couldn't find anything relevant in the info manual.
So far I have all options defined using
define-infix-argument
but I'm not sure this is the right way to go about it.The text was updated successfully, but these errors were encountered: