I want to archive an entry automatically when its todo
state gets marked as done
.
The problem is that you can set up lots of different states that mean done
. So a function like this will only work if the done state is literally called DONE
:
(defun channing/archive-when-done ()
(when (equal (org-get-todo-state) "DONE") (org-archive-subtree-default)))
(add-hook 'org-after-todo-state-change-hook
'channing/archive-when-done)
How can I detect if an entry is in the done
state, regardless of the particular keyword?