From: N.J. Mann Date: Wed, 2 May 2007 17:50:07 +0000 (-0700) Subject: Add next-folder command X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59bc4d0359d745d0e2ce662d4b7f7d97f38f9a8f;p=neomutt Add next-folder command --- diff --git a/OPS b/OPS index 27d1fa1c9..5853ad32d 100644 --- a/OPS +++ b/OPS @@ -107,6 +107,7 @@ OP_MAIN_FIRST_MESSAGE "move to the first message" OP_MAIN_LAST_MESSAGE "move to the last message" OP_MAIN_LIMIT "show only messages matching a pattern" OP_MAIN_LINK_THREADS "link tagged message to the current one" +OP_MAIN_NEXT_FOLDER "open next folder with new mail" 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" diff --git a/curs_main.c b/curs_main.c index c9b827ad1..88e34137b 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1052,6 +1052,7 @@ int mutt_index_menu (void) break; case OP_MAIN_CHANGE_FOLDER: + case OP_MAIN_NEXT_FOLDER: if (attach_msg) op = OP_MAIN_CHANGE_FOLDER_READONLY; @@ -1066,22 +1067,36 @@ int mutt_index_menu (void) cp = _("Open mailbox"); buf[0] = '\0'; - mutt_buffy (buf, sizeof (buf)); - - if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) - { - if (menu->menu == MENU_PAGER) - { - op = OP_DISPLAY_MESSAGE; - continue; - } - else - break; - } - if (!buf[0]) + if ((op == OP_MAIN_NEXT_FOLDER) && Context && Context->path) { - CLEARLINE (LINES-1); - break; + strfcpy (buf, Context->path, sizeof (buf)); + mutt_pretty_mailbox (buf); + mutt_buffy (buf, sizeof (buf)); + if (!buf[0]) + { + mutt_error _("No new messages"); + break; + } + } + else + { + mutt_buffy (buf, sizeof (buf)); + + if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) + { + if (menu->menu == MENU_PAGER) + { + op = OP_DISPLAY_MESSAGE; + continue; + } + else + break; + } + if (!buf[0]) + { + CLEARLINE (LINES-1); + break; + } } mutt_expand_path (buf, sizeof (buf)); diff --git a/functions.h b/functions.h index 7aa067334..92386c4bd 100644 --- a/functions.h +++ b/functions.h @@ -88,6 +88,7 @@ struct binding_t OpMain[] = { /* map: index */ { "break-thread", OP_MAIN_BREAK_THREAD, "#" }, { "change-folder", OP_MAIN_CHANGE_FOLDER, "c" }, { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, + { "next-folder", OP_MAIN_NEXT_FOLDER, "," }, { "collapse-thread", OP_MAIN_COLLAPSE_THREAD, "\033v" }, { "collapse-all", OP_MAIN_COLLAPSE_ALL, "\033V" }, { "copy-message", OP_COPY_MESSAGE, "C" }, @@ -176,6 +177,7 @@ struct binding_t OpPager[] = { /* map: pager */ { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, { "change-folder", OP_MAIN_CHANGE_FOLDER, "c" }, { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, + { "next-folder", OP_MAIN_NEXT_FOLDER, "," }, { "copy-message", OP_COPY_MESSAGE, "C" }, { "decode-copy", OP_DECODE_COPY, "\033C" }, { "delete-message", OP_DELETE, "d" },