Is it possible to automatically create backlinks to org-mode links? When a link to file B is added to file A, then also a link to file A is added to file B (i.e. the links are symmetrical - going both ways).
A concrete example:
I have two files a.org
and b.org
.
Inside a.org
in heading Links I insert an org-link (with a new function org-link-with-backlink
) to the file b.org
.
So file a.org
looks like this:
* Links
[[~/org/b.org][b]]
* Heading 1
lorem ipsum....
I'd like this to happen automatically:
the file
b.org
is opened (if not open already)and inside its Links heading a link to
a.org
is created.
If Links doesn't exist yet, create it by prepending the file and add the link.
If b.org
already has a link to a.org
in its Links heading then do nothing.
So that b.org
looks like this after the operation:
* Links
[[~/org/a.org][a]]
* Heading X
foo bar....
If now I inside file c.org
add also a link to b.org
, then b.org
now looks like this:
* Links
[[~/org/a.org][a]]
[[~/org/c.org][c]]
* Heading X
foo bar....
I think some sort of advice around org-link
should accomplish this, but unfortunately this is beyond my elisp skills...
Thank you very much!
PS [optional]: I intend to use it in conjunction with org-wiki, to the solution could use the wiki style links as an alternative.
org-occur
may be useful for this. See stackoverflow.com/questions/9844154/…