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:50:19 -0500 Message-ID: References: <87vaheqmgd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045d264804af790560043e11" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOAQR-0002B2-BG for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:50:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOAQP-0004jP-Qn for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:50:23 -0500 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:37518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOAQP-0004iQ-I4 for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 17:50:21 -0500 Received: by mail-pf0-x231.google.com with SMTP id n6so10168864pfa.4 for ; Sun, 10 Dec 2017 14:50:21 -0800 (PST) In-Reply-To: <87vaheqmgd.fsf@nicolasgoaziou.fr> 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 --f403045d264804af790560043e11 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 another 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.html 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 t= he > > parent headline the trigger would not evaluate because the :position > > property in `change-plist' may now refer to the line above the original > > TODO. > > > > I have used a marker to avoid the issue with the point moving due to th= e > > 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 > --f403045d264804af790560043e11 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hel= lo,

<= div class=3D"gmail_default" style=3D"font-size:small">ECM:

* Top-Heading with process indicator [/]=

** TODO Here I invoke org-todo to DONE
:PROPERTIES:
:TRIGGER:= =C2=A0 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, b= ut the trigger will not update the "This should be changed to TODO&quo= t; headline. There is further discussion in another thread where the user r= eported the issue [1].

Th= e issue is Line 12534 in org.el:

(when org-provide-todo-statistics
=C2=A0 (org-update-parent-todo= -statistics))
<= br>
which trave= rses 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 s= ure how to deal with this as it seems `org-update-parent-todo-statistics= 9; could update more than one parent heading and the number of additional c= haracters isn't clear without some feedback from `org-update-parent-tod= o-statistics'.

Cheers= ,

Adrian


On 10 December 2017 at 16:5= 3, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">Hello,

Adrian Bradd <adrian.bradd@gma= il.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

--f403045d264804af790560043e11--