* Oas: a small addon to Org Mode to automatically close tasks with statistics
@ 2019-08-30 21:09 Andrea Giugliano
2019-09-01 5:41 ` Adam Porter
2019-10-07 2:03 ` stardiviner
0 siblings, 2 replies; 3+ messages in thread
From: Andrea Giugliano @ 2019-08-30 21:09 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
Hi,
I recently landed on this conversation:
https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00802.html
Since I find myself quite often in a situation like the following:
* TODO abc [3/3]
- [X] a
- [X] b
- [X] c
I decided to dive more into Org's API, and I created this library [0] to
automatically moving that task to DONE. My library checks that when you
are in a situation like:
* TODO abc [1/1]
- [X] a
** TODO b
the parent task does not swap to DONE because there is still a sub-task
to complete.
Tasks that have heading like
* abc [0/1]
or
* TODO abc
do NOT get updated, because I want this to work only for TODO that have
statistics.
How could I propose this as an add-on of Org Mode? Do you think it is
worth the effort?
Any feedback is very welcome to learn more :)
Best,
Andrea
[0] https://github.com/ag91/org-active-statistics
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Oas: a small addon to Org Mode to automatically close tasks with statistics
2019-08-30 21:09 Oas: a small addon to Org Mode to automatically close tasks with statistics Andrea Giugliano
@ 2019-09-01 5:41 ` Adam Porter
2019-10-07 2:03 ` stardiviner
1 sibling, 0 replies; 3+ messages in thread
From: Adam Porter @ 2019-09-01 5:41 UTC (permalink / raw)
To: emacs-orgmode
Hi Andrea,
This is a nice idea. Here are a few notes:
1. You should implement it as a minor mode, and enable/disable the
hooks there.
2. I would generally recommend using org-element to help with parsing.
It will make your code much cleaner and easier to understand. Much of
the searching code you currently have is unidiomatic and hard to follow,
and org-element will help with that.
3. Avoid using hard-coded to-do keywords, because users may be using
custom ones. Instead, use the variables and functions provided by Org
that are related to to-do keywords. Use tools like apropos, Helm, or
Counsel, or the Org source code, to help discover them.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Oas: a small addon to Org Mode to automatically close tasks with statistics
2019-08-30 21:09 Oas: a small addon to Org Mode to automatically close tasks with statistics Andrea Giugliano
2019-09-01 5:41 ` Adam Porter
@ 2019-10-07 2:03 ` stardiviner
1 sibling, 0 replies; 3+ messages in thread
From: stardiviner @ 2019-10-07 2:03 UTC (permalink / raw)
To: emacs-orgmode
Interesting addon, I like this idea. :)
I remember Org Mode has a similar option (can't figure out the option name). And
also have some similar solution like this. Just they are depend on "task
dependencies".
I want to add some hooks on your code, but found this code is hard to read. I
agree Adam's advice, better to use ~org-element~ API to do parsing.
Andrea Giugliano <agiugliano@live.it> writes:
> Hi,
>
> I recently landed on this conversation:
> https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00802.html
>
> Since I find myself quite often in a situation like the following:
>
> * TODO abc [3/3]
> - [X] a
> - [X] b
> - [X] c
>
> I decided to dive more into Org's API, and I created this library [0] to
> automatically moving that task to DONE. My library checks that when you
> are in a situation like:
>
> * TODO abc [1/1]
> - [X] a
>
> ** TODO b
>
> the parent task does not swap to DONE because there is still a sub-task
> to complete.
>
> Tasks that have heading like
>
> * abc [0/1]
>
> or
>
> * TODO abc
>
> do NOT get updated, because I want this to work only for TODO that have
> statistics.
>
> How could I propose this as an add-on of Org Mode? Do you think it is
> worth the effort?
>
> Any feedback is very welcome to learn more :)
>
> Best,
>
> Andrea
>
> [0] https://github.com/ag91/org-active-statistics
--
[ stardiviner ]
I try to make every word tell the meaning what I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-07 2:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-30 21:09 Oas: a small addon to Org Mode to automatically close tasks with statistics Andrea Giugliano
2019-09-01 5:41 ` Adam Porter
2019-10-07 2:03 ` stardiviner
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).