Subject: Re: [O] anyway to create link to a line number in a file
Not To Miss <not.to.miss@xxxxxxxxx> wrote:

> > Ideally, it would
> > be great if in the normal stored org link, line number could be
> > included in the link and would be ripped off from the text to search
> > the linked file.
> >
>
> I'm confused - what exactly are you asking for here? If you don't use
> the line number for searching, why would you want to store it?
>
> Because I think sometimes the line number gives valuable information
> in addition to the text. I meant to create a link like
> [[file:foo.txt::123 whatever_text]], when users open the link,
> org-mode searches "whatever_text"; if it doesn't find anything, jump
> to the line 123. The idea behind that is that it is possible the line
> is changed and is unsearchable but still remains in the same line
> number.

I guess the main idea is that it is more likely for the text around the
link to remain the same: the line number can change (e.g. if you add
stuff at the beginning of the file), but the surrounding text will
probably remain the same, so a context search is more likely to find you
what you want. But you are right in that a line number can sometimes
disambiguate things, e.g. the etags functionality in emacs works
(worked? not sure if the implementation is still the same) by using a
position to go to and then searching in ever-widening circles around
that position in order to find the appropriate context. That way,
identical contexts could be used (a necessity for etags) and still be
distinguished from each other.

> This, however, is probably an issue of built-in org-mode
> design, beyond the scope of user customization.Â
>

Yup.

Nick

(C)2011 mailinglist-archive.com