How to make a link to external file line in Emacs org-mode

user4035 picture user4035 · Aug 22, 2012 · Viewed 8.3k times · Source

I have 2 files:

  1. php file with code
  2. org file with docs

How to create a link to a line in php file from org file? So clicking it will move the cursor to the appropriate line in php file.

Answer

choroba picture choroba · Aug 22, 2012

Use this notation in the org mode to create a link:

[[/path/to/file.php::line][string-to-display]]

If you want the file name to be displayed, use just

[[/path/to/file.php::line]]

See Hyperlinks in the Org mode Info page for details and other ways to specify links.