diff --git a/org.el b/org.el index 1fc081e..c139be1 100644 --- a/org.el +++ b/org.el @@ -968,6 +968,23 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line." The value of this is taken from the #+LINK lines.") (make-variable-buffer-local 'org-link-abbrev-alist-local) +(defcustom org-link-custom-types nil + "Alist of recognized link types. +This types are appended to `org-link-types'. +Each cell is of the form + + \(\"type\" \(follow-function store-function major-mode\)\) + +where \"type\" is the string defining the type, follow-function +is the function that Org will call to follow these links, +store-function the function that Org will use to store these link +and major-mode the major mode where it's active." + :group 'org-link + :type '(repeat (list (string :tag "Type (string) ") + (function :tag "Follow function ") + (function :tag "Store function ") + (function :tag "Active in major mode")))) + (defcustom org-link-abbrev-alist nil "Alist of link abbreviations. The car of each element is a string, to be replaced at the start of a link. @@ -4140,8 +4157,11 @@ that will be added to PLIST. Returns the string that was modified." (require 'font-lock) (defconst org-non-link-chars "]\t\n\r<>") -(defconst org-link-types '("http" "https" "ftp" "mailto" "file" "news" "bbdb" "vm" - "wl" "mhe" "rmail" "gnus" "shell" "info" "elisp")) +(defconst org-link-types + (append (list "http" "https" "ftp" "mailto" "file" "news" "bbdb" "vm" + "wl" "mhe" "rmail" "gnus" "shell" "info" "elisp") + (delq nil (mapcar (lambda(x) (car x)) org-link-custom-types)))) + (defconst org-link-re-with-space (concat " %s" cmd (eval (read cmd))) (error "Abort")))) - (t + ((setq cus (assoc type org-link-custom-types)) + (funcall (nth 1 cus) path)) + + (t (browse-url-at-point))))) (move-marker org-open-link-marker nil))