π

UOMF: Easy Dependency Creation With org-linker-edna

Show Sidebar

This is an article from a series of blog postings. Please do read my "Using Org Mode Features" (UOMF) series page for explanations on articles of this series.

After switching from the simple and built-in Org mode dependency method org-depend to the more powerful org-edna, I had to accept the more complex dependency definition syntax of org-edna.

One of the most basic tasks here are:

  1. Resolving the current heading should trigger a todo keyword for a remote heading.
  2. Resolving the current heading should trigger a scheduled date for a remote heading.
  3. Any heading that gets triggered by a remote heading should have a link to this dependency.

This is where org-linker-edna is going to help you. It comes with a dependency on org-linker as well as the helm framework.

You can see in my Emacs configuration how I set up the packages. It also contains the definitions of all custom functions mentioned.

This article was also part of the basis of my EmacsConf 22 9 minutes demo which can be also be found on various locations:

Defining Dependencies

With org-linker-edna set up with a link-id-function like my my-id-get-or-generate, defining dependencies and linking headings is very easy for me.

Consider the following example:

 *** TODO Set up org-linker
 *** Set up org-linker-edna
 *** Play around with org-linker-edna	  

With my cursor on the first heading, I invoke my shortcut for org-linker-edna (C-c s e). This is the workflow that follows:

  1. I get asked to enter a search term for a heading using the helm framework. I enter "org-linker-edna" which results in a finite set of search result candidates I choose from.
  2. After confirming the heading of choice, I get asked what I would like to trigger in the remote heading: "scheduled", "deadline", or "todo".
  3. For a single choice, you just have to move the cursor and confirm with RET. It is noteworthy that you can select multiple entries with C-SPC. I usually select "scheduled" as well as "todo".
  4. For "scheduled" I now get asked to define the day. I always choose the very same day via . (a dot). Please note: at my side, the usage of weekdays like +1wkdy does not seem to work for some reason.
  5. For "todo" I need to select the keyword. In my case, it is usually NEXT.

Now, org-linker-edna does the following things for me:

 *** TODO Set up org-linker
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker
 :TRIGGER:  ids("id:2021-01-23-Set-up-org-linker-edna") todo!(NEXT) scheduled!(".")
 :END:

 *** Set up org-linker-edna
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker-edna
 :BLOCKER:  ids("id:2021-01-23-Set-up-org-linker")
 :END:

 *** Play around with org-linker-edna	  

As you can see, with my-id-get-or-generate I get human-readable IDs generated if there are no IDs which can be re-used.

Since org-edna version 1.1.2 you can use "id:" links within the ids() properties. This gives you navigable links you can follow. The target heading automatically got a BLOCKER property which also contains a navigable link back to its dependency which closes the full circle.

It is easy to see that org-linker-edna takes away error-prone effort when it comes to defining dependencies.

Of course, you can define multiple dependencies within the same heading by repeating the workflow above several times.

Resolving the first task to DONE results in the following situation:

 *** DONE Set up org-linker
 CLOSED: [2021-01-23 Sat 14:37]
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker
 :TRIGGER:  ids("id:2021-01-23-Set-up-org-linker-edna") todo!(NEXT) scheduled!(".")
 :END:
 :LOGBOOK:
 - State "DONE"       from "NEXT"       [2021-01-23 Sat 14:37]
 :END:

 *** TODO Set up org-linker-edna
 SCHEDULED: <2021-01-23 Sat>
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker-edna
 :BLOCKER:  ids("id:2021-01-23-Set-up-org-linker")
 :END:

 *** Play around with org-linker-edna	  

Linking Headings

For the sake of completeness, I again want to demonstrate the creation of a link from "Play around with org-linker-edna" to "Set up org-linker" as a reference.

For this, I am using org-super-links as I already mentioned it in this blog article.

By invoking sl-quick-insert-inline-link (C-c s i in my setup), I get asked to search for a heading.

When applied in the "Play around with org-linker-edna" heading of the example, it results in the following:

 *** DONE Set up org-linker
 CLOSED: [2021-01-23 Sat 14:43]
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker
 :TRIGGER:  ids("id:2021-01-23-Set-up-org-linker-edna") todo!(NEXT) scheduled!(".")
 :END:
 :LOGBOOK:
 - State "DONE"       from "NEXT"       [2021-01-23 Sat 14:43]
 :END:
 :LINKS:
 [2021-01-23 Sat 14:33] <- [[id:2021-01-23-Play-around-with-org-linker-edna][Play around with org-linker-edna]]
 :END:

 *** TODO Set up org-linker-edna
 SCHEDULED: <2021-01-23 Sat>
 :PROPERTIES:
 :ID:       2021-01-23-Set-up-org-linker-edna
 :BLOCKER:  ids("id:2021-01-23-Set-up-org-linker")
 :END:

 *** Play around with org-linker-edna
 :PROPERTIES:
 :ID:       2021-01-23-Play-around-with-org-linker-edna
 :END:

 - This will be fun [[id:2021-01-23-Set-up-org-linker][Set up org-linker]]	  

You can now observe that this results in an inserted link at the cursor as well as a back-link within a LINKS drawer in the referred heading.

For me, this is the way of defining dependencies between tasks and links between any type of heading within Org mode. Furthermore, it is the reason why I still struggle with the idea of introducing a Zettelkasten method in my situation. It just works with much less complexity and provides me a way of breaking up the strict hierarchy of Org mode headings.

Update 2021-11-21: reddit discussion on org-edna and visualization

Please do read this page with a very interesting discussion by u/TeMPOraL\_PL on org-edna and task dependency with visualizations and a BLOCKER status.


Related articles that link to this one:

Comment via email (persistent) or via Disqus (ephemeral) comments below: