From 90628b45ee4d270b32f8a56618ca75ceb4a16b21 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Mon, 23 Aug 2010 02:32:15 +0530 Subject: [PATCH 2/2] org-store-link: Fix storing of links to headlines in indirect buffers * org.el (org-store-link): Storing of links to headlines in indirect buffers was broken. Fix it. TINYCHANGE --- lisp/org.el | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 5db7aab..15379ef 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8301,13 +8301,14 @@ For file links, arg negates `org-context-in-file-links'." (setq cpltxt (concat "file:" file) link (org-make-link cpltxt)))) - ((and buffer-file-name (org-mode-p)) + ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq custom-id (ignore-errors (org-entry-get nil "CUSTOM_ID"))) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" - (abbreviate-file-name buffer-file-name) + (abbreviate-file-name + (buffer-file-name (buffer-base-buffer))) "::" (match-string 1)) link (org-make-link cpltxt))) ((and (featurep 'org-id) @@ -8329,11 +8330,13 @@ For file links, arg negates `org-context-in-file-links'." (error ;; probably before first headline, link to file only (concat "file:" - (abbreviate-file-name buffer-file-name)))))) + (abbreviate-file-name + (buffer-file-name (buffer-base-buffer)))))))) (t ;; Just link to current headline (setq cpltxt (concat "file:" - (abbreviate-file-name buffer-file-name))) + (abbreviate-file-name + (buffer-file-name (buffer-base-buffer))))) ;; Add a context search string (when (org-xor org-context-in-file-links arg) (setq txt (cond -- 1.7.0.4