mirror of https://github.com/djcb/mu.git
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:
parent
a75664b955
commit
fdbc20f04b
|
@ -32,6 +32,17 @@
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(eval-when-compile (require 'mu4e))
|
(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 ()
|
(defun org-mu4e-store-link ()
|
||||||
"Store a link to a mu4e query or message."
|
"Store a link to a mu4e query or message."
|
||||||
(cond
|
(cond
|
||||||
|
@ -51,11 +62,15 @@
|
||||||
(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>"))
|
||||||
(subject (or (plist-get msg :subject) "No subject"))
|
(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)
|
link)
|
||||||
(org-store-link-props :type "mu4e" :link 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))
|
(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))))
|
link))))
|
||||||
|
|
||||||
(org-add-link-type "mu4e" 'org-mu4e-open)
|
(org-add-link-type "mu4e" 'org-mu4e-open)
|
||||||
|
|
Loading…
Reference in New Issue