From 2423c38d9885cf1e2a3a395be4cb6e054a9c2816 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 4 Mar 2024 10:48:45 +0200 Subject: [PATCH] mu4e-compose: bring back mu4e-compose-attach-captured-message It went missing after the compose refactoring. Fixes #2654. --- mu4e/mu4e-compose.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index cc40eff0..6dae1ec6 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -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()