Skip to content
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

Auto-updating checkbox cookies #81

Closed
ourigen opened this issue Sep 9, 2021 · 5 comments
Closed

Auto-updating checkbox cookies #81

ourigen opened this issue Sep 9, 2021 · 5 comments
Labels
core-feature Feature is in orgmode core

Comments

@ourigen
Copy link
Contributor

ourigen commented Sep 9, 2021

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 ourigen added the core-feature Feature is in orgmode core label Sep 9, 2021
@shaunsingh
Copy link
Contributor

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

@lukas-reineke
Copy link
Contributor

lukas-reineke commented Nov 30, 2021

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 🤔

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

Screen Capture_select-area_20211130213612

@kristijanhusak
Copy link
Member

@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.

lukas-reineke added a commit to lukas-reineke/orgmode.nvim that referenced this issue Nov 30, 2021
lukas-reineke added a commit to lukas-reineke/orgmode.nvim that referenced this issue Dec 1, 2021
lukas-reineke added a commit to lukas-reineke/orgmode.nvim that referenced this issue Dec 1, 2021
@mcepl
Copy link
Contributor

mcepl commented Jul 11, 2022

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

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

@jgollenz
Copy link
Contributor

@mcepl see #305

This issue can be closed @kristijanhusak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-feature Feature is in orgmode core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants