OP_MAIN_LAST_MESSAGE "move to the last message"
OP_MAIN_LIMIT "show only messages matching a pattern"
OP_MAIN_NEXT_NEW "jump to the next new message"
+OP_MAIN_NEXT_NEW_THEN_UNREAD "jump to the next new or unread message"
OP_MAIN_NEXT_SUBTHREAD "jump to the next subthread"
OP_MAIN_NEXT_THREAD "jump to the next thread"
OP_MAIN_NEXT_UNDELETED "move to the next undeleted message"
OP_MAIN_PREV_SUBTHREAD "jump to previous subthread"
OP_MAIN_PREV_UNDELETED "move to the previous undeleted message"
OP_MAIN_PREV_NEW "jump to the previous new message"
+OP_MAIN_PREV_NEW_THEN_UNREAD "jump to the previous new or unread message"
OP_MAIN_PREV_UNREAD "jump to the previous unread message"
OP_MAIN_READ_THREAD "mark the current thread as read"
OP_MAIN_READ_SUBTHREAD "mark the current subthread as read"
case OP_MAIN_NEXT_UNREAD:
case OP_MAIN_PREV_NEW:
case OP_MAIN_PREV_UNREAD:
+ case OP_MAIN_NEXT_NEW_THEN_UNREAD:
+ case OP_MAIN_PREV_NEW_THEN_UNREAD:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
+ next_unread_again:
i = menu->current;
menu->current = -1;
for (j = 0; j != Context->vcount; j++)
{
#define CURHDRi Context->hdrs[Context->v2r[i]]
- if (op == OP_MAIN_NEXT_NEW || op == OP_MAIN_NEXT_UNREAD)
+ if (op == OP_MAIN_NEXT_NEW || op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_NEXT_NEW_THEN_UNREAD)
{
i++;
if (i > Context->vcount - 1)
menu->current = i;
break;
}
- if ((op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW) &&
+ if ((op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW ||
+ op == OP_MAIN_NEXT_NEW_THEN_UNREAD || op == OP_MAIN_PREV_NEW_THEN_UNREAD) &&
UNREAD (CURHDRi) == 1)
{
menu->current = i;
if (menu->current == -1)
{
menu->current = menu->oldcurrent;
+ if (op == OP_MAIN_NEXT_NEW_THEN_UNREAD)
+ {
+ op = OP_MAIN_NEXT_UNREAD;
+ goto next_unread_again;
+ }
+ if (op == OP_MAIN_PREV_NEW_THEN_UNREAD)
+ {
+ op = OP_MAIN_PREV_UNREAD;
+ goto next_unread_again;
+ }
mutt_error ("%s%s.", (op == OP_MAIN_NEXT_NEW || op == OP_MAIN_PREV_NEW) ? _("No new messages") : _("No unread messages"),
Context->pattern ? _(" in this limited view") : "");
}
{ "sync-mailbox", OP_MAIN_SYNC_FOLDER, "$" },
{ "display-address", OP_DISPLAY_ADDRESS, "@" },
{ "pipe-message", OP_PIPE, "|" },
- { "next-new", OP_MAIN_NEXT_NEW, "\t" },
- { "previous-new", OP_MAIN_PREV_NEW, "\033\t" },
+ { "next-new", OP_MAIN_NEXT_NEW, NULL },
+ { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" },
+ { "previous-new", OP_MAIN_PREV_NEW, NULL },
+ { "previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD, "\033\t" },
{ "next-unread", OP_MAIN_NEXT_UNREAD, NULL },
{ "previous-unread", OP_MAIN_PREV_UNREAD, NULL },
{ "parent-message", OP_MAIN_PARENT_MESSAGE, "P" },
{ "show-version", OP_VERSION, "V" },
{ "search-toggle", OP_SEARCH_TOGGLE, "\\" },
{ "display-address", OP_DISPLAY_ADDRESS, "@" },
- { "next-new", OP_MAIN_NEXT_NEW, "\t" },
+ { "next-new", OP_MAIN_NEXT_NEW, NULL },
+ { "next-new-then-unread",
+ OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" },
{ "pipe-message", OP_PIPE, "|" },
{ "help", OP_HELP, "?" },
{ "next-page", OP_NEXT_PAGE, " " },
{ "jump", OP_JUMP, NULL },
{ "next-unread", OP_MAIN_NEXT_UNREAD, NULL },
{ "previous-new", OP_MAIN_PREV_NEW, NULL },
+ { "previous-new-then-unread",
+ OP_MAIN_PREV_NEW_THEN_UNREAD, NULL },
{ "previous-unread", OP_MAIN_PREV_UNREAD, NULL },
{ "half-up", OP_HALF_UP, NULL },
{ "half-down", OP_HALF_DOWN, NULL },