3

I'd like to create a link inside an org-mode file to a source code file, say in C++. But I'd like the link to point to a possibly changing position in the file, so I want to use a unique identifier. For example, say the C++ file is as follows:

// {{{ 507ab9d0-d1a5-4fa9-97a9-d78a48a08c3d
<some content>
// }}}

I want to create a link that takes me to 507ab9d0-d1a5-4fa9-97a9-d78a48a08c3d. Can this be done in org-mode? I've been looking at org-id [1], but to the lay person, it does not seem to fit this use case.

[1] https://github.com/tkf/org-mode/blob/master/lisp/org-id.el

1
8

You can use a file link like this:

file:f1.cpp::507ab9d0-d1a5-4fa9-97a9-d78a48a08c3d

It should open the file and then search for the string you put in.

1

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.