Frage

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.

War es hilfreich?

Lösung

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)

Andere Tipps

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

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+.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top