emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] BUG: TODO statistics in parent heading prevent evaluation of TOD


From: Adrian Bradd
Subject: Re: [O] BUG: TODO statistics in parent heading prevent evaluation of TODOs with TRIGGER property
Date: Sun, 10 Dec 2017 17:50:19 -0500

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 <address@hidden> wrote:
Hello,

Adrian Bradd <address@hidden> 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 original
> TODO.
>
> I have used a marker to avoid the issue with the point moving due to the
> addition of characters
> ​ in the parent headline​
> . 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]