]> granicus.if.org Git - neomutt/commitdiff
The following patch adds the `unalternative_order' command. It also
authorMichael Elkins <me@sigpipe.org>
Fri, 9 Aug 2002 06:58:35 +0000 (06:58 +0000)
committerMichael Elkins <me@sigpipe.org>
Fri, 9 Aug 2002 06:58:35 +0000 (06:58 +0000)
allows using "*" more generically in un-commands which use
parse_unlists().

doc/manual.sgml.head
init.c
init.h

index 055727e3bec622234b2c80d0a13590114246a14f..dfb36a662304cbd10cab06b9702d72fbfa81cfe0 100644 (file)
@@ -2837,6 +2837,9 @@ Next, mutt will check if any of the types have a defined
 that, Mutt will look for any text type.  As a last attempt, mutt will
 look for any type it knows how to handle.
 
+To remove a MIME type from the <tt/alternative_order/ list, use the
+<tt/unalternative_order/ command.
+
 <sect1>MIME Lookup<label id="mime_lookup">
 <p>
 Mutt's mime&lowbar;lookup list specifies a list of mime-types that should not
@@ -2917,6 +2920,8 @@ The following are the commands understood by mutt.
 <item>
 <tt><ref id="alternative_order" name="alternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
 <item>
+<tt><ref id="alternative_order" name="unalternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
+<item>
 <tt><ref id="auto_view" name="auto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
 <item>
 <tt><ref id="auto_view" name="unauto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
diff --git a/init.c b/init.c
index 0490b0f5f686b62dd66793bc363547ca23a229cb..f9b756ad17a8779ba9bfef9c8ae62aa1559eb8f1 100644 (file)
--- a/init.c
+++ b/init.c
@@ -405,6 +405,14 @@ static int parse_unlist (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err
   do
   {
     mutt_extract_token (buf, s, 0);
+    /*
+     * Check for deletion of entire list
+     */
+    if (mutt_strcmp (buf->data, "*") == 0)
+    {
+      mutt_free_list ((LIST **) data);
+      break;
+    }
     remove_from_list ((LIST **) data, buf->data);
   }
   while (MoreArgs (s));
diff --git a/init.h b/init.h
index a259880df518358d43f1758f77006ac584d89f53..0f84dd8717d526d2e2607a5f22f516523b2f52b6 100644 (file)
--- a/init.h
+++ b/init.h
@@ -2700,6 +2700,7 @@ struct command_t Commands[] = {
   { "subscribe",       parse_subscribe,        0 },
   { "toggle",          parse_set,              M_SET_INV },
   { "unalias",         parse_unalias,          0 },
+  { "unalternative_order",parse_unlist,                UL &AlternativeOrderList },
   { "unauto_view",     parse_unlist,           UL &AutoViewList },
   { "unhdr_order",     parse_unlist,           UL &HeaderOrderList },
   { "unhook",          mutt_parse_unhook,      0 },