diff options
authorNicolas Goaziou <>2014-04-17 19:44:50 (GMT)
committer Nicolas Goaziou <>2014-04-17 19:44:50 (GMT)
commitb9f2e17f07faf01109fc6f7f1eb5a34e0f97eafb (patch)
parent2b2b2c5c99753cf71309ae8a82be915875ad5186 (diff)
Better handling for "mailto" linksHEADmaster
* lisp/org.el (org-link-mailto-program): Remove variable. (org-open-at-point): Delegate "mailto" links handling to `browse-url' and `browse-url-mailto-function'. This patch allows to use regular URI syntax and deprecates old Org specific syntax: mailto:user@domain::Title.
1 files changed, 2 insertions, 30 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 76e00ac..8314901 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1983,19 +1983,6 @@ window on that directory."
:group 'org-link-follow
:type 'boolean)
-(defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
- "Function and arguments to call for following mailto links.
-This is a list with the first element being a Lisp function, and the
-remaining elements being arguments to the function. In string arguments,
-%a will be replaced by the address, and %s will be replaced by the subject
-if one was given like in < subject>."
- :group 'org-link-follow
- :type '(choice
- (const :tag "browse-url" (browse-url-mail "mailto:%a?subject=%s"))
- (const :tag "compose-mail" (compose-mail "%a" "%s"))
- (const :tag "message-mail" (message-mail "%a" "%s"))
- (cons :tag "other" (function) (repeat :tag "argument" sexp))))
(defcustom org-confirm-shell-link-function 'yes-or-no-p
"Non-nil means ask for confirmation before executing shell links.
Shell links can be dangerous: just think about a link
@@ -10605,29 +10592,14 @@ is used internally by `org-open-link-from-string'."
(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))
- (spec
- (format-spec-make
- ?a path ; %a is address.
- ?s (let ((option ; %s is subject.
- (org-element-property
- :search-option context)))
- (if (not option) "" (org-link-escape option)))))
- final-args)
- (apply cmd
- (dolist (arg args (nreverse final-args))
- (if (not (stringp arg)) (push arg final-args)
- (push (format-spec arg spec) final-args))))))
- ((member type '("http" "https" "ftp" "news"))
+ ((member type '("http" "https" "ftp" "mailto" "news"))
(browse-url (org-link-escape-browser (concat type ":" path))))
((equal type "doi")
(org-link-escape-browser (concat org-doi-server-url path))))
((equal type "message") (browse-url (concat type ":" path)))
((equal type "shell")
- (let ((buf (generate-new-buffer "*Org Shell Output"))
+ (let ((buf (generate-new-buffer "*Org Shell Output*"))
(cmd path))
(if (or (and (org-string-nw-p