0

I want to create links to marked regions of text inside org files. if I use C-c l the active region is ignored; only the heading is stored.

How can I create a link to a region of text?

I use org-mode 9.5 with Emacs 29.0.50. running on fedora 35.

1
  • I cannot reproduce with Org 9.5.2: without an active region, the link is a headline link, but with an active region, the link is a file link with a text search for the text of the active region (of course, if there are multiple instances, that's only going to get you to the first instance, not the instance you actually used).
    – NickD
    May 26 at 22:13

2 Answers 2

0

From the manual (info "(org) External Links"):

‘file’
     File links.  File name may be remote, absolute, or relative.

     Additionally, you can specify a line number, or a text search.
2
  • i just checked here, but it does not work. double check with emacs -Q and also it does not work. my org-version is 9.5.3-6. therefore i think that my usage is not correct. for example: i mark a line with C-a and C-e. cursor is at the end of line. now i call org-store-link. if i call org-insert-link with file prefix, emacs wants to open a file for linking. no region, only the link to the file. any ideas?
    – space_held
    May 27 at 17:24
  • if i store the link with marked region, it is saved with <id:xxxxxx>. if i call C-c C-l i can see, that the link is there under id: prefix, not file: is this correct?
    – space_held
    May 27 at 17:55
0

today i find out the culprit. the variable org-id-link-to-org-use-id. i have to set to nil. now it works as expected and you write.

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.