From 1e3cb91ccb8ec3655aadd9309a7b5a7cf9b1ccfa Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 18 Apr 2013 17:27:17 +0200 Subject: [PATCH] org.el (org-store-link): Don't add a search string when storing a link from a radio target * org.el (org-store-link): Don't add a search string when storing a link from a radio target. (org-open-at-point): Jump to the radio link (<<>>), not to the simple target (<>). --- lisp/org.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1ceeda21c..b41185ea1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9466,8 +9466,8 @@ active region." ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode)) (setq custom-id (org-entry-get nil "CUSTOM_ID")) (cond - ;; Store a link using the radio target at point - ((org-in-regexp "<<\\(.*?\\)>>") + ;; Store a link using the target at point + ((org-in-regexp "[^<]<<\\([^<>]+\\)>>[^>]" 1) (setq cpltxt (concat "file:" (abbreviate-file-name @@ -10329,7 +10329,10 @@ application the system uses for this file type." (or (previous-single-property-change pos 'org-linked-text) (point-min)) (or (next-single-property-change pos 'org-linked-text) - (point-max)))) + (point-max))) + ;; Ensure we will search for a <<>> link, not + ;; a simple reference like <> + path (concat "<" path)) (throw 'match t)) (save-excursion