* mu4e/org-mu4e.el (org-mu4e-store-link): Add capture template keywords
For other email links (e.g., wl, mh, gnus), a number of keywords are defined in org capture templates. This makes these keywords available for use in captures from mu4e. http://orgmode.org/manual/Template-expansion.html Inspiration from Roelof Burger https://groups.google.com/d/msg/mu-discuss/4sffZofVKAY/aVTdVYoVyiUJ
This commit is contained in:
@ -75,14 +75,38 @@ Example usage:
|
|||||||
;; storing links to messages
|
;; storing links to messages
|
||||||
((eq major-mode 'mu4e-view-mode)
|
((eq major-mode 'mu4e-view-mode)
|
||||||
(let* ((msg (mu4e-message-at-point))
|
(let* ((msg (mu4e-message-at-point))
|
||||||
(msgid (or (plist-get msg :message-id) "<none>"))
|
(msgid (or (plist-get msg :message-id) "<none>"))
|
||||||
link)
|
(from (or (plist-get msg :from) '(("none" . "none"))))
|
||||||
(org-store-link-props :type "mu4e" :link link
|
(fromname (car (car from)))
|
||||||
:message-id msgid)
|
(fromaddress (cdr (car from)))
|
||||||
(setq link (concat "mu4e:msgid:" msgid))
|
(to (or (plist-get msg :to) '(("none" . "none"))))
|
||||||
(org-add-link-props :link link
|
(toname (car (car to)))
|
||||||
:description (funcall org-mu4e-link-desc-func msg))
|
(toaddress (cdr (car to)))
|
||||||
link))))
|
(fromto (if (mu4e-user-mail-address-p fromaddress)
|
||||||
|
(format "to %s <%s>" toname toaddress)
|
||||||
|
(format "from %s <%s>" fromname fromaddress)))
|
||||||
|
(date (plist-get msg :date))
|
||||||
|
(date-ts (format-time-string (org-time-stamp-format t) date))
|
||||||
|
(date-ts-ia (format-time-string (org-time-stamp-format t t) date))
|
||||||
|
(subject (or (plist-get msg :subject) "<none>"))
|
||||||
|
link)
|
||||||
|
(org-store-link-props :type "mu4e" :link link
|
||||||
|
:message-id msgid)
|
||||||
|
(setq link (concat "mu4e:msgid:" msgid))
|
||||||
|
(org-add-link-props :link link
|
||||||
|
:to (format "%s <%s>" toname toaddress)
|
||||||
|
:toname toname
|
||||||
|
:toaddress toaddress
|
||||||
|
:from (format "%s <%s>" fromname fromaddress)
|
||||||
|
:fromname fromname
|
||||||
|
:fromaddress fromaddress
|
||||||
|
:fromto fromto
|
||||||
|
:date date-ts-ia
|
||||||
|
:date-timestamp date-ts
|
||||||
|
:date-timestamp-inactive date-ts-ia
|
||||||
|
:subject subject
|
||||||
|
:description (funcall org-mu4e-link-desc-func msg))
|
||||||
|
link))))
|
||||||
|
|
||||||
(org-add-link-type "mu4e" 'org-mu4e-open)
|
(org-add-link-type "mu4e" 'org-mu4e-open)
|
||||||
(add-hook 'org-store-link-functions 'org-mu4e-store-link)
|
(add-hook 'org-store-link-functions 'org-mu4e-store-link)
|
||||||
|
|||||||
Reference in New Issue
Block a user