Prevent "Re: " prepending to subject when replying (patch included)
On Thu, Nov 19, 2009 at 09:00:54AM -0800, Gary Johnson wrote:
> Perhaps a better way to handle this would be to make 'reply_prefix' a
> string option defaulting to "Re: ".
This can be done with this other patch.
--
Bertrand Yvain
http://www.IELO.net/
diff -r 6928f522ac48 globals.h
--- a/globals.h Sat Nov 14 14:31:35 2009 -0800
+++ b/globals.h Thu Nov 19 20:02:55 2009 +0100
@@ -113,6 +113,7 @@
WHERE char *QueryCmd;
WHERE char *QueryFormat;
WHERE char *Realname;
+WHERE char *ReplyPrefix;
WHERE short SearchContext;
WHERE char *SendCharset;
WHERE char *Sendmail;
diff -r 6928f522ac48 init.h
--- a/init.h Sat Nov 14 14:31:35 2009 -0800
+++ b/init.h Thu Nov 19 20:02:55 2009 +0100
@@ -2267,6 +2267,12 @@
** The value of \fI$$record\fP is overridden by the $$force_name and
** $$save_name variables, and the ``$fcc-hook'' command.
*/
+ { "reply_prefix", DT_STR, R_NONE, UL &ReplyPrefix, UL "Re: " },
+ /*
+ ** .pp
+ ** The string that Mutt will prepend to the Subject: header when
+ ** replying to a message.
+ */
{ "reply_regexp", DT_RX, R_INDEX|R_RESORT, UL &ReplyRegexp, UL
"^(re([\\[0-9\\]+])*|aw):[ \t]*" },
/*
** .pp
diff -r 6928f522ac48 send.c
--- a/send.c Sat Nov 14 14:31:35 2009 -0800
+++ b/send.c Thu Nov 19 20:02:55 2009 +0100
@@ -626,8 +626,13 @@
if (curenv->real_subj)
{
FREE (&env->subject);
- env->subject = safe_malloc (mutt_strlen (curenv->real_subj) + 5);
- sprintf (env->subject, "Re: %s", curenv->real_subj); /*
__SPRINTF_CHECKED__ */
+ if (ReplyPrefix) {
+ env->subject = safe_malloc (mutt_strlen (curenv->real_subj) +
+ mutt_strlen(ReplyPrefix) + 1);
+ sprintf (env->subject, "%s%s", ReplyPrefix, curenv->real_subj); /*
__SPRINTF_CHECKED__ */
+ }
+ else
+ env->subject = safe_strdup (curenv->real_subj);
}
else if (!env->subject)
env->subject = safe_strdup ("Re: your mail");