From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: [PATCH] Quote any special characters in org-make-target-link-regexp Date: Tue, 14 Dec 2010 15:01:59 +0000 Message-ID: <1292338919-22555-1-git-send-email-wence@gmx.li> Return-path: Received: from [140.186.70.92] (port=56693 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSWOQ-0005hl-MX for emacs-orgmode@gnu.org; Tue, 14 Dec 2010 10:02:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSWOP-00067p-2k for emacs-orgmode@gnu.org; Tue, 14 Dec 2010 10:02:18 -0500 Received: from e450.epcc.ed.ac.uk ([129.215.56.230]:54757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSWOO-00065w-Rn for emacs-orgmode@gnu.org; Tue, 14 Dec 2010 10:02:17 -0500 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: emacs-orgmode@gnu.org Cc: Lawrence Mitchell * lisp/org.el (org-make-target-link-regexp): regexp-quote target before replacing whitespace. Previously a radio link <<<...>>> would match all three-letter words in the buffer. The manual indicates the radio links are meant to match literally (modulo whitespace differences), so we should regexp-quote all the targets to avoid over-eager matching. --- This problem bit me when writing up some notes on CUDA, which uses <<<...>>> to indicate a function call from a CPU onto a GPU. I think this is the right fix, since I can't imagine a situation where you would want <<>> to match foo.bar, rather than foo\\.bar. lisp/org.el | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 6d1062c..5733d67 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5424,6 +5424,7 @@ between words." "\\<\\(" (mapconcat (lambda (x) + (setq x (regexp-quote x)) (while (string-match " +" x) (setq x (replace-match "\\s-+" t t x))) x) -- 1.7.3.3.398.g0b0cd