emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tracking todo state changes AND automatically change to done when all children are done
@ 2022-08-04 14:27 Cletip Cletip
  2022-08-04 15:02 ` Ihor Radchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Cletip Cletip @ 2022-08-04 14:27 UTC (permalink / raw)
  To: Org Mode List

[-- 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 --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-02  6:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 14:27 Tracking todo state changes AND automatically change to done when all children are done Cletip Cletip
2022-08-04 15:02 ` 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

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