orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Auto-updating checkbox cookies

Open ourigen opened this issue 4 years ago • 4 comments

Does this feature exist in Emacs orgmode core?

Yes

Orgmode link

https://orgmode.org/manual/Checkboxes.html

Feature value

No response

Additional context

Would it be possible to have auto-updating checkbox cookies such that checking off an item in a list updates the progress? More specifically, say I have this task tree:

* My project [/]
- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

Checking off Task 1 by keybind will update the cookie

* My project [1/3]   <- cookie updated to number of items in tree
- [x] Task 1
- [ ] Task 2
- [ ] Task 3

And checking off Task 2 will automatically increment the cookie

* My project [2/3]   <- number of item completed updated
- [x] Task 1
- [x] Task 2
- [ ] Task 3

ourigen avatar Sep 09 '21 01:09 ourigen

It would be nice to have this for percent's too! In emasc, checking off 1/3 is [33%], 2/3 is [66%] etc.

shaunsingh avatar Sep 14 '21 02:09 shaunsingh

I built a working POC for this. I can make a proper PR, but I am not sure where in the code it would make sense to add :thinking:

I use treesitter to get all cookies, then calculate the progress and display it with virtual text

Screen Capture_select-area_20211130213612

lukas-reineke avatar Nov 30 '21 12:11 lukas-reineke

@lukas-reineke you can either put it in the lua/orgmode/org/syntax.lua and call it the same way other things are called from that file, or you can even create a new file in that folder if there's a lot of code. Feel free to open up a PR and we can discuss it.

kristijanhusak avatar Nov 30 '21 12:11 kristijanhusak

This should work also for subtree. E.g., this should work:

** TODO my task [/]
*** TODO which has a subtask

mcepl avatar Jul 11 '22 07:07 mcepl

@mcepl see #305

This issue can be closed @kristijanhusak

jgollenz avatar Feb 25 '23 23:02 jgollenz