mu4e: Add optional message plist arg to mu4e--org-store-link-message

This change makes it possible to use the function in an mu4e action.
This commit is contained in:
John Hamelink 2023-03-07 00:58:12 +00:00
parent 617c8129ae
commit 26ff8e539a
No known key found for this signature in database
GPG Key ID: 153DDFE9A54A9A4C
1 changed files with 4 additions and 3 deletions

View File

@ -78,10 +78,11 @@ the current query; otherwise, it links to the message at point.")
:link (concat "mu4e:query:" (mu4e-last-query))
:description (format "[%s]" (mu4e-last-query))))
(defun mu4e--org-store-link-message ()
"Store a link to a mu4e message."
(defun mu4e--org-store-link-message (&optional msg)
"Store a link to a mu4e message.
If MSG is non-nil, store a link to MSG, otherwise use `mu4e-message-at-point'."
(setq org-store-link-plist nil)
(let* ((msg (mu4e-message-at-point))
(let* ((msg (or msg (mu4e-message-at-point)))
(from (car-safe (plist-get msg :from)))
(to (car-safe (plist-get msg :to)))
(date (format-time-string "%FT%T" (plist-get msg :date)))