magit-todos icon indicating copy to clipboard operation
magit-todos copied to clipboard

Feature request: add a magit popup

Open zhaojiangbin opened this issue 6 years ago • 12 comments

As per discussion at the end of issue #11.

Some ideas of what a popup would be good for:

  • call magit-todos-update (i.e. an action)
  • toggle the grouping and sorting options,
  • add/remove keywords,
  • list of path globs to scan,
  • filter found items by extra prefix or suffix patterns to found keywords (for example: "FIXME: yourname - validate input").

If the popup can save changed settings (in dir-local variables, for example), it will support settings per-repository. This can benefit users who have multiple repositories.

zhaojiangbin avatar Jul 03 '18 04:07 zhaojiangbin

Thanks. I'm keeping an eye on https://github.com/magit/transient and I've asked Jonas whether we should use magit-popup or wait for transient to mature (assuming IIUC and it's the intended future solution).

alphapapa avatar Jul 03 '18 04:07 alphapapa

We probably need to use transient or magit-popup, but https://github.com/abo-abo/hydra/blob/master/hydra-ox.el might also be useful.

alphapapa avatar Jul 04 '18 03:07 alphapapa

Sorry for having been MIA. Occupied by work.

I've asked Jonas whether we should use magit-popup or wait for transient to mature (assuming IIUC and it's the intended future solution).

There is nothing urgent for this feature request. It won't hurt to wait for the fundation to settle down.

but https://github.com/abo-abo/hydra/blob/master/hydra-ox.el might also be useful.

Hydra is awesome. I have quite a few in my own Emacs init code. But would you think using a hydra here is going to feel a bit "foreign"? Or am I misunderstanding you?

zhaojiangbin avatar Jul 07 '18 05:07 zhaojiangbin

Sorry for having been MIA. Occupied by work.

Not at all. We all do this in our spare time.

There is nothing urgent for this feature request. It won't hurt to wait for the fundation to settle down.

Yeah, I'm thinking that if he plans to "finish" transient in, say, the next 3 months, we might as well wait.

Hydra is awesome. I have quite a few in my own Emacs init code. But would you think using a hydra here is going to feel a bit "foreign"? Or am I misunderstanding you?

I'm not sure what you mean. Hydra works similarly in that it presents a menu of choices that remains visible until certain actions are taken.

alphapapa avatar Jul 07 '18 08:07 alphapapa

By "foreign", I meant that hydra has a different "look and feel" than the magit UI, say, magit-popup. Otherwise I am sure hydra will be capable of doing all things we talked about here.

Had this package not started a section in magit status buffers, hydra would be a perfect fit. I am not sure if you are thinking of making this package not to depend on magit. If you do, it's understandable for the technical merits. I can also imagine that it will make the package available to more users such as those who don't use git or magit.

Being a programmer who pretty much lives by git and magit, I see magit-todos as a great add-on to magit for managing technical debt in software repos. Whenever I am in a magit status buffer, the TODOs section reminds me that. More importantly I use the TODOs section in the same way I use other magit sections.

zhaojiangbin avatar Jul 08 '18 17:07 zhaojiangbin

I only meant that Hydra might be an easier way to implement a popup, but I'm not sure if it's even capable of doing what we need. I have no plans to make this not depend on Magit. Most of what it does is integrate with Magit, otherwise it's little more than M-x grep. :)

I see magit-todos as a great add-on to magit for managing technical debt in software repos.

That's exactly what I was aiming for. :)

alphapapa avatar Jul 08 '18 17:07 alphapapa

Somewhere else you asked whether you should wait for transient. My first impulse was no, but reading further I wasn't so sure anymore. Setting variables using magit-popup is one of the features that require more hand written code than just actions and arguments and I do plan to handle that better in transient. On the other hand it isn't that hard either, see magit-pull-and-fetch-popup for an example.

tarsius avatar Jul 12 '18 20:07 tarsius

And other popups that use :variables too. These other popups are a bit more complicated in that they are not defined using magit-define-popup (due to additional but unrelated complications) and you will just have to pretend that that isn't the case when looking at them for inspiration, that macro should be sufficient in your case.

tarsius avatar Jul 12 '18 20:07 tarsius

@tarsius Thanks, Jonas. Do you have any kind of timeframe in mind for transient? And do you expect magit-popup to remain usable to any extent after Magit switches to transient?

alphapapa avatar Jul 12 '18 21:07 alphapapa

"Soon" and yes.

tarsius avatar Jul 12 '18 23:07 tarsius

Thanks, Jonas. I think I'll plan to implement this with transient, but I may study some of the code you mentioned in the meantime.

alphapapa avatar Jul 12 '18 23:07 alphapapa

transient is now released, so this could be added.

If anyone is reading this, please let me know what actions and options you think the popup should have.

alphapapa avatar May 07 '19 10:05 alphapapa