<<< Date Index >>>     <<< Thread Index >>>

Prevent "Re: " prepending to subject when replying (patch included)



Hi,

please consider this patch that adds a boolean configuration option,
reply_prefix.  When turned off, the "Re: " prefix will not be added to
the subject of a reply, unless the subject was empty.

Cheers,
-- 
Bertrand Yvain
http://www.IELO.net/
diff -r 6928f522ac48 init.h
--- a/init.h    Sat Nov 14 14:31:35 2009 -0800
+++ b/init.h    Thu Nov 19 17:11:53 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_BOOL, R_NONE, OPTREPLYPREFIX, 1 },
+  /*
+  ** .pp
+  ** If \fIset\fP, when replying to a message, Mutt will prepend "Re: "
+  ** to the Subject: header.
+  */
   { "reply_regexp",    DT_RX,   R_INDEX|R_RESORT, UL &ReplyRegexp, UL 
"^(re([\\[0-9\\]+])*|aw):[ \t]*" },
   /*
   ** .pp
diff -r 6928f522ac48 mutt.h
--- a/mutt.h    Sat Nov 14 14:31:35 2009 -0800
+++ b/mutt.h    Thu Nov 19 17:11:53 2009 +0100
@@ -408,6 +408,7 @@
   OPTPRINTSPLIT,
   OPTPROMPTAFTER,
   OPTREADONLY,
+  OPTREPLYPREFIX,
   OPTREPLYSELF,
   OPTRESOLVE,
   OPTREVALIAS,
diff -r 6928f522ac48 send.c
--- a/send.c    Sat Nov 14 14:31:35 2009 -0800
+++ b/send.c    Thu Nov 19 17:11:53 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 (option(OPTREPLYPREFIX))
+    {
+      env->subject = safe_malloc (mutt_strlen (curenv->real_subj) + 5);
+      sprintf (env->subject, "Re: %s", curenv->real_subj);     /* 
__SPRINTF_CHECKED__ */
+    }
+    else
+      env->subject = safe_strdup (curenv->real_subj);
   }
   else if (!env->subject)
     env->subject = safe_strdup ("Re: your mail");