diff --git a/config.org b/config.org index 69ce512..d0b4439 100644 --- a/config.org +++ b/config.org @@ -894,6 +894,19 @@ Preserve indentation in SRC blocks (setq org-src-preserve-indentation t) #+END_SRC +** Org-todo + +When all children are done, automatically change the TODO parent entry to DONE. + +#+BEGIN_SRC emacs-lisp +(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")))) + +(add-hook 'org-after-todo-statistics-hook #'org-summary-todo) +#+END_SRC + ** Org bullets #+BEGIN_SRC emacs-lisp