In my attempt to clarify some inconclusive topics and a part of the series "did anybody succeed" (e.g. Did anyone succeed in playing embedded movies inside Acrobat in Linux?), here it is a new question:
Did anybody, with a certain combination of PDF viewer and editor in any system (e.g. GNU/Linux), succeeded in creating and opening links in the PDF that open a text file at a certain line?
What exact combination of editor (e.g. gedit, emacs, vim) and viewer (e.g. evince, acrobat) and settings (e.g. security settings in acrobat) did you use?
My current strategy is to use the command
\href{run:textfile.txt}{Link to text file (line 20)}
of course, that doesn't bring the cursor to the correct line, I have to search for the line manually. (It does this both in Evince and Acrobat after confirmation).
The question, is how to do the same but opening a certain line in the text. My failed attempt is to
\href{run:/usr/bin/gedit +20 textfile.txt}{Link to text file (line 20)}
by trying to exploit the command line option that allows to open the file in a certain line. The fact is that this doesn't even work because it is not recognized as command line, (in evince, "Error when getting information for file '/usr/bin/gedit +20 textfile.txt': No such file or directory." , in acrobat: "Could not open the file '/usr/bin/gedit +20 textfile.txt'"
I even though about hijacking the "inverse search" feature that some viewers/editors have to make it link back to any arbitrary line or file from a position in the PDF), but I don't know where to begin (for now, I don't care how involved the code is for the solution, as long as it works with an existing viewer and editor)
(For illustration, I am using Acrobat 9.4.1 in GNU/Linux, Evince 3.8.3, and gedit 3.8.3)
(Some previous inconclusive answers: https://tex.stackexchange.com/a/2982/1871 and https://tex.stackexchange.com/a/123982/1871)
Edit: Clarification: I don't want to link to the TeX source but to an arbitrary text file.
Edit 2: Doing some research, I found that, in principle, Javascript can execute an external program (perhaps after disabling some security wall), and Javascript can be embedded in the PDF. Could this be the answer? (at least for Acrobat viewer)
vi,emacsandgedit). However on the same linessynctex(I don't know its internals) precisely has precisely this feature (although limited to the source file.) – alfC Sep 12 '13 at 02:10