6

Many commands that are rarely used in magit are hidden by default. Magit uses the transient.el library for popups and the visibility of infix and suffix commands are controlled by transient-default-level.

For example: At the default level (4), magit-branch transient 1 hides orphan, worktree, and shelving suffix commands (levels 6,5,&7 respectively).

I want to invoke the "new orphan" command, but I don't want to persist the visibility of that command or other commands (even for the remainder of the current session).

How can I conveniently change the default transient level temporarily, so that I can invoke a hidden command once?

The two ways I know of are:

  1. Change the transient level for the command using C-xl (transient-set-level), invoke it, and then change it back.

  2. Change transient-default-level programmatically (ex: (setq transient-default-level 6)), invoke the command, and change transient-default-level back.

screenshot of magit-branch transient after calling transient-set-level

Drew
  • 75,699
  • 9
  • 109
  • 225
ebpa
  • 7,319
  • 26
  • 53

1 Answers1

10

I [as the author of this package] did not consider this feature but it sounds potentially useful and doable but it doesn't exist yet. I've added this idea to my TODO list but for now you'll have to stick to your workarounds. I am not aware of any existing solution.

As of August 2021 this feature still does not exist.

tarsius
  • 25,298
  • 4
  • 69
  • 109
  • Please turn this into a more helpful answer. E.g., confirm that there's currently no solution other than the workarounds, or provide a solution. Otherwise, this is essentially a comment on the question (and should in that case be deleted). Thx. – Drew Aug 21 '21 at 16:58
  • 4
    I am the author of this package. There is absolutely no additional information I want to provide than this: (1) this feature does not exist (2) I do consider this a reasonable feature and (3) have taken note of the idea but (4) make no promise at all. I also do not at all appreciate your request to make this more "useful" and think there are much more useful uses for your and my time. – tarsius Aug 21 '21 at 18:25
  • 2
    I would recommend you don't delete this. The answer may be very short but it is also complete and I am the authority on the matter. The answer may not be satisfying but it also states the facts in full. I think that this unsatisfying but complete answer is vastly more useful than no answer at all. Or an answer that has a few added paragraphs added to it for fluff and to more easily pass your critical eyes. – tarsius Aug 21 '21 at 18:35
  • 2
    You note that I find this really quite annoying. I hope it isn't the final straw that pushes me away from this platform because then most magit questions would go unanswered. Job well done Drew. – tarsius Aug 21 '21 at 18:36
  • *Sheesh.* All I suggested was that you make clear what you've now confirmed. That's a fine answer to the question, IMO: the feature doesn't exist yet. And what you said in your first paragraph is additionally helpful (but it didn't answer the question, IMHO). I didn't vote to delete your answer and I had no intention of doing so. I was letting you know that some might vote to do that. I'm aware that you're the authority, which means you can give an authoritative answer, as you've now done: no solution yet (but it's on your todo list). That's exactly what the OP asked. +1, and thanks. – Drew Aug 21 '21 at 21:17
  • @Drew Was "currently no solution" really hard to tell from the existing answer? And if so, could you perhaps have edited the answer yourself? – Dmitry Aug 22 '21 at 21:38
  • 1
    @Dmitry: Yes. Q&A should stand on their own; comments can be deleted at any time. Nothing in the answer even made it clear that Tarsius is the author of the library. Finding this Q&A, a reader wouldn't have a clear answer that what was requested isn't possible (yet). The answer said only that the answerer never considered finding a solution but thought it was doable and might try to do it sometime. That's not an answer. Saying that it can't be done (currently) is at least an answer to the question of how to do it. There are lots of answers like that. I tried to help tarsius answer, himself... – Drew Aug 23 '21 at 01:03
  • Q&A aren't just for the OP. They help lots of Emacs users. Most Q&A are found by googling. No one should assume that all readers know who Tarsius is, and so would interpret "I did not consider..." the way you & I might, as implying there's no solution, because we recognize the name. If a random user had written that answer perhaps you'd agree that it wouldn't be too clear. Even if you wouldn't, that was my judgment, enough to write a comment that I hoped would help him clarify the answer. The reaction was over the top, IMO. See my many edits & comments here. I'm trying to help everyone. – Drew Aug 23 '21 at 01:10
  • And no, I don't consider the time I spend trying to improve Q&A here to be a waste of time ("there are much more useful uses for your and my time"). – Drew Aug 23 '21 at 01:14
  • I really don't understand all the uproar. I only offered a comment, and only to help. I didn't downvote the answer, or vote to close it, or condemn or denigrate it in any way. The reaction seems a bit hysterical. In fact, I've never seen such a reaction here, to any comment. *"The final straw that pushes me away from this platform"* Really? What were the other straws? Was I responsible for them too? – Drew Aug 23 '21 at 01:49
  • Yeah, it probably was a bit of an overreaction. IMO all the information that I have now added to the A or the comments were already strongly hinted at in the original A, but you are right many other readers might miss those hints. I also answer a lot of answers and unlike you apparently I don't particularly like it. Often Q are sloppy and I feel my A are allowed to be too occasionally. Well and then you came in on a bad day and say "no". Of course you are right A should be as good as they can but on this platform at least this means that no A can be sloppy but good enough. – tarsius Aug 23 '21 at 07:37
  • I have been providing the good answers to the magit Q here for a few years now. Going for 0% unanswered. A few months ago I gave up. A lot of Q (not this one) show a lack of research and after a few years of providing "good" A to such "bad" Q, I cannot do it anymore. So I have basically stopped doing it and the unanswered Q are spiking since. Maybe if I could throw in sloppy A occasionally, when I don't feel like being the one who does all the work, then I might do that. But here I am not allowed to do that. – tarsius Aug 23 '21 at 07:42
  • For me it occasionally it boils down to providing a short, likely incomplete answer, or non at all. I realize that is in conflict with the ideals on this platform. I applaud you for sticking to those ideals, I really do. Just when you are moderating then I would suggest you consider who you are talking to. You must know that I, for example, provide a lot of good, extensive answers. Maybe if you occasionally run into a bad one anyway, then just let it go. We will never reach 100% good answers and you know that I know how to provide a good answer. Maybe just let the few bad ones slip. – tarsius Aug 23 '21 at 07:49
  • The other straws? I don't think it is healthy for people like me (with a ocd tendency) to spend time here. The platform seem intentionally engineered to addict certain people. All for the greater good of course, but still by abusing people to do most of the work. The final straw? Being told that living up to the ideal most of the time but then letting slip one occasionally is not okay. – tarsius Aug 23 '21 at 07:53
  • So nothing against you. If you enjoy the valuable work you are providing hear, then great! It provides a lot of value. But maybe cut back on moderating answers. Educating people on how to provide good Q&A can be beneficial and improve future posts, but it can also backfire when someone already knows the ideals but chose to ignore them due to mental exhaustion. – tarsius Aug 23 '21 at 08:00
  • 1
    I realize that in other contexts I am doing what you are doing here and when I do, then I feel justified in doing so. So I should not be so critical of you here. We have used many words here and at least when I spoke not all of them were chosen carefully. IMO we can stop now. I am not hurt or anything and I hope you are not either. I was annoyed but that happens. I hope that one day I will learn to just shut up when someone annoys me on the internet. Unless one *very* carefully expresses why one is annoyed, the result always is that the other person also feels annoyed/misunderstood/hurt/... – tarsius Aug 23 '21 at 12:12
  • IMHO "there is no way to do this right now", without a suggestion for alternative solutions or [better] workarounds, even if it's coming from the package's author, is not an answer, and should not be posted as such. The question, as it is, remains unanswered, and it should be considered by this website as such. That may encourage people to look for unanswered questions about this package and to research / develop solutions (as patches or addons to the package in question). So, I think this answer should be converted into a comment, but tarsius seems to feel very strongly about this, so... – Vladimir Panteleev Aug 25 '21 at 12:59
  • A possible improvement for this particular case would be to extract the workarounds posted by the question author from the question and into a community-wiki answer, as, currently, they are the best answer to this question right now (as confirmed by tarsius). – Vladimir Panteleev Aug 25 '21 at 13:04