ORG-TODO: Mark parent task done if child tasks are done

This commit is contained in:
Laurens Miers 2024-09-29 21:04:37 +02:00
parent 6aaae92c53
commit 3ad176fbf9

View file

@ -894,6 +894,19 @@ Preserve indentation in SRC blocks
(setq org-src-preserve-indentation t) (setq org-src-preserve-indentation t)
#+END_SRC #+END_SRC
** Org-todo
*** Mark parent entry as DONE when children are 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 ** Org bullets
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp