summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleh <oleh.krehel@gmail.com>2013-09-07 16:42:02 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2013-09-07 21:16:58 +0200
commit9a0e84fbd7b0e25cf49613e787d572f3c71723dc (patch)
treeeeedf249d1cba44455052bbca4621eefd66c9257
parentffd8dd9f0debb486cb502354e3c3151f927e03a8 (diff)
downloadorg-mode-9a0e84fbd7b0e25cf49613e787d572f3c71723dc.tar.gz
Lazy autoloading of org-id.el to follow links
* lisp/org.el (org-open-at-point): The new code is being run in the same spot as `org-open-link-functions'. In case they failed, check if link matches "^id:" and if so, load the id interface and follwo the link. This fixes Emacs bug#14910: org-mode `org-open-at-point' doesn't follow id links.
-rw-r--r--lisp/org.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 7766277..aebf58f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10535,8 +10535,14 @@ application the system uses for this file type."
(error "Abort"))))
((and (string= type "thisfile")
- (run-hook-with-args-until-success
- 'org-open-link-functions path)))
+ (or (run-hook-with-args-until-success
+ 'org-open-link-functions path)
+ (and (string-match "^id:" link)
+ (or (featurep 'org-id) (require 'org-id))
+ (progn
+ (funcall (nth 1 (assoc "id" org-link-protocols))
+ (substring path 3))
+ t)))))
((string= type "thisfile")
(if arg