]> granicus.if.org Git - neomutt/commitdiff
Allow "unsubjectrc *" to remove all patterns.
authorKevin McCarthy <kevin@8t8.us>
Tue, 24 Jan 2017 23:33:23 +0000 (15:33 -0800)
committerRichard Russon <rich@flatcap.org>
Fri, 10 Feb 2017 03:32:55 +0000 (03:32 +0000)
Thanks to Aaron Schrab for the original patch.

doc/manual.xml.head
init.c

index da9504aac28dd04079755b68006a63ffb17566c8..20bd9f88c0ec49f7dd5821da52be462c43869d08 100644 (file)
@@ -7134,9 +7134,14 @@ that either is reproduced elsewhere, or is of secondary interest.
 </arg>
 
 <command>unsubjectrx</command>
+<group choice="req">
+<arg choice="plain">
+<replaceable class="parameter">*</replaceable>
+</arg>
 <arg choice="plain">
 <replaceable class="parameter">pattern</replaceable>
 </arg>
+</group>
 </cmdsynopsis>
 
 <para>
@@ -7157,8 +7162,9 @@ entire subject, not just the match!
 </para>
 
 <para>
-<literal>unsubjectrx</literal> removes a given subjectrx from the substitution
-list.
+<literal>unsubjectrx</literal> removes a given subjectrx from the
+substitution list.  If <literal>*</literal> is used as the pattern,
+all substitutions will be removed.
 </para>
 
 <example id="ex-subjectrx">
@@ -15398,13 +15404,18 @@ The following are the commands understood by Mutt:
 <replaceable class="parameter">pattern</replaceable>
 </arg>
 <arg choice="plain">
-<replaceable class="parameter">format</replaceable>
+<replaceable class="parameter">replacement</replaceable>
 </arg>
 
 <command><link linkend="display-munging">unsubjectrx</link></command>
+<group choice="req">
+<arg choice="plain">
+<replaceable class="parameter">*</replaceable>
+</arg>
 <arg choice="plain">
 <replaceable class="parameter">pattern</replaceable>
 </arg>
+</group>
 </cmdsynopsis>
 </listitem>
 
diff --git a/init.c b/init.c
index 90632c95cd96bb8558cd722ceb83b045bab07bbe..2ee2fd88236795cacc9cc4583956ae89c2feebc2 100644 (file)
--- a/init.c
+++ b/init.c
@@ -928,6 +928,14 @@ static int parse_unreplace_list (BUFFER *buf, BUFFER *s, unsigned long data, BUF
   }
 
   mutt_extract_token(buf, s, 0);
+
+  /* "*" is a special case. */
+  if (!mutt_strcmp (buf->data, "*"))
+  {
+    mutt_free_replace_list (list);
+    return 0;
+  }
+
   remove_from_replace_list(list, buf->data);
   return 0;
 }