diff options
author | Bastien Guerry <bzg@altern.org> | 2012-08-11 09:11:55 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-08-11 09:11:55 +0200 |
commit | 73c1948c15669c9900499247cccfee12243eec1e (patch) | |
tree | b1b410dd1b9e1683ddb3d03f3fc2df180ab92e62 | |
parent | 16b2af9fdb08973634d9b69bf80d426824e1ee11 (diff) | |
download | org-mode-73c1948c15669c9900499247cccfee12243eec1e.tar.gz |
org.el (org-store-link, org-open-at-point): New link type "help"
* org.el (org-store-link, org-open-at-point): New link type
"help".
-rw-r--r-- | lisp/org.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/org.el b/lisp/org.el index b9d0106..bf64f93 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8844,6 +8844,13 @@ For file links, arg negates `org-context-in-file-links'." nil nil nil)))) (org-store-link-props :type "calendar" :date cd))) + ((eq major-mode 'help-mode) + (setq link (concat "help:" (save-excursion + (goto-char (point-min)) + (looking-at "^[^ ]+") + (match-string 0)))) + (org-store-link-props :type "help")) + ((eq major-mode 'w3-mode) (setq cpltxt (if (and (buffer-name) (not (string-match "Untitled" (buffer-name)))) @@ -9722,6 +9729,8 @@ application the system uses for this file type." (setq type "file" path link)) ((string-match org-link-re-with-space3 link) (setq type (match-string 1 link) path (match-string 2 link))) + ((string-match "^help:+\\(.+\\)" link) + (setq type "help" path (match-string 1 link))) (t (setq type "thisfile" path link))) (throw 'match t))) @@ -9775,6 +9784,14 @@ application the system uses for this file type." ((assoc type org-link-protocols) (funcall (nth 1 (assoc type org-link-protocols)) path)) + ((equal type "help") + (let ((f-or-v (intern path))) + (cond ((fboundp f-or-v) + (describe-function f-or-v)) + ((boundp f-or-v) + (describe-variable f-or-v)) + (t (error "Not a known function or variable"))))) + ((equal type "mailto") (let ((cmd (car org-link-mailto-program)) (args (cdr org-link-mailto-program)) args1 |