changeset: 6911:e4ad1dc9bfbd
user:      Kevin McCarthy <ke...@8t8.us>
date:      Tue Jan 24 15:33:23 2017 -0800
link:      http://dev.mutt.org/hg/mutt/rev/e4ad1dc9bfbd

Allow "unsubjectrc *" to remove all patterns.

Thanks to Aaron Schrab for the original patch.

diffs (68 lines):

diff -r 9e876d64d3c8 -r e4ad1dc9bfbd doc/manual.xml.head
--- a/doc/manual.xml.head       Mon Jan 23 19:01:50 2017 -0800
+++ b/doc/manual.xml.head       Tue Jan 24 15:33:23 2017 -0800
@@ -6098,9 +6098,14 @@
 </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>
@@ -6121,8 +6126,9 @@
 </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">
@@ -10062,13 +10068,18 @@
 <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 -r 9e876d64d3c8 -r e4ad1dc9bfbd init.c
--- a/init.c    Mon Jan 23 19:01:50 2017 -0800
+++ b/init.c    Tue Jan 24 15:33:23 2017 -0800
@@ -801,6 +801,14 @@
   }
 
   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;
 }

Reply via email to