Merge pull request #2440 from johnhamelink/feature/optional-msg-plist-arg-for-mu4e--org-store-link-message

mu4e: Add optional message plist arg to mu4e--org-store-link-message
This commit is contained in:
Dirk-Jan C. Binnema 2023-03-08 10:20:00 +02:00 committed by GitHub
commit 758458d293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)))