From ab8742e0e0b33de1592cb44d0e1e4d3955694544 Mon Sep 17 00:00:00 2001 From: Ritho Date: Sat, 27 May 2023 02:59:41 +0200 Subject: [PATCH] Add a custom variable to decide if we can edit any message or just a draft message. Signed-off-by: Ritho --- mu4e/mu4e-compose.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 2e91aff9..badddd88 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -81,6 +81,15 @@ ;;; Configuration ;; see mu4e-drafts.el +(defcustom mu4e-allow-edit-any-message nil + "Whether to allow to edit any message or just the draft messages. +Setting this to t allows any message to be edited, not just the draft messages. + +Changes to this value only take effect after (re)starting the mu +session." + :type 'boolean + :group 'mu4e) + ;;; Attachments (defun mu4e-compose-attach-message (msg) "Insert message MSG as an attachment." @@ -736,6 +745,7 @@ Symbol `edit' is only allowed for draft messages." (unless (member compose-type '(reply forward edit resend new)) (mu4e-error "Invalid compose type '%S'" compose-type)) (when (and (eq compose-type 'edit) + (not (eq mu4e-allow-edit-any-message 't)) (not (member 'draft (mu4e-message-field msg :flags)))) (mu4e-warn "Editing is only allowed for draft messages"))