From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Otterson Subject: Re: internal links don't match other links Date: Tue, 16 Jan 2007 11:13:19 -0800 Message-ID: <45AD23CF.1060902@u.washington.edu> References: <45ABB9C5.9000306@u.washington.edu> <6bcd2d4e525de837d1e64af6ed37478b@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6tkK-0006TH-Ug for emacs-orgmode@gnu.org; Tue, 16 Jan 2007 14:13:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6tkJ-0006T5-9n for emacs-orgmode@gnu.org; Tue, 16 Jan 2007 14:13:23 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6tkJ-0006T2-37 for emacs-orgmode@gnu.org; Tue, 16 Jan 2007 14:13:23 -0500 Received: from [140.142.32.135] (helo=mxout5.cac.washington.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H6tkI-0005mD-5K for emacs-orgmode@gnu.org; Tue, 16 Jan 2007 14:13:22 -0500 In-Reply-To: <6bcd2d4e525de837d1e64af6ed37478b@science.uva.nl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org 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 >>