From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: Re: BUG: TODO statistics in parent heading prevent evaluation of TODOs with TRIGGER property Date: Sun, 10 Dec 2017 17:51:31 -0500 Message-ID: References: <87vaheqmgd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1bec264da3140560044250" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOARa-0002nt-RJ for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:51:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOARZ-0005Or-IZ for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:51:34 -0500 Received: from mail-pg0-x232.google.com ([2607:f8b0:400e:c05::232]:42479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOARZ-0005Oc-9e for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:51:33 -0500 Received: by mail-pg0-x232.google.com with SMTP id e14so9612621pgr.9 for ; Sun, 10 Dec 2017 14:51:33 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode --94eb2c1bec264da3140560044250 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I should probably add that this will require org-depend.el to be loaded. On 10 December 2017 at 17:50, Adrian Bradd wrote: > Hello, > > ECM: > > * Top-Heading with process indicator [/] > > ** TODO Here I invoke org-todo to DONE > :PROPERTIES: > :TRIGGER: 2021-12-03-target(TODO) > :END: > > ** This should be changed to TODO > :PROPERTIES: > :ID: 2021-12-03-target > :END: > > If you run org-todo on the "Here I invoke org-todo to DONE" headline the > headline will change to DONE, but the trigger will not update the "This > should be changed to TODO" headline. There is further discussion in anoth= er > thread where the user reported the issue [1]. > > The issue is Line 12534 in org.el: > > (when org-provide-todo-statistics > (org-update-parent-todo-statistics)) > > which traverses the tree and updates the todo progress statistics. If the > statistic is [/], as in the ECM above, or [%] it will add 1 or more > characters which is enough to push the :position property up to the line > above. I wasn't sure how to deal with this as it seems > `org-update-parent-todo-statistics' could update more than one parent > heading and the number of additional characters isn't clear without some > feedback from `org-update-parent-todo-statistics'. > > Cheers, > > Adrian > > [1] https://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00058.htm= l > > On 10 December 2017 at 16:53, Nicolas Goaziou > wrote: > >> Hello, >> >> Adrian Bradd writes: >> >> > Please see the patch attached. >> > >> > When completing a TODO with a TRIGGER property that has statistics in >> the >> > parent headline the trigger would not evaluate because the :position >> > property in `change-plist' may now refer to the line above the origina= l >> > TODO. >> > >> > I have used a marker to avoid the issue with the point moving due to t= he >> > addition of characters >> > =E2=80=8B in the parent headline=E2=80=8B >> > . Not sure if this is the best way to solve the problem. >> >> IIUC, point is moved between `startpos' and `change-plist' bindings? Do >> you know when that happens? Would you have an ECM for the issue? >> >> Thank you. >> >> Regards, >> >> -- >> Nicolas Goaziou >> > > --94eb2c1bec264da3140560044250 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I s= hould probably add that this will require org-depend.el to be loaded.

On 10 D= ecember 2017 at 17:50, Adrian Bradd <adrian.bradd@gmail.com> wrote:
Hello,

ECM:

* Top-Heading with process indicator [/]

** TODO Here I invok= e org-todo to DONE
:PROPERTIES:
:TRIGGER:=C2=A0 2021-12-03-target(TOD= O)
:END:

** This should be changed to TODO
:PROPERTIES:
:ID= : 2021-12-03-target
:END:

If you run org-todo on the "Here I invoke org-todo to DONE&quo= t; headline the headline will change to DONE, but the trigger will not upda= te the "This should be changed to TODO" headline. There is furthe= r discussion in another thread where the user reported the issue [1].
=

The issue is Line 12534 in org= .el:

=
(when org-provide-to= do-statistics
=C2=A0 (org-update-parent-todo-statistics))

which traverses the tree and updat= es the todo progress statistics. If the statistic is [/], as in the ECM abo= ve, or [%] it will add 1 or more characters which is enough to push the :po= sition property up to the line above. I wasn't sure how to deal with th= is as it seems `org-update-parent-todo-statistics' could update mo= re than one parent heading and the number of additional characters isn'= t clear without some feedback from `org-update-parent-todo-statistics&= #39;.

Cheers,

Adrian

<= /div>
On 10 December 2017 at 16:53, Nicolas Goaziou <= span dir=3D"ltr"><mail@nicolasgoaziou.fr> wrote:
Hello,

Adrian Bradd <adrian.bradd@gmail.com> writes:

> Please see the patch attached.
>
> When completing a TODO with a TRIGGER property that has statistics in = the
> parent headline the trigger would not evaluate because the :position > property in `change-plist' may now refer to the line above the ori= ginal
> TODO.
>
> I have used a marker to avoid the issue with the point moving due to t= he
> addition of characters
> =E2=80=8B in the parent headline=E2=80=8B
> . Not sure if this is the best way to solve the problem.

IIUC, point is moved between `startpos' and `change-plist' b= indings? Do
you know when that happens? Would you have an ECM for the issue?

Thank you.

Regards,

--
Nicolas Goaziou


--94eb2c1bec264da3140560044250--