Browse Source

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.
Oleh 11 years ago
parent
commit
9a0e84fbd7
1 changed files with 8 additions and 2 deletions
  1. 8 2
      lisp/org.el

+ 8 - 2
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