added defcustom org-mu4e-link-description

Allows the user to customise the org link, e.g.
(setq org-mu4e-link-description '(concat date " " subject))
This commit is contained in:
Myles English 2012-07-26 15:12:56 +01:00
parent a75664b955
commit fdbc20f04b
1 changed files with 17 additions and 2 deletions

View File

@ -32,6 +32,17 @@
(eval-when-compile (require 'cl))
(eval-when-compile (require 'mu4e))
(defgroup org-mu4e nil
"Settings for the org interface."
:group 'org-mu4e)
(defcustom org-mu4e-link-description 'subject
"How to make the org-mode link description."
:type 'string
:group 'org-mu4e)
;;(setq org-mu4e-link-description '(concat date " " subject))
(defun org-mu4e-store-link ()
"Store a link to a mu4e query or message."
(cond
@ -51,11 +62,15 @@
(let* ((msg (mu4e-message-at-point))
(msgid (or (plist-get msg :message-id) "<none>"))
(subject (or (plist-get msg :subject) "No subject"))
(date (or (format-time-string mu4e-headers-date-format
(mu4e-msg-field msg :date))
"No date"))
link)
(org-store-link-props :type "mu4e" :link link
:message-id msgid :subject subject)
:message-id msgid :subject subject :date date)
(setq link (org-make-link "mu4e:msgid:" msgid))
(org-add-link-props :link link :description subject)
(org-add-link-props :link link
:description (eval org-mu4e-link-description))
link))))
(org-add-link-type "mu4e" 'org-mu4e-open)