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: Mon, 25 Dec 2017 22:55:28 -0500 Message-ID: References: <87vaheqmgd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTgL2-0005LF-Rf for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 22:55:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTgKy-0005fz-VL for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 22:55:36 -0500 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:35713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eTgKy-0005f0-Pn for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 22:55:32 -0500 Received: by mail-qt0-x22d.google.com with SMTP id u10so43919399qtg.2 for ; Mon, 25 Dec 2017 19:55:32 -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 Just wanted to bump this. Let me know if there is a preferred/better way to attack this issue and I can give it a shot. Cheers, Adrian Adrian Bradd writes: > 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 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 >>> 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 >>> >> >> -- Adrian Bioelectronic Systems Lab, Columbia University