From 9f1042852a0362a55f34ff7c5846edb0246e7480 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Fri, 20 Jan 2017 09:31:49 +0000 Subject: [PATCH] Add option for missing subject replacement If you replied to an email which had no subject, then mutt defaulted to the hard-coded string "Re: your mail". This has been replaced by a config variable '$empty_subject' Closes #299 --- globals.h | 1 + init.h | 6 ++++++ send.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/globals.h b/globals.h index cf9b6d501..4bd58852a 100644 --- a/globals.h +++ b/globals.h @@ -50,6 +50,7 @@ WHERE char *DisplayFilter; WHERE char *DsnNotify; WHERE char *DsnReturn; WHERE char *Editor; +WHERE char *EmptySubject; WHERE char *EscChar; WHERE char *FolderFormat; WHERE char *ForwFmt; diff --git a/init.h b/init.h index 495da23ed..6dafd0d09 100644 --- a/init.h +++ b/init.h @@ -803,6 +803,12 @@ struct option_t MuttVars[] = { ** .pp ** where \fIstring\fP is the expansion of \fC$$editor\fP described above. */ + { "empty_subject", DT_STR, R_NONE, UL &EmptySubject, UL "Re: your mail" }, + /* + ** .pp + ** This varaible specifies the subject to be used when replying to an email + ** with an empty subject. It defaults to "Re: your mail". + */ { "encode_from", DT_BOOL, R_NONE, OPTENCODEFROM, 0 }, /* ** .pp diff --git a/send.c b/send.c index aa98a438e..b76a65338 100644 --- a/send.c +++ b/send.c @@ -683,7 +683,7 @@ void mutt_make_misc_reply_headers (ENVELOPE *env, CONTEXT *ctx, sprintf (env->subject, "Re: %s", curenv->real_subj); /* __SPRINTF_CHECKED__ */ } else if (!env->subject) - env->subject = safe_strdup ("Re: your mail"); + env->subject = safe_strdup (EmptySubject); } void mutt_add_to_reference_headers (ENVELOPE *env, ENVELOPE *curenv, LIST ***pp, LIST ***qq) -- 2.40.0