I have an agenda file with todo tasks where each task (and its subtasks) have an associated workspace folder or file, somewhere I actually do the work. To keep things organized I want this to be an inheritable property of the task and I want to have an abbreviation for the root workspace folder, eg

#+LINK: workspace file:~/workspace/%s
* TODO Write book
   :Work: [[workspace:subfolder/.]]

The above link though is not followed with org-open-at-point, rather it thinks workspace:subfolder is a heading in the file and asks me to create it. Replacing the link with file:~/workspace/subfolder/. with or without square brackets works. Can I make my link abbreviation work as a property value?

  • 1
    I don't think so: according to the draft syntax doc property drawers contain node properties which have a name and a value - each one of those is a string (with some restrictions). In particular, the value is syntactically just a plain string, not a link. Also, take a look at the function org-element-node-property-parser: that's the implementation of the description in the doc. – NickD May 12 '20 at 21:35
  • Thanks @NickD , that looks a definite answer then. Do you want to answer it, with any ideas on my intention? – George Moutsopoulos May 13 '20 at 8:26
  • Sorry, I only have the negative answer to offer - I don't know of any Org mode mechanism to basically expand an abbreviation on demand. Macros are only expanded on export, the generic abbrev or dabbrev mechanisms that emacs offers are expanded on entry. So nothing worhwhile on the positive side - but somebody else might have some better ideas. – NickD May 13 '20 at 18:20

According to NickD, the link is of type node-property and link abbreviations are not made. I was able to C-c C-o on the link using a new link type

(defvar workspace-folder "~/workspace/moutsopoulosg")
(defun org-workspace-follow (path)
  (find-file (format "%s/%s" workspace-folder path)))
(org-link-set-parameters "workspace" :follow #'org-workspace-follow)

then [[workspace:here]] works everywhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.