- publishing free software manuals
The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
ISBN 9781906966089
RRP £9.95 ($14.95)

Sales of this book support the Org project! Get a printed copy>>>

4.7 Search options in file links

File links can contain additional information to make Emacs jump to a particular location in the file when following a link. This can be a line number or a search option after a double(33) colon. For example, when the command C-c l creates a link (see section 4.4 Handling links) to a file, it encodes the words in the current line as a search string that can be used to find this line back later when following the link with C-c C-o.

Here is the syntax of the different ways to attach a search to a file link, together with an explanation:

[[file:~/xx.org::My Target]]
[[file:~/xx.org::*My Target]]
Jump to line 255.
My Target
Search for a link target ‘<<My Target>>’, or do a text search for ‘my target’, similar to the search in internal links, see section 4.2 Internal links. In HTML export (see section 12.5 HTML export), such a file link will become an HTML reference to the corresponding named anchor in the linked file.
*My Target
In an Org file, restrict search to headlines.
Link to a heading with a CUSTOM_ID property
Do a regular expression search for regexp. This uses the Emacs command occur to list all matches in a separate window. If the target file is in Org-mode, org-occur is used to create a sparse tree with the matches.

As a degenerate case, a file link with an empty file name can be used to search the current file. For example, [[file:::find me]] does a search for ‘find me’ in the current file, just as ‘[[find me]]’ would.

ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition