Re: [Orgmode] [PATCH] Quote any special characters in org-make-target-link-regexp

2010-12-16 Thread Carsten Dominik

Lawrence,

thanks for the patch, with flawless ChangeLog and commit message!

Patch accepted.

- Carsten


On Dec 14, 2010, at 4:01 PM, Lawrence Mitchell wrote:


* 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


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] Quote any special characters in org-make-target-link-regexp

2010-12-15 Thread 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


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode