all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Not To Miss <not.to.miss@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: anyway to create link to a line number in a file
Date: Tue, 21 Feb 2012 12:29:49 -0500	[thread overview]
Message-ID: <24089.1329845389@alphaville> (raw)
In-Reply-To: Message from Not To Miss <not.to.miss@gmail.com> of "Tue\, 21 Feb 2012 12\:16\:51 EST." <CAAp=d8ofiU2HvDXbXBxO_NOKp0N_j_iWxjMV+xq=N4V340rjBw@mail.gmail.com>

Not To Miss <not.to.miss@gmail.com> 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

      reply	other threads:[~2012-02-21 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17 16:54 anyway to create link to a line number in a file Not To Miss
2012-02-18 14:03 ` Sean O'Halpin
2012-02-18 16:31   ` Not To Miss
2012-02-18 17:11     ` Eric Schulte
2012-02-18 17:30       ` Not To Miss
2012-02-18 17:31     ` Nick Dokos
2012-02-18 21:58       ` Nick Dokos
2012-02-20  4:43         ` Not To Miss
2012-02-20  5:58           ` Nick Dokos
2012-02-21 17:16             ` Not To Miss
2012-02-21 17:29               ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24089.1329845389@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=not.to.miss@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.