static int minimum_priority;
static time_t last_scan_time;
static char *run_cmd = "mutt -f %s";
+static int simple_tab;
struct options {
int priority;
int hotkey;
int led;
int osd;
+ int unread_is_new;
};
struct option_node {
o->hotkey = -1;
o->led = -1;
o->osd = -1;
+ o->unread_is_new = -1;
}
static void
MERGE(hotkey);
MERGE(led);
MERGE(osd);
+ MERGE(unread_is_new);
}
}
}
if (c == '\n')
{
+ if (!i)
+ break;
int fold = -1;
do
{
if (!buf[0])
break;
if (!strncasecmp(buf, "Status:", 7))
- new = 0;
+ {
+ if (!b->o.unread_is_new || strchr(buf + 7, 'R'))
+ new = 0;
+ }
else if (!strncasecmp(buf, "X-Status:", 9) && strchr(buf+9, 'F'))
flagged = 1;
else if (!strncasecmp(buf, "From:", 5))
do
{
struct mbox *b = mbox_array[i];
- if (b->new && b->o.priority > bestp)
+ if (simple_tab)
+ {
+ if (b->new)
+ {
+ besti = i;
+ break;
+ }
+ }
+ else
{
- besti = i;
- bestp = b->o.priority;
+ if (b->new && b->o.priority > bestp)
+ {
+ besti = i;
+ bestp = b->o.priority;
+ }
}
i = (i+step) % cursor_max;
}
-o <opts>\t\tSet default options for all mailboxes\n\
-p <pri>\t\tSet minimum priority to show\n\
-s <key>=<val>\t\tSet on-screen display options (consult OSDD docs)\n\
+-t\t\t\tLet TAB select the next mailbox with new mail, no matter what priority it has\n\
\n\
Mailbox options (set with `-o', use upper case to negate):\n\
0-9\t\t\tSet mailbox priority (0=default)\n\
h\t\t\tHide from display\n\
l<led>\t\t\tLight a keyboard led (1-9) if running on X display\n\
m\t\t\tShow mailbox name of the sender\n\
+o\t\t\tCount old, but unread messages as new\n\
p\t\t\tShow personal info (full name) of the sender\n\
s\t\t\tShow message snippets\n\
t\t\t\tHighlight the entry\n\
case 'm':
o->sender_mbox = value;
break;
+ case 'o':
+ o->unread_is_new = value;
+ break;
case 'p':
o->sender_personal = value;
break;
clist_init(&osd_opts);
int c;
- while ((c = getopt(argc, argv, "c:dim:o:p:s:")) >= 0)
+ while ((c = getopt(argc, argv, "c:dim:o:p:s:t")) >= 0)
switch (c)
{
case 'c':
case 's':
add_osd_opt(optarg);
break;
+ case 't':
+ simple_tab = 1;
+ break;
default:
usage();
}