Function: org-rmail-store-link
org-rmail-store-link is a byte-compiled function defined in
ol-rmail.el.gz.
Signature
(org-rmail-store-link &optional INTERACTIVE?)
Documentation
Store a link to an Rmail folder or message.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ol-rmail.el.gz
;; Implementation
(defun org-rmail-store-link (&optional _interactive?)
"Store a link to an Rmail folder or message."
(when (or (eq major-mode 'rmail-mode)
(eq major-mode 'rmail-summary-mode))
(save-window-excursion
(save-restriction
(when (eq major-mode 'rmail-summary-mode)
(rmail-show-message rmail-current-message))
(when (fboundp 'rmail-narrow-to-non-pruned-header)
(rmail-narrow-to-non-pruned-header))
(when (eq rmail-header-style 'normal)
(rmail-toggle-header -1))
(let* ((folder buffer-file-name)
(message-id (mail-fetch-field "message-id"))
(from (mail-fetch-field "from"))
(to (mail-fetch-field "to"))
(subject (mail-fetch-field "subject"))
(date (mail-fetch-field "date"))
desc link)
(org-link-store-props
:type "rmail" :from from :to to :date date
:subject subject :message-id message-id)
(setq message-id (org-unbracket-string "<" ">" message-id))
(setq desc (org-link-email-description))
(setq link (concat "rmail:" folder "#" message-id))
(org-link-add-props :link link :description desc)
(rmail-show-message rmail-current-message)
link)))))