]> granicus.if.org Git - mutt/commitdiff
Add next-folder command
authorN.J. Mann <njm@njm.f2s.com>
Wed, 2 May 2007 17:50:07 +0000 (10:50 -0700)
committerN.J. Mann <njm@njm.f2s.com>
Wed, 2 May 2007 17:50:07 +0000 (10:50 -0700)
OPS
curs_main.c
functions.h

diff --git a/OPS b/OPS
index 27d1fa1c9d54c5301c5eeb23f8b1d88782cfbdd5..5853ad32da4213833d4148c217e7880cc7803393 100644 (file)
--- 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"
index c9b827ad1ece5c59e7af32b9c726dd96be79784b..88e34137bca401225f04d616cb71b351f8323770 100644 (file)
@@ -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));
index 7aa067334bd832f56abd79fd9d935c4a40ed477d..92386c4bdc5836dffcbeff33d8db40cb16e9929d 100644 (file)
@@ -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" },