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: internal links don't match other links
Date: Tue, 16 Jan 2007 11:13:19 -0800	[thread overview]
Message-ID: <45AD23CF.1060902@u.washington.edu> (raw)
In-Reply-To: <6bcd2d4e525de837d1e64af6ed37478b@science.uva.nl>

Can't a self-match just be excluded from the list of matches?  I don't 
know elisp regexps but in perl, the regexp would be:

    $match = $string =~/$description/ && $string !~ /\[\[$description\]\]/;

This would match on $description in plain text or in external links and 
would exclude internal links.  This would be perfect for my uses 
although it's somewhat inconsistent because internal self links match on 
any plain text and this would be broadening that to only one type of 
link.   On the other hand, the current behavior is also inconsistent 
(doesn't match on any links).   For perfect consistency, I guess you 
could match on everything and then filter match positions to remove self 
matches.  This is probably harder, anyway, I think the semi-consistent 
approach is likely to be better for most use cases.

Well, you have excellent user interface taste, so I won't complain if 
you don't think this is worth your time!

Scott

Carsten Dominik (1/15/2007 1:21 PM) wrote:
> That is on purpose, or a link would always find itself.
>
> - Carsten
>
> On Jan 15, 2007, at 18:28, Scott Otterson wrote:
>
>> In org-mode 4.61, internal links don't match on external link 
>> description text.  Here's an example org file
>>
>> --------------------------
>> * head1
>> an internal link that should match the external link: [[BBC story]]
>> * head2
>> [[http://news.bbc.co.uk/2/hi/americas/6262555.stm][BBC story]]
>> * head3
>> --------------------------
>>
>> The behavior I was expecting was that a C-c C-o on the text "BBC 
>> story" under head1 would move the cursor to the link under head2.
>>
>> When I'm writing big org files, I often create one headline per 
>> article I've read, and underneath it, I put an external link to the 
>> article and a bunch of text summarizing what I found interesting 
>> about it.  In other parts of the outline, I've tried to use internal 
>> links to refer to that headline but I can't get it to work.
>>
>> Scott
>>

  reply	other threads:[~2007-01-16 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 17:28 internal links don't match other links Scott Otterson
2007-01-15 21:06 ` DSPAM " Bastien
2007-01-15 21:21 ` Carsten Dominik
2007-01-16 19:13   ` Scott Otterson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-15 17:26 Scott Otterson

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=45AD23CF.1060902@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).