18

With cyclic or repetitive tasks in org-mode, inside this task, if there are several checkboxes and all of them marked as ticked, after the general task is masked as DONE, the checkboxes for the next cycle period stills appear as ticked and it should be unticked. e.g.:

  • TODO Cyclic monthly home [0/5] SCHEDULED: <2013-11-30 Sat +1m>
    • [ ] pay sauna
    • [ ] pay electricity
    • [ ] pay renting
    • [ ] pay internet
    • [ ] pay union

Once I ticked all of them and put it as done, this is what I can see:

  • WIP Cyclic monthly home [5/5] SCHEDULED: <2014-01-30 Thu +1m>
  • State "DONE" from "WIP" [2013-11-06 Wed 20:49] :PROPERTIES: :LAST_REPEAT: [2013-11-06 Wed 20:49] :END:
    • [X] pay sauna <--- this should be unticked
    • [X] pay electricity <-- this should be unticked
    • [X] pay renting <-- this should be unticked
    • [X] pay internet <-- this should be unticked
    • [X] pay union <-- this should be unticked

Tested in versions:

  • Emacs version: *GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars) of 2013-08-30 on apocalipsis*

  • Org-mode version: *Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/local/share/emacs/24.3/lisp/org/)*

Update: solved following these instructions:

1. In the emacs configuration file .emacs include:

(add-to-list 'load-path (expand-file-name "~/path_to_file_org-checklist.el/"))

(require 'org-checklist)

Note: If you do not have the file, you can download from here

2. Inside the file mytasks.org after the TODO task, but before the checkboxes include those lines:

:PROPERTIES:

:RESET_CHECK_BOXES: t

:END:

3. Verify that it works

Just close the task with C-c C-t and you will see the checkboxes unticked.

3 Answers 3

19

If I understand you correctly, the situation is: you have a repeating task with subitems as checkboxes. When the task is completed, all the checkboxes on the subitems should be cleared - so the task can be done at next cyclic time.

  • Set property RESET_CHECK_BOXES on the task to t
  • make sure org-checklist is one of the loaded modules (via variable org-modules)
3
  • I tried this, but it doesn't work. org-modules is configured, RESET_CHECK_BOXES is set, but marking the item as DONE does not uncheck the checkboxes. Sep 2, 2014 at 11:52
  • This works for me. @NoahSlater: did you put e.g. (require 'org-checklist) in your init file? Dec 7, 2014 at 6:08
  • 2
    Note adding a module to org-modules loads the module when org is loaded. Using require means it will be loaded when the require is executed (if not already) loaded. This may result in the module being loaded before org - don't know how that will work out. Also, make sure org-checklist is actually on your systed - it lives in the org/contrib directory. Dec 27, 2014 at 1:56
8

You can untick a range of checkboxes with C-c C-x C-b on selected region. This calls the org-toggle-checkbox command.

2
  • Yes, I know. But once one task is done, a new task appears for the new cycle. Why the new task appear with the checkboxes marked? What I am trying to say is; as it is a new task, should appear automatically unchecked, without using C-c C-x C-b Nov 23, 2013 at 16:55
  • 2
    I see what you mean, but it's better as it is. Otherwise the next guy will start complaining that he doesn't want them unchecked, or wants just half of them checked and so on.... A solution can be made for child TODO items. The task that you describe is exactly for that. org will even track dependencies for you and not let you mark the parent item as DONE before child items are DONE.
    – abo-abo
    Nov 23, 2013 at 18:41
1

org-checklist.el has been moved to https://git.sr.ht/~bzg/org-contrib before Org 9.5. So if you are using the latest, you have to get it from there. The code works as is. If you've been loading org-mode/contrib/lisp/, you can change it pointing to org-contrib/lisp/ and it should all work as it used to.

(use-package org
  :load-path ( "~/src/org-mode/lisp"
               "~/src/org-contrib/lisp/")

If you just want to reset your checkboxes, you can copy a portion of it and put it in your init.el:

(defun my-org-reset-checkbox-state-maybe ()
  "Reset all checkboxes in an entry if the `RESET_CHECK_BOXES' property is set"
  (interactive "*")
  (if (org-entry-get (point) "RESET_CHECK_BOXES")
      (org-reset-checkbox-state-subtree)))

(defun my-org-reset-checkbox-when-done ()
  (when (member org-state org-done-keywords) ;; org-state dynamically bound in org.el/org-todo
    (my-org-reset-checkbox-state-maybe)))

(add-hook 'org-after-todo-state-change-hook 'my-org-reset-checkbox-when-done)

The original code is GPLv3+.

Your Answer

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

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