emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Scott Otterson <scotto@u.washington.edu>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode@gnu.org
Subject: Re: bug in org-store-link
Date: Wed, 27 Feb 2008 11:05:00 -0800	[thread overview]
Message-ID: <47C5B45C.3020703@u.washington.edu> (raw)
In-Reply-To: <C0E24317-4DD1-4729-9E66-78D69FACF1F0@science.uva.nl>

Yeah, I guess that instead of saying it was a small bug, I should have 
said that it's a bug of small consequence (for most users, but matters 
to me, least). 

The ambiguity problem you mention could be solved by matching more than 
one line.  To keep the string stored in the org link short, 
org-store-link could expand it to another line only when needed for a 
unique match.  Or, it could expand just enough _words_ to ensure 
uniqueness, plus maybe one word on each end for some insurance against 
future changes.

Future changes are the harder part.  In speech recognition, there's an 
analogous problem where there's a need to match a transcript to 
recognized speech, which may have a lot of word errors, insertions and 
deletions.  The simplest solution commonly employed is a word-level 
Levenshtein distance:

    http://en.wikipedia.org/wiki/Levenshtein_distance
    (this is for chars, but you get the idea)

Scott

Carsten Dominik wrote:
> Hi Scott, this is not a small bug, but a problem that is really hard 
> to solve.
> Supposed I used the exact line text to search, then you still have two 
> lines in the buffer
> that would match.
>
> This is really about what strategy should be used to find a location
> in a file that has possibly changed.
> I have no good answer to that.  Do you?
>
> - Carsten 

      parent reply	other threads:[~2008-02-27 19:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26 20:40 bug in org-store-link Scott Otterson
2008-02-27 14:55 ` Carsten Dominik
2008-02-27 16:20   ` Nick Dokos
2008-02-27 20:28     ` Scott Otterson
2008-02-27 20:57       ` Phil Jackson
2008-02-27 23:05         ` Carsten Dominik
2008-02-27 19:05   ` Scott Otterson [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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=47C5B45C.3020703@u.washington.edu \
    --to=scotto@u.washington.edu \
    --cc=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).