* checklist and org-after-todo-statistics-hook
@ 2010-03-25 18:14 David Ellis
2010-03-29 9:42 ` Carsten Dominik
2010-03-29 11:28 ` Carsten Dominik
0 siblings, 2 replies; 3+ messages in thread
From: David Ellis @ 2010-03-25 18:14 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]
I have the following in my .emacs file to automatically update the todo
state of a parent todo based on the number of completed children.
(defun org-summary-todo (n-done n-not-done)
"Switch entry to DONE when all subentries are done, to TODO otherwise."
(this is an unquoted list)
(let (org-log-done org-log-states) ; turn off logging
(org-todo (if (= n-not-done 0)
"DONE"
(if (= n-done 0) "TODO" "STARTED")))))
(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
I have started using checklists and notices that this hook does not get
called when the statistics cookie is updated.
For example, in the following, the parent todo state gets updated as the
statistics cookie is updated:
* STARTED Project 1 [1/3]
** DONE task 1
** TODO task 2
** TODO task 3
In the following example, the statistics are updated but the hook is not
called
* TODO Project 1 [1/3]
- [X] task 1
- [ ] task 2
- [ ] task 3
Is it possible to change it to call the hook for the second example?
Dave
[-- Attachment #1.2: Type: text/html, Size: 2741 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checklist and org-after-todo-statistics-hook
2010-03-25 18:14 checklist and org-after-todo-statistics-hook David Ellis
@ 2010-03-29 9:42 ` Carsten Dominik
2010-03-29 11:28 ` Carsten Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-03-29 9:42 UTC (permalink / raw)
To: David Ellis; +Cc: emacs-orgmode
On Mar 25, 2010, at 7:14 PM, David Ellis wrote:
> I have the following in my .emacs file to automatically update the
> todo state of a parent todo based on the number of completed children.
>
> (defun org-summary-todo (n-done n-not-done)
> "Switch entry to DONE when all subentries are done, to TODO
> otherwise."
> (this is an unquoted list)
> (let (org-log-done org-log-states) ; turn off logging
> (org-todo (if (= n-not-done 0)
> "DONE"
> (if (= n-done 0) "TODO" "STARTED")))))
>
> (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
>
> I have started using checklists and notices that this hook does not
> get called when the statistics cookie is updated.
>
> For example, in the following, the parent todo state gets updated as
> the statistics cookie is updated:
>
> * STARTED Project 1 [1/3]
> ** DONE task 1
> ** TODO task 2
> ** TODO task 3
>
> In the following example, the statistics are updated but the hook is
> not called
>
> * TODO Project 1 [1/3]
> - [X] task 1
> - [ ] task 2
> - [ ] task 3
>
> Is it possible to change it to call the hook for the second example?
Hi Dave, there is a separate for this situation:
org-checkbox-statistics-hook
HTH
- Carsten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checklist and org-after-todo-statistics-hook
2010-03-25 18:14 checklist and org-after-todo-statistics-hook David Ellis
2010-03-29 9:42 ` Carsten Dominik
@ 2010-03-29 11:28 ` Carsten Dominik
1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2010-03-29 11:28 UTC (permalink / raw)
To: David Ellis; +Cc: emacs-orgmode
On Mar 25, 2010, at 7:14 PM, David Ellis wrote:
> I have the following in my .emacs file to automatically update the
> todo state of a parent todo based on the number of completed children.
>
> (defun org-summary-todo (n-done n-not-done)
> "Switch entry to DONE when all subentries are done, to TODO
> otherwise."
> (this is an unquoted list)
> (let (org-log-done org-log-states) ; turn off logging
> (org-todo (if (= n-not-done 0)
> "DONE"
> (if (= n-done 0) "TODO" "STARTED")))))
>
> (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
>
> I have started using checklists and notices that this hook does not
> get called when the statistics cookie is updated.
>
> For example, in the following, the parent todo state gets updated as
> the statistics cookie is updated:
>
> * STARTED Project 1 [1/3]
> ** DONE task 1
> ** TODO task 2
> ** TODO task 3
>
> In the following example, the statistics are updated but the hook is
> not called
>
> * TODO Project 1 [1/3]
> - [X] task 1
> - [ ] task 2
> - [ ] task 3
>
> Is it possible to change it to call the hook for the second example?
Hi Dave, there is a separate for this situation:
org-checkbox-statistics-hook
HTH
- Carsten
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-29 11:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 18:14 checklist and org-after-todo-statistics-hook David Ellis
2010-03-29 9:42 ` Carsten Dominik
2010-03-29 11:28 ` Carsten Dominik
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.