2

Let's say you have a repeated task with subtasks using checkboxes like:

  * TODO [2/2] Task
    DEADLINE: <2021-09-07 ++1y>
   + [x] done
   + [x] also done

When I mark the Task as DONE? I'd like the chekboxes to be unchecked as the DEADLINE is incremented one year and the TODO State switches back to TODO.

I couldn't find a variable for that.

2 Answers 2

3

There is org-todo-repeat-hook which is run when an item is repeated, so you can add a function that clears the checkboxes to it. Org mode offers such a function for a subtree, org-reset-checkbox-state-subtree, which should work fine for the simple case of a one-level subtree:

(add-hook 'org-todo-repeat-hook #'org-reset-checkbox-state-subtree)

If this is too blunt an instrument (it will reset any task's checkboxes in any level of the subtree whenever the task is repeated), then you can wrap the org-reset-checkbox-state-subtree in a function that conditionally calls it, e.g. by checking that the task is the one you want. But as a first approximation it should work fine.

BTW, untested.

1

Just found out that there is org-checklist which takes care of clearing the checkboxes, using the RESET_CHECK_BOXES property.

org-checklist used to be in the contrib/ directory that was bundled with Org mode, but all of the contrib/ stuff has now been moved to its own separate repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.