* On Thu, Feb 21, 2002 at 11:29:17PM -0500,
* Kyle Rawlins <[EMAIL PROTECTED]> wrote:
> Is there some way to clear the mailbox list?  i.e. the list that is added to by
> the 'mailboxes' command.

AFAIK there is no such way. At least in the discussion about this
feature some time ago nobody knew such a feature.

> I want to have two different sets of mailboxes (one for each mailing list) and
> have a keybinding to cycle through them; i.e. a set of work-related mailboxes
> and a set of music-related mailboxes.  I find that there are times where I want
> to check the work related stuff and spend too much time skipping over the music
> mailing lists and getting distracted, and when I'm reading the less serious
> lists I'm rarely interested in hearing about the work stuff.

Similar situation here.

> I could do this with different sets of configuration files, but it seems like
> there should be some way to just use a command to switch lists without
> exiting, or without running two seperate copies of mutt.

I did it with adding the "additional" mailboxes while mutt is running
and restarted mutt to clear the list, but that's annoying.

I just created a patch to address the problem, you may try it, but be
warned: it's nearly untested.

I attach it, I will run my mutt here with it some time, and if it
works well, I will add some documentation and put it on my homepage.

If you can try it now, you're welcome. If someone uses it, I would be glad
if he/she can send me suggestions for the docupatch.

The patch adds a new command "unmailboxes". It should behave exactly
the same as "mailboxes", and just remove the parameters from the
mailboxes-list. Parameters not on this list are silently ignored.

Nicolas
written by Nicolas Rachinsky <[EMAIL PROTECTED]>
http://www.rachinsky.de

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation;  version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

--- mutt-1.3.27-ori/buffy.c     Fri Feb 22 10:45:07 2002
+++ buffy.c     Fri Feb 22 10:47:35 2002
@@ -212,6 +212,40 @@
   return 0;
 }
 
+int mutt_parse_unmailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *err)
+{
+  BUFFY **tmp,*tmp1;
+  char buf[_POSIX_PATH_MAX];
+#ifdef BUFFY_SIZE
+  struct stat sb;
+#endif /* BUFFY_SIZE */
+
+  while (MoreArgs (s))
+  {
+    mutt_extract_token (path, s, 0);
+    strfcpy (buf, path->data, sizeof (buf));
+    mutt_expand_path (buf, sizeof (buf));
+
+    /* Skip empty tokens. */
+    if(!*buf) continue;
+
+    for (tmp = &Incoming; *tmp;tmp = &((*tmp)->next))
+    {
+      if (mutt_strcmp (buf, (*tmp)->path) == 0)
+      {
+       safe_free((void **)&((*tmp)->path));
+       tmp1=(*tmp)->next;
+       safe_free((void **)tmp);
+       *tmp=tmp1;
+       break;
+      }
+    }
+
+  }
+  return 0;
+}
+
+
 #ifdef BUFFY_SIZE
 /* people use buffy_size on systems where modified time attributes are BADLY
  * broken. Ignore them.
--- mutt-1.3.27-ori/init.h      Fri Feb 22 10:45:09 2002
+++ init.h      Fri Feb 22 10:45:14 2002
@@ -2458,6 +2458,7 @@
   { "lists",           parse_list,             UL &MailLists },
   { "macro",           mutt_parse_macro,       0 },
   { "mailboxes",       mutt_parse_mailboxes,   0 },
+  { "unmailboxes",     mutt_parse_unmailboxes, 0 },
   { "message-hook",    mutt_parse_hook,        M_MESSAGEHOOK },
   { "mbox-hook",       mutt_parse_hook,        M_MBOXHOOK },
   { "mono",            mutt_parse_mono,        0 },
diff -ru mutt-1.3.27-ori/protos.h mutt-1.3.27/protos.h
--- mutt-1.3.27-ori/protos.h    Fri Feb 22 10:45:09 2002
+++ protos.h    Fri Feb 22 10:45:14 2002
@@ -299,6 +299,7 @@
 int mutt_parse_hook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_macro (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_mailboxes (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+int mutt_parse_unmailboxes (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
 int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
--- mutt-1.3.27.orig/PATCHES    Mon Nov 26 20:16:52 2001
+++ PATCHES Thu Dec  6 16:27:55 2001
@@ -1,0 +1 @@
+1.3.27.nr.unmailboxes

Reply via email to