A simple (naive) patch to add a new variable 'sidebar_newmail_only' which will toggle the sidebar's display behavior. Either showing *all* mailboxes, or only those with unread messages in them. (This is *instant*. If you open a mailboxe and read each message then the current mailbox will be removed from the list. Freaky!) I have this in ~/.mutt-sidebar: macro index E 'toggle sidebar_newmail_only' macro pager E 'toggle sidebar_newmail_only' Patch follows in three parts: 1. Define new setting. 2. Update the sidebar-drawing to skip mailboxes where the unread count < 1, unless the folder is the current one, or the folder is the spool folder. 3. The navigation uses a neat fall-through trick when the flag is set. Steve -- Index: mutt-1.5.17+20080114/init.h =================================================================== --- mutt-1.5.17+20080114.orig/init.h 2008-03-13 12:26:03.000000000 +0000 +++ mutt-1.5.17+20080114/init.h 2008-03-13 12:26:12.000000000 +0000 @@ -1545,6 +1545,11 @@ ** .pp ** The width of the sidebar. */ + {"sidebar_newmail_only", DT_BOOL, R_BOTH, OPTSIDEBARNEWMAILONLY, "no" }, + /* + ** .pp + ** The width of the sidebar. + */ { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0}, /* ** .pp Index: mutt-1.5.17+20080114/mutt.h =================================================================== --- mutt-1.5.17+20080114.orig/mutt.h 2008-03-13 12:26:03.000000000 +0000 +++ mutt-1.5.17+20080114/mutt.h 2008-03-13 12:26:12.000000000 +0000 @@ -527,7 +527,7 @@ OPTPGPCHECKTRUST, /* (pseudo) used by pgp_select_key () */ OPTDONTHANDLEPGPKEYS, /* (pseudo) used to extract PGP keys */ OPTUNBUFFEREDINPUT, /* (pseudo) don't use key buffer */ - + OPTSIDEBARNEWMAILONLY, OPTMAX }; Index: mutt-1.5.17+20080114/sidebar.c =================================================================== --- mutt-1.5.17+20080114.orig/sidebar.c 2008-03-13 12:26:06.000000000 +0000 +++ mutt-1.5.17+20080114/sidebar.c 2008-03-13 12:31:11.000000000 +0000 @@ -221,8 +221,20 @@ SETCOLOR(MT_COLOR_INDICATOR); else if ( tmp->msg_unread > 0 ) SETCOLOR(MT_COLOR_NEW); - else + else { + /* make sure the path is either: + 1. Containing new mail. + 2. The inbox. + 3. The current box. + */ + if ((option (OPTSIDEBARNEWMAILONLY)) && + ( (tmp->msg_unread <= 0) && + ( tmp != Incoming ) && + ( strcmp( tmp->path, Context->path ) != 0 ) ) ) + continue; + else SETCOLOR(MT_COLOR_NORMAL); + } move( lines, 0 ); if ( Context && !strcmp( tmp->path, Context->path ) ) { @@ -290,18 +302,22 @@ switch (op) { case OP_SIDEBAR_NEXT: + if (!option (OPTSIDEBARNEWMAILONLY)) { if ( CurBuffy->next == NULL ) return; CurBuffy = CurBuffy->next; break; + } case OP_SIDEBAR_NEXT_NEW: if ( (tmp = exist_next_new()) == NULL) return; else CurBuffy = tmp; break; case OP_SIDEBAR_PREV: + if (!option (OPTSIDEBARNEWMAILONLY)) { if ( CurBuffy->prev == NULL ) return; CurBuffy = CurBuffy->prev; break; + } case OP_SIDEBAR_PREV_NEW: if ( (tmp = exist_prev_new()) == NULL) return;