From eedee465f7a673571db89db6443c93420b24103b Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Sat, 22 Sep 2012 11:18:06 +0200 Subject: [PATCH] org.el (org-insert-link): Call `org-link-try-special-completion' from the original buffer * org.el (org-insert-link): Call `org-link-try-special-completion' from the original buffer. TINYCHANGE --- lisp/org.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index f30ba3ff8..fe63b62f1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9418,6 +9418,7 @@ If the DEFAULT-DESCRIPTION parameter is non-nil, this value will be used as the default description." (interactive "P") (let* ((wcf (current-window-configuration)) + (origbuf (current-buffer)) (region (if (org-region-active-p) (buffer-substring (region-beginning) (region-end)))) (remove (and region (list (region-beginning) (region-end)))) @@ -9493,7 +9494,8 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (and (equal ":" (substring link -1)) (member (substring link 0 -1) all-prefixes) (setq link (substring link 0 -1)))) - (setq link (org-link-try-special-completion link)))) + (setq link (with-current-buffer origbuf + (org-link-try-special-completion link))))) (set-window-configuration wcf) (kill-buffer "*Org Links*")) (setq entry (assoc link org-stored-links))