* "DONE" all subtasks recursively
@ 2011-07-18 18:30 Marcelo de Moraes Serpa
2011-07-20 15:41 ` Marcelo de Moraes Serpa
0 siblings, 1 reply; 5+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-07-18 18:30 UTC (permalink / raw)
To: Org Mode
[-- Attachment #1: Type: text/plain, Size: 404 bytes --]
Hey guys
If I have a headline with children, like this:
* Project
** TODO Task
** TODO Task
** SubProject
*** TODO Task
*** TODO Task
Does org have any functionality that allows me to automatically close
(Change TODO->DONE, put DONE when TODO is not available (in the case of
Projects)) automatically and recursively for each child if I close the main
parent headline?
Thanks in advance,
- Marcelo.
[-- Attachment #2: Type: text/html, Size: 645 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "DONE" all subtasks recursively
2011-07-18 18:30 "DONE" all subtasks recursively Marcelo de Moraes Serpa
@ 2011-07-20 15:41 ` Marcelo de Moraes Serpa
2011-07-21 8:49 ` Aankhen
2011-07-22 2:59 ` Bernt Hansen
0 siblings, 2 replies; 5+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-07-20 15:41 UTC (permalink / raw)
To: Org Mode
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
*bump*
Hey guys, if someone could guide me a hint on where I should look to hack
some elisp code in order to do that, I'd be grateful ;)
Cheers,
Marcelo.
On Mon, Jul 18, 2011 at 1:30 PM, Marcelo de Moraes Serpa <
celoserpa@gmail.com> wrote:
> Hey guys
>
> If I have a headline with children, like this:
>
> * Project
> ** TODO Task
> ** TODO Task
> ** SubProject
> *** TODO Task
> *** TODO Task
>
> Does org have any functionality that allows me to automatically close
> (Change TODO->DONE, put DONE when TODO is not available (in the case of
> Projects)) automatically and recursively for each child if I close the main
> parent headline?
>
> Thanks in advance,
>
> - Marcelo.
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 1234 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "DONE" all subtasks recursively
2011-07-20 15:41 ` Marcelo de Moraes Serpa
@ 2011-07-21 8:49 ` Aankhen
2011-07-22 2:59 ` Bernt Hansen
1 sibling, 0 replies; 5+ messages in thread
From: Aankhen @ 2011-07-21 8:49 UTC (permalink / raw)
To: Marcelo de Moraes Serpa, Org mailing list
Hello Marcelo,
On Wed, Jul 20, 2011 at 21:11, Marcelo de Moraes Serpa
<celoserpa@gmail.com> wrote:
> *bump*
> Hey guys, if someone could guide me a hint on where I should look to hack
> some elisp code in order to do that, I'd be grateful ;)
> Cheers,
> Marcelo.
>
> On Mon, Jul 18, 2011 at 1:30 PM, Marcelo de Moraes Serpa
> <celoserpa@gmail.com> wrote:
>>
>> Hey guys
>> If I have a headline with children, like this:
>> * Project
>> ** TODO Task
>> ** TODO Task
>> ** SubProject
>> *** TODO Task
>> *** TODO Task
>> Does org have any functionality that allows me to automatically close
>> (Change TODO->DONE, put DONE when TODO is not available (in the case of
>> Projects)) automatically and recursively for each child if I close the main
>> parent headline?
You can use ‘org-map-region’ to call a function on every headline in a
region. ‘org-end-of-subtree’ will move point to… well, the end of the
current subtree. Finally, ‘org-todo’ is what changes the todo state
of the headline containing point.
Add your custom function to either
‘org-after-todo-state-change-hook’[1] or ‘org-trigger-hook’.[2] (I’m
not sure what the difference is.)
Happy hacking!
Aankhen
[1]: http://orgmode.org/worg/org-configs/org-hooks.html#sec-1_13
[2]: http://orgmode.org/worg/org-configs/org-hooks.html#sec-1_15
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "DONE" all subtasks recursively
2011-07-20 15:41 ` Marcelo de Moraes Serpa
2011-07-21 8:49 ` Aankhen
@ 2011-07-22 2:59 ` Bernt Hansen
2011-07-22 13:52 ` Bastien
1 sibling, 1 reply; 5+ messages in thread
From: Bernt Hansen @ 2011-07-22 2:59 UTC (permalink / raw)
To: Marcelo de Moraes Serpa; +Cc: Org Mode
Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:
> *bump*
>
> Hey guys, if someone could guide me a hint on where I should look to
> hack some elisp code in order to do that, I'd be grateful ;)
>
> Cheers,
>
> Marcelo.
--8<---------------cut here---------------start------------->8---
(defun bh/mark-subtree-done ()
(interactive)
(org-mark-subtree)
(let ((limit (point)))
(save-excursion
(exchange-point-and-mark)
(while (> (point) limit)
(org-todo "DONE")
(outline-previous-visible-heading 1))
(org-todo "DONE"))))
--8<---------------cut here---------------end--------------->8---
Then M-x bh/mark-subtree-done.
This relies on the subtasks all being visible. You can enhance it so it
handles folded tasks if needed.
-Bernt
>
> On Mon, Jul 18, 2011 at 1:30 PM, Marcelo de Moraes Serpa <
> celoserpa@gmail.com> wrote:
>
> Hey guys
>
> If I have a headline with children, like this:
>
> * Project
> ** TODO Task
> ** TODO Task
> ** SubProject
> *** TODO Task
> *** TODO Task
>
> Does org have any functionality that allows me to automatically
> close (Change TODO->DONE, put DONE when TODO is not available (in
> the case of Projects)) automatically and recursively for each
> child if I close the main parent headline?
>
> Thanks in advance,
>
> - Marcelo.
>
>
>
>
>
>
>
>
--
Bernt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: "DONE" all subtasks recursively
2011-07-22 2:59 ` Bernt Hansen
@ 2011-07-22 13:52 ` Bastien
0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2011-07-22 13:52 UTC (permalink / raw)
To: Bernt Hansen; +Cc: Org Mode, Marcelo de Moraes Serpa
Hi Bernt,
Bernt Hansen <bernt@norang.ca> writes:
> (defun bh/mark-subtree-done ()
> (interactive)
> (org-mark-subtree)
> (let ((limit (point)))
> (save-excursion
> (exchange-point-and-mark)
> (while (> (point) limit)
> (org-todo "DONE")
> (outline-previous-visible-heading 1))
> (org-todo "DONE"))))
>
> Then M-x bh/mark-subtree-done.
Thanks for this -- I added an entry in Worg/org-hacks.html
Best,
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-22 13:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 18:30 "DONE" all subtasks recursively Marcelo de Moraes Serpa
2011-07-20 15:41 ` Marcelo de Moraes Serpa
2011-07-21 8:49 ` Aankhen
2011-07-22 2:59 ` Bernt Hansen
2011-07-22 13:52 ` Bastien
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).