Joseph Turner <[email protected]> writes:
> - When handling "file" type links, check if `org-current-uri-scheme'
> matches one of the keys in `org-link-parameters', and use the
> appropriate handler instead of the "file" handler. (see attached patch
> for an example usage in `org-link-open')
Please ignore the last patch - this one checks for a "file:" prefix.
Joseph
diff --git a/lisp/ol.el b/lisp/ol.el
index 20aab6bb8..947576ddb 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1097,12 +1097,16 @@ (defun org-link-open (link &optional arg)
;; first need to integrate search option, if any.
("file"
(let* ((option (org-element-property :search-option link))
- (path (if option (concat path "::" option) path)))
- (org-link-open-as-file path
- (pcase (org-element-property :application link)
- ((guard arg) arg)
- ("emacs" 'emacs)
- ("sys" 'system)))))
+ (path (if option (concat path "::" option) path))
+ (f (org-link-get-parameter org-current-uri-scheme :follow)))
+ (if (and (not (org-element-property :type-explicit-p link))
+ (functionp f))
+ (funcall f path)
+ (org-link-open-as-file path
+ (pcase (org-element-property :application link)
+ ((guard arg) arg)
+ ("emacs" 'emacs)
+ ("sys" 'system))))))
;; Internal links.
((or "coderef" "custom-id" "fuzzy" "radio")
(unless (run-hook-with-args-until-success 'org-open-link-functions path)