Function: browse-url-mail
browse-url-mail is an autoloaded, interactive and byte-compiled
function defined in browse-url.el.gz.
Signature
(browse-url-mail URL &optional NEW-WINDOW)
Documentation
Open a new mail message buffer within Emacs for the RFC 2368 URL.
Default to using the mailto: URL around or before point as the recipient's address. Supplying a non-nil interactive prefix argument will cause the mail to be composed in another window rather than the current one.
When called interactively, if variable browse-url-new-window-flag is
non-nil use compose-mail-other-window, otherwise compose-mail. A
non-nil interactive prefix argument reverses the effect of
browse-url-new-window-flag.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of browse-url-new-window-flag.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
;;;###autoload
(defun browse-url-mail (url &optional new-window)
"Open a new mail message buffer within Emacs for the RFC 2368 URL.
Default to using the mailto: URL around or before point as the
recipient's address. Supplying a non-nil interactive prefix argument
will cause the mail to be composed in another window rather than the
current one.
When called interactively, if variable `browse-url-new-window-flag' is
non-nil use `compose-mail-other-window', otherwise `compose-mail'. A
non-nil interactive prefix argument reverses the effect of
`browse-url-new-window-flag'.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "Mailto URL: "))
(save-excursion
(let* ((alist (rfc6068-parse-mailto-url url))
(to (assoc "To" alist))
(subject (assoc "Subject" alist))
(body (assoc "Body" alist))
(rest (delq to (delq subject (delq body alist))))
(to (cdr to))
(subject (cdr subject))
(body (cdr body))
(mail-citation-hook (unless body mail-citation-hook)))
(if (browse-url-maybe-new-window new-window)
(compose-mail-other-window to subject rest nil
(list 'insert-buffer (current-buffer)))
(compose-mail to subject rest nil nil
(list 'insert-buffer (current-buffer))))
(when body
(goto-char (point-min))
(unless (or (search-forward (concat "\n" mail-header-separator "\n")
nil 'move)
(bolp))
(insert "\n"))
(goto-char (prog1
(point)
(insert (string-replace "\r\n" "\n" body))
(unless (bolp)
(insert "\n"))))))))