mu4e-compose: bring back mu4e-compose-attach-captured-message

It went missing after the compose refactoring.

Fixes #2654.
This commit is contained in:
Dirk-Jan C. Binnema 2024-03-04 10:48:45 +02:00
parent 4cac4a415c
commit 2423c38d98
1 changed files with 14 additions and 0 deletions

View File

@ -192,6 +192,20 @@ messages, it is nil.")
(defvar-local mu4e-compose-type nil
"The compose-type for the current message.")
(defvar mu4e-captured-message)
(defun mu4e-compose-attach-captured-message ()
"Insert the last captured message file as an attachment.
Messages are captured with `mu4e-action-capture-message'."
(interactive)
(if-let* ((msg mu4e-captured-message)
(path (plist-get msg :path))
(path (and (file-exists-p path) path)))
(mml-attach-file
path
"message/rfc822"
(or (plist-get msg :subject) "No subject")
"attachment")
(mu4e-warn "No valid message has been captured")))
;;; Filenames
(defun mu4e--message-basename()