Yep, that did it. Thanks!
In case someone else tries this, I should mention that it doesn't handle
the complex case of when I terminate the repetition for good with C-u
-1, but I almost never do that, and can easily archive that one manually
with C-c $.
Thanks again,
- George
On 2/7/26 9:46 AM, Christian Moe wrote:
George Pearson<[email protected]> writes:
To keep my master org file tidy, I want to automatically archive each
level 2 headline when I mark it done.
This works great using org-after-todo-state-change-hook, EXCEPT when
the headline has a repeater. Then org-entry-is-done-p returns TRUE
even though the headline will be resurrected.
You can use `org-get-repeat' to check if the timestamp of the current
entry contains a repeater. So the function you add to
`org-after-todo-state-change-hook' could contain an additional check
along these lines:
(unless (org-get-repeat)
(org-archive-subtree))
Does this help?
Regards,
Christian