summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Richard <theonewiththeevillook@yahoo.fr>2012-09-22 11:18:06 +0200
committerBastien Guerry <bzg@altern.org>2012-09-22 11:18:06 +0200
commiteedee465f7a673571db89db6443c93420b24103b (patch)
tree5dc199ba003c7449487461cad17d423f6134a83d
parent6e40519811288fd124dff835ecdb76fbd174c7a0 (diff)
downloadorg-mode-eedee465f7a673571db89db6443c93420b24103b.tar.gz
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
-rw-r--r--lisp/org.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index f30ba3f..fe63b62 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))