Variable: org-after-todo-statistics-hook
org-after-todo-statistics-hook is a variable defined in org.el.gz.
Value
nil
Documentation
Hook that is called after a TODO statistics cookie has been updated.
Each function is called with two arguments: the number of not-done entries and the number of done entries.
For example, the following function, when added to this hook, will switch an entry to DONE when all children are done, and back to TODO when new entries are set to a TODO status. Note that this hook is only called when there is a statistics cookie in the headline!
(defun org-summary-todo (n-done n-not-done)
"Switch entry to DONE when all subentries are done, to TODO otherwise."
(let (org-log-done org-todo-log-states) ; turn off logging
(org-todo (if (= n-not-done 0) "DONE" "TODO"))))
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defvar org-after-todo-statistics-hook nil
"Hook that is called after a TODO statistics cookie has been updated.
Each function is called with two arguments: the number of not-done entries
and the number of done entries.
For example, the following function, when added to this hook, will switch
an entry to DONE when all children are done, and back to TODO when new
entries are set to a TODO status. Note that this hook is only called
when there is a statistics cookie in the headline!
(defun org-summary-todo (n-done n-not-done)
\"Switch entry to DONE when all subentries are done, to TODO otherwise.\"
(let (org-log-done org-todo-log-states) ; turn off logging
(org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))")