From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: Re: org-depend: TRIGGER XYZ(KEYWORD) not working Date: Sun, 3 Dec 2017 10:13:16 -0500 Message-ID: References: <2017-11-19T10-47-05@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1146be829159a4055f710ace" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLVxI-0002sV-5p for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 10:13:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLVxG-000811-Ar for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 10:13:20 -0500 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]:40723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLVxG-00080T-1l for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 10:13:18 -0500 Received: by mail-pg0-x22b.google.com with SMTP id k15so6501606pgr.7 for ; Sun, 03 Dec 2017 07:13:18 -0800 (PST) In-Reply-To: <2017-11-19T10-47-05@devnull.Karl-Voit.at> 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: Karl Voit Cc: emacs-orgmode --001a1146be829159a4055f710ace Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, First observation: > > When I set the heading 1 to DONE (without assigning it any other > keyword), the TRIGGER events are ignored totally. I guess this is > an edge-case that may be considered as a bug. > =E2=80=8BThis is the result of Line 219 in org-depend.el: (unless (and (member from org-not-done-keywords) (member to org-done-keywords)) In this instance 'from' is set to nil so the 'and' returns nil and org-depend doesn't process the change of TODO to look for dependents. I don't know why it was defined this way as org-todo.el accepts headings with no TODO entry. I can't think of any reason other than explicitly blocking a user from processing a heading without a TODO entry, but it seems that if the user went to the effort of populating a TRIGGER property that they probably want this to be acted upon by org-depend.el. If there are no concerns raised in this thread I'll push a patch to all have org-depend process the example you listed. > Second observation: > > However, what is bugging me even more is that even when "heading 1" > has a TODO keyword assigned, in *some* cases, the TRIGGER event does > not get executed when I do it in my large Org-mode file. > > Copying the corresponding headings (the one with the TRIGGER prop > and the headings containing the "target" IDs) from my real-world > Org-mode file to my small test.org from above and marking the > heading that contains the TRIGGER properties to DONE, it then works > as expected. > > I then took the simple example from above, added a TODO keyword to > the heading 1, copied it to my real-world Org-mode file and even > this did not work: Heading 2 and 3 don't get their "NEXT" keyword > assigned. > > So the behavior changes within different Org-file contexts. > Therefore, I do have an issue creating a minimal example to > demonstrate the bug. > > Can somebody give me an advice how to debug this behavior? > =E2=80=8BMy only thought is that there is an ID clashing with your sample I= D and it is being updated instead of the heading you are interested in. org-depend.el looks at the local file for an ID and then looks globally for an ID match. You could instrument 'org-depend-trigger-todo' to trace the behaviour while processing the TODO update. Otherwise, you could use a process of elimination in a copy of your existing file to find the MWE that causes the issue and post it here. You could successively delete headings or other entries until the issue stops occurring.=E2=80=8B I have read your post on org-depend and found it insightful so thanks for that. When I was looking around at patching some new functionality into org-depend I was put onto org-edna[1] which was built as an alternative to org-depend. The syntax isn't compatible with org-depend, but org-edna is more powerful than org-depend. I am now using org-edna and am quite happy with it. [1] https://elpa.gnu.org/packages/org-edna.html --001a1146be829159a4055f710ace Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,=

First observation:

When I set the heading 1 to DONE (without assigning it any other
keyword), the TRIGGER events are ignored totally.=C2=A0 I guess this is
an edge-case that may be considered as a bug.

=E2=80=8BThis= is the result of Line 219 in org-depend.el:

(unless (and (member from org-not-done-keywords)
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 (member to org-done-keywor= ds))

=
In this instance = 9;from' is set to nil so the 'and' returns nil and org-depend d= oesn't process the change of TODO to look for dependents. I don't k= now why it was defined this way as org-todo.el accepts headings with no TOD= O entry. I can't think of any reason other than explicitly blocking a u= ser from processing a heading without a TODO entry, but it seems that if th= e user went to the effort of populating a TRIGGER property that they probab= ly want this to be acted upon by org-depend.el.

If there are no concerns raised in this thread I'= ;ll push a patch to all have org-depend process the example you listed.
=
=C2=A0
Second observation:

However, what is bugging me even more is that even when "heading 1&quo= t;
has a TODO keyword assigned, in *some* cases, the TRIGGER event does
not get executed when I do it in my large Org-mode file.

Copying the corresponding headings (the one with the TRIGGER prop
and the headings containing the "target" IDs) from my real-world<= br> Org-mode file to my small test.org from above and marking the
heading that contains the TRIGGER properties to DONE, it then works
as expected.

I then took the simple example from above, added a TODO keyword to
the heading 1, copied it to my real-world Org-mode file and even
this did not work: Heading 2 and 3 don't get their "NEXT" key= word
assigned.

So the behavior changes within different Org-file contexts.
Therefore, I do have an issue creating a minimal example to
demonstrate the bug.

Can somebody give me an advice how to debug this behavior?

=E2=80=8BMy only thought is that there is an ID clashing with your= sample ID and it is being updated instead of the heading you are intereste= d in. org-depend.el looks at the local file for an ID and then looks global= ly for an ID match.

Y= ou could instrument 'org-depend-trigger-todo' to trace the behaviou= r while processing the TODO update.

Otherwise, you could use a process of elimination in a copy of y= our existing file to find the MWE that causes the issue and post it here. Y= ou could successively delete headings or other entries until the issue stop= s occurring.=E2=80=8B

I h= ave read your post on org-depend and found it insightful so thanks for that= . When I was looking around at patching some new functionality into org-dep= end I was put onto org-edna[1] which was built as an alternative to org-dep= end. The syntax isn't compatible with org-depend, but org-edna is more = powerful than org-depend. I am now using org-edna and am quite happy with i= t.

--001a1146be829159a4055f710ace--