emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Cletip Cletip <clement020302@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Tracking todo state changes AND automatically change to done when all children are done
Date: Thu, 4 Aug 2022 16:27:39 +0200	[thread overview]
Message-ID: <CAPHku6Mk-qgeWwL+rOoAy9GEjXjrpnJ5Nb8nv4OE-jRkrp=aCw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

Hello to all,

I am trying to do what is in the title of this mail, but there is something
surprising:

Everything works perfectly well, except when inserting statistics cookies
(for the parent obviously). Indeed, when changing the state of the subtask,
the lines like this :

- State " new state" from "old state" [2022-08-04 Thu 16:09]

are not saved under the subtask, but always under the main heading.

To reproduce this curious behavior, you only need this configuration:

  (setq org-todo-keywords
        '((sequence "TODO(t!)" "|" "DONE(d!)" )))

  (defun org-summary-todo (n-done n-not-done)
    "Switch entry to DONE when all subentries are done, to TODO otherwise."
    (let (org-log-done org-log-states) ; turn off logging
      (org-todo (if (= n-not-done 0) "DONE" "TODO"))))

  (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)

;;(setq org-log-into-drawer t) ;;to have a logbook


and try on an org document like this one:


* TODO heading [0/1]

- State "DONE" from "TODO" [2022-08-04 Thu 16:09]

** TODO change the state of this heading !


My org-mode version is 9.5.2 (release_9.5.2-25-gaf6f12 @
/usr/share/emacs/28.1/lisp/org/).


Thank you in advance for your answers

[-- Attachment #2: Type: text/html, Size: 1472 bytes --]

             reply	other threads:[~2022-08-04 14:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 14:27 Cletip Cletip [this message]
2022-08-04 15:02 ` Tracking todo state changes AND automatically change to done when all children are done Ihor Radchenko
2022-08-04 15:12   ` Cletip Cletip
2022-08-05  1:27     ` Ihor Radchenko
2022-08-05  2:11       ` Cletip Cletip
2022-08-05  2:28         ` Ihor Radchenko
2022-08-05 14:22           ` Cletip Cletip
2022-10-02  6:10   ` [BUG] Storing multiple log notes recursively only keeps the last note (was: Tracking todo state changes AND automatically change to done when all children are done) Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPHku6Mk-qgeWwL+rOoAy9GEjXjrpnJ5Nb8nv4OE-jRkrp=aCw@mail.gmail.com' \
    --to=clement020302@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).