1

I have org-capture templates setup (but the default Todo template works the same way) to create a link in the resultant file to the text that was selected when org-capture was invoked. This allows me to go to my TODO item - that was created by org-capture - where the originally selected text is now a link to the position in the file from where org-capture was called.

My question is, how can I see - from the original file, line or header in org mode - all the links that are pointing to that particular place?

My use cases are, for instance:

  • I would like to navigate to notes I've made for a particular group of clock entries
  • I would like to see all the linked TODO's for a particular line of code
0

There is no way to do that within org-mode that I can see.

If you can modify the target file, you can add "backward" links: that's probably ugly and will not work in general, since you probably don't want to add to your code file N backlinks to the N TODO items that link to that piece of code.

If you have a single org file (or a small set of org files) that contains the links, you can search for the text (or the filename/line number combination) that they link to: they are text files after all. TYou can do this without any coding, so this is probably the easiest way if the requirements are met.

Another way is to create an indexing file: it would basically store the target (selected text, pathname, line number) would be used as the key for an entry and the set of backlinks to all the places that link to it would be used as the value for that index entry. The org-capture template would search this file for the target and add a backlink if the target is found; otherwise create a new entry. You could then write a function that could be invoked on some selected text in a file somewhere: the function could do a fuzzy search for this target in the indexing file and return the set of backlinks.

None of this is trivial.

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.