Replies: 3 comments
|
Great feedback! I totally agree we should clarify this in the docs and I'll see what I can do about this. |
0 replies
|
Awesome! Great improvement, thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I recently upgraded to Projectile 3, and the migration guide https://docs.projectile.mx/projectile/upgrading_to_projectile_3.html has this to say:
This is great, but rather lacking on details about how exactly to use transient-append-suffix to amend projectile-dispatch.
My original code was:
It took me quite a while to figure out that this was what I had to replace it with:
In particular:
projectile-dispatchtoPREFIXoftransient-append-suffix. I could make a guess, but the Projectile docs callprojectile-dispatcha "menu", not a "prefix" or "command".LOCoftransient-append-suffix. The previous code didn't have any such argument, it just added a new keybinding. Once I figured out I needed to specify an existing transient command in the same menu, it took some guessing to figure out that it should be another keybinding as a string, instead of (for example) one of the heading names shown intransient-define-prefix. I also had to figure out that I needed to use a different functiontransient-insert-suffixif I wanted to put my entry at the beginning instead of at the end.transient-insert-suffixout of the box at all, because Projectile seems to be defining the transient menu dynamically, using theprojectile--dispatch-definehelper. By default, you get an error when trying to usetransient-insert-suffix. So I had to manually callprojectile--dispatch-defineafter loading Projectile, which seems wrong. That didn't work either out of the box because Projectile doesn't load Transient until afterprojectile-dispatchis called, so I also had to load Transient manually, too. Maybe there is a hook I am supposed to run these customizations on? I didn't see one mentioned in the migration guide.It would be really helpful if the migration guide included concrete before-and-after examples on replacing
def-projectile-commander-methodwith Transient commands.All reactions