From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: anyway to create link to a line number in a file Date: Tue, 21 Feb 2012 12:29:49 -0500 Message-ID: <24089.1329845389@alphaville> References: <9088.1329586287@alphaville> <4472.1329602285@alphaville> <8630.1329717509@alphaville> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RztXL-0002tu-H0 for emacs-orgmode@gnu.org; Tue, 21 Feb 2012 12:30:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RztXF-000124-NM for emacs-orgmode@gnu.org; Tue, 21 Feb 2012 12:29:59 -0500 Received: from g1t0029.austin.hp.com ([15.216.28.36]:29645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RztXF-00011o-Fb for emacs-orgmode@gnu.org; Tue, 21 Feb 2012 12:29:53 -0500 In-Reply-To: Message from Not To Miss of "Tue\, 21 Feb 2012 12\:16\:51 EST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Not To Miss Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Not To Miss 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. > > >=20=20=20=20 > 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? >=20 > 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.=20 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.=C2=A0 >=20 Yup. Nick