From f28113671f789c7d64ae94c2092f5be6870fe311 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 8 Mar 2016 15:57:50 -0800 Subject: [PATCH] Add $resume_draft_files option. When set, draft files are processed the same as when resuming postponed messages. One use of this option is to avoid multiple user-defined headers and signatures being added to the message. (e.g. when -E is used repeatedly on the draft files). --- init.h | 9 +++++++++ mutt.h | 1 + send.c | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/init.h b/init.h index e00308dc..f610fffa 100644 --- a/init.h +++ b/init.h @@ -2461,6 +2461,15 @@ struct option_t MuttVars[] = { ** (possibly undeleted) message whenever a command that modifies the ** current message is executed. */ + { "resume_draft_files", DT_BOOL, R_NONE, OPTRESUMEDRAFTFILES, 0 }, + /* + ** .pp + ** If \fIset\fP, draft files (specified by \fC-H\fP on the command + ** line) are processed similarly to when resuming a postponed + ** message. Recipients are not prompted for; send-hooks are not + ** evaluated; no alias expansion takes place; user-defined headers + ** and signatures are not added to the message. + */ { "reverse_alias", DT_BOOL, R_BOTH, OPTREVALIAS, 0 }, /* ** .pp diff --git a/mutt.h b/mutt.h index 11313329..a290fa64 100644 --- a/mutt.h +++ b/mutt.h @@ -418,6 +418,7 @@ enum OPTREFLOWTEXT, OPTREPLYSELF, OPTRESOLVE, + OPTRESUMEDRAFTFILES, OPTREVALIAS, OPTREVNAME, OPTREVREAL, diff --git a/send.c b/send.c index b986578a..d4ac0377 100644 --- a/send.c +++ b/send.c @@ -1287,7 +1287,8 @@ ci_send_message (int flags, /* send mode */ msg->env->from = set_reverse_name (cur->env); } - if (! (flags & (SENDPOSTPONED|SENDRESEND))) + if (! (flags & (SENDPOSTPONED|SENDRESEND)) && + ! ((flags & SENDDRAFTFILE) && option (OPTRESUMEDRAFTFILES))) { if ((flags & (SENDREPLY | SENDFORWARD)) && ctx && envelope_defaults (msg->env, ctx, cur, flags) == -1) -- 2.40.0