From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4DGPMavX62JSJAEAbAwnHQ (envelope-from ) for ; Thu, 04 Aug 2022 16:28:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uHmSMavX62Lk3AAA9RJhRA (envelope-from ) for ; Thu, 04 Aug 2022 16:28:59 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 699963E233 for ; Thu, 4 Aug 2022 16:28:59 +0200 (CEST) Received: from localhost ([::1]:54058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJbqM-0006pI-DV for larch@yhetil.org; Thu, 04 Aug 2022 10:28:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJbpK-0006li-Am for emacs-orgmode@gnu.org; Thu, 04 Aug 2022 10:27:54 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:33330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJbpI-0006c9-OB for emacs-orgmode@gnu.org; Thu, 04 Aug 2022 10:27:54 -0400 Received: by mail-ed1-x529.google.com with SMTP id b96so15262256edf.0 for ; Thu, 04 Aug 2022 07:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=YNWbPSxsO/ZNyzmmDVvtquydIJNTS+ZSIlo0XXwX0Vk=; b=cM7BexsFXhEVzXzg89a2KZuCSC4jo1XybFFyAn4lQIePCtr7KRV4C5jivPRjZYP8Jw BM9GV+sm0METt99wfXQC5ww6HNkXFzazVf38LA4XxrkRj5ftXsqsqMf0gQO35Lbh98Ey Td5s/4rGFcEoCZQmnnVRa43Fko1wx9pAISP/SaopNNyQs+pmoGrtfWtTKxpHb1qHsU+/ 6bEatUdm7h10fcRG2cVb0+uq2cycERkjaOzebKTm9800tuheTzvGumoGbospXFx/ls/k ZEtjq5b3nbFPXdQAnXOKzG9tgL7DXIZajSGEwY2FQNP6++1oBpg+HbKDIF0Xdyik+TkX w2VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YNWbPSxsO/ZNyzmmDVvtquydIJNTS+ZSIlo0XXwX0Vk=; b=E1A1D3ypk9XGAAJacESv+Ibj0hh2dHKpieoE+ZRosTTJ4PfG0/Xs2XpJXfIXhHaLu4 74MJBj40yPMuPKwuFo6AfYT+IAtJ2XKQ2bEqduPc6bnt1YOx7Pic5+wmYPI9SLokeMP3 0QQOeM4dU8GKI8N6ySEoBHa/O3jZiL2nXFLf9nhOL73t1w2OjFfqLfZJlj1Y99her+Om mN5YBleFz7TDLXcBnejQSqVVf9rnW6JKa6w2Q1SlMM56mUlZcQ505EgEK7hOoswFOX9K YxurTpmaMyYwkLNkeJIvE4TsBgXZwfNgQfO/5fdFBys+MOMrMOYncYiGJP4/G6JaBtGK KD8g== X-Gm-Message-State: ACgBeo3i4GUBv8lSVFxmwsKLbEQE7Vf9hFF7lN5V+zoooT+4+wvwO13E p5ZM7KltWrp7iyTfPFr15TtzkZlQ77FXsKSfFi+n/8YOtqMvOA== X-Google-Smtp-Source: AA6agR4DMtnRI1QElM0WoJqPOKY93GDfeJiUG9Uj5XB8ZtR5poVJ6LaDRC6v0e3pyLt8QbRtKGDRIC92vpQOOMa/wFo= X-Received: by 2002:a05:6402:26c2:b0:43d:d885:451a with SMTP id x2-20020a05640226c200b0043dd885451amr2290536edd.287.1659623270406; Thu, 04 Aug 2022 07:27:50 -0700 (PDT) MIME-Version: 1.0 From: Cletip Cletip Date: Thu, 4 Aug 2022 16:27:39 +0200 Message-ID: Subject: Tracking todo state changes AND automatically change to done when all children are done To: Org Mode List Content-Type: multipart/alternative; boundary="0000000000007e618c05e56b27cb" Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=clement020302@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659623339; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YNWbPSxsO/ZNyzmmDVvtquydIJNTS+ZSIlo0XXwX0Vk=; b=Oa1uNx4ZfQiJFVX4LjU/Q1qx3hfxOOoQEuvCF1R4NUHGkFVCVFfRxfXi/LVRLy+Dgp5V9R kIl3l2Dok4uPfY0SaldsTRsCoy46pqfwZgfq8SiJowVZPadISmUR8ZM/khw+xjHyaiGyXI hZs2StGQW209gXNLiKp+io05TZJ/UkXMpNadLIX2J81DTsJLrgpDMACoTPbxmJITgbrisX sqDoEsx459ckSjz4Pdav7JRSXnr8BouWRXkIk8N1qeGifJ44YhWYAtN8uHxM3JI5Sh23wT 6nAz5TIglPAygqjl0x9F0OYzSg8+9RWyCBGpOT0MwJRp2abqp7Loe+/B/4qZmQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659623339; a=rsa-sha256; cv=none; b=IaeGfvLcn8Z67rKKWvbh2gQlxnlyRI9nTwAz/xpgXOw/GvUIqbuDNFmx1KZDozB/csDOah ZYdWDonvhsalYoxqz2BBDIGAUaEQ3ki+sc5ADwI2yQZxlvo4+Q5XeayhbIDKODVxf9Apye +Svh8kL3b2qN2CnHv/KWBVFdtlNQ9Z8MzAZkyNJ6Q0LLXX3luPK+a1TPtbfC07q4PCmfsG TGUgylm//LjejCxIAOQmvoPp+nVHKEyjR1BCtnVbwGVj4EHOxR+uVeThKFY6oIv1yCtZE1 ER0g94sgCAkS9Qmm263XpVBULyeXIkrPw2pxI0KyaadZKSXZYT5aAHU/TTrs4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cM7BexsF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.71 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cM7BexsF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 699963E233 X-Spam-Score: -8.71 X-Migadu-Scanner: scn0.migadu.com X-TUID: dIduGFUYJZJF --0000000000007e618c05e56b27cb Content-Type: text/plain; charset="UTF-8" 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 --0000000000007e618c05e56b27cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello to all,

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

Everything works = perfectly well, except when inserting statistics cookies (for the parent ob= viously). Indeed, when changing the state of the subtask, the lines like th= is :

- 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:=E2=80=AF

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

=C2=A0 (defun org-summary-todo (n-done n-n= ot-done)
=C2=A0 =C2=A0 "Switch entry to DONE when all subentries ar= e done, to TODO otherwise."
=C2=A0 =C2=A0 (let (org-log-done org-lo= g-states) ; turn off logging
=C2=A0 =C2=A0 =C2=A0 (org-todo (if (=3D n-n= ot-done 0) "DONE" "TODO"))))

=C2=A0 (add-hook &#= 39;org-after-todo-statistics-hook 'org-summary-todo)

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


and try on an org docume= nt like this one:


* TODO heading [0/1]

- State "DON= E" from "TODO" [2022-08-04 Thu 16:09]

** TODO change = the state of this heading !


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


Thank you= in advance for your answers
--0000000000007e618c05e56b27cb--