]> granicus.if.org Git - mutt/commitdiff
Make folder synchronization possible from within the pager. From
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 17 Nov 2000 09:17:55 +0000 (09:17 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 17 Nov 2000 09:17:55 +0000 (09:17 +0000)
Chris Cutler <cutler@bluemug.com>.

curs_main.c
doc/manual.sgml.tail
functions.h

index 6d066807832fbb86239bbd47f0687037bd962171..34e55b53ce1fa44598712a69a1463bb129524ef6 100644 (file)
@@ -827,48 +827,6 @@ int mutt_index_menu (void)
        }
        break;
 
-      case OP_MAIN_SYNC_FOLDER:
-
-       CHECK_MSGCOUNT;
-       CHECK_READONLY;
-       {
-         int oldvcount = Context->vcount;
-         int oldcount  = Context->msgcount;
-         int dcount = 0;
-         int check;
-
-         /* calculate the number of messages _above_ the cursor,
-          * so we can keep the cursor on the current message
-          */ 
-         for (j = 0; j <= menu->current; j++)
-         {
-           if (Context->hdrs[Context->v2r[j]]->deleted)
-             dcount++;
-         }
-
-         if ((check = mx_sync_mailbox (Context, &index_hint)) == 0)
-         {
-           if (Context->vcount != oldvcount)
-             menu->current -= dcount;
-           set_option (OPTSEARCHINVALID);
-         }
-         else if (check == M_NEW_MAIL || check == M_REOPENED)
-           update_index (menu, Context, check, oldcount, index_hint);
-
-         /* 
-          * do a sanity check even if mx_sync_mailbox failed.
-          */
-
-         if (menu->current < 0 || menu->current >= Context->vcount)
-           menu->current = ci_first_message ();
-       }
-
-       /* check for a fatal error, or all messages deleted */
-       if (!Context->path)
-         safe_free ((void **) &Context);
-       menu->redraw = REDRAW_FULL;
-       break;
-
       case OP_TAG:
 
        CHECK_MSGCOUNT;
@@ -918,6 +876,56 @@ int mutt_index_menu (void)
         * The following operations can be performed inside of the pager.
         */
 
+      case OP_MAIN_SYNC_FOLDER:
+
+       CHECK_MSGCOUNT;
+       CHECK_READONLY;
+       {
+         int oldvcount = Context->vcount;
+         int oldcount  = Context->msgcount;
+         int dcount = 0;
+         int check;
+
+         /* calculate the number of messages _above_ the cursor,
+          * so we can keep the cursor on the current message
+          */ 
+         for (j = 0; j <= menu->current; j++)
+         {
+           if (Context->hdrs[Context->v2r[j]]->deleted)
+             dcount++;
+         }
+
+         if ((check = mx_sync_mailbox (Context, &index_hint)) == 0)
+         {
+           if (Context->vcount != oldvcount)
+             menu->current -= dcount;
+           set_option (OPTSEARCHINVALID);
+         }
+         else if (check == M_NEW_MAIL || check == M_REOPENED)
+           update_index (menu, Context, check, oldcount, index_hint);
+
+         /* 
+          * do a sanity check even if mx_sync_mailbox failed.
+          */
+
+         if (menu->current < 0 || menu->current >= Context->vcount)
+           menu->current = ci_first_message ();
+       }
+
+       /* check for a fatal error, or all messages deleted */
+       if (!Context->path)
+         safe_free ((void **) &Context);
+
+       /* if we were in the pager, redisplay the message */
+       if (menu->menu == MENU_PAGER)
+       {
+         op = OP_DISPLAY_MESSAGE;
+         continue;
+       }
+        else
+         menu->redraw = REDRAW_FULL;
+       break;
+
       case OP_MAIN_CHANGE_FOLDER:
       
        if (attach_msg)
index 1e0dbd61913772c2a81f52d7ba4fe68745699b6e..06991ca0f27d7564f7c9fc9122b7f9828105ca8d 100644 (file)
@@ -118,7 +118,7 @@ view-attachments           v   show MIME attachments
 <sect2>pager
 <p>
 <verb>
-bottom                     $   jump to the bottom of the message
+bottom             not bound   jump to the bottom of the message
 bounce-message             b   remail a message to another user
 change-folder              c   open a different folder
 change-folder-readonly ESC c   open a different folder in read only mode
@@ -181,6 +181,7 @@ search-toggle              \   toggle search pattern coloring
 shell-escape               !   invoke a command in a subshell
 show-version               V   show the Mutt version number and date
 skip-quoted                S   skip beyond quoted text
+sync-mailbox               $   save changes to mailbox
 tag-message                t   tag a message
 toggle-quoted              T   toggle display of quoted text
 top                        ^   jump to the top of the message
index 3d57238b752413bcff7ec26b8827871ae8a36736..3b1bd8ec0fae1cf7bc20b195d6ea04e08fde6029 100644 (file)
@@ -200,7 +200,7 @@ struct binding_t OpPager[] = {
   { "next-page",       OP_NEXT_PAGE,                   " " },
   { "previous-page",   OP_PREV_PAGE,                   "-" },
   { "top",             OP_PAGER_TOP,                   "^" },
-  { "bottom",          OP_PAGER_BOTTOM,                "$" },
+  { "sync-mailbox",    OP_MAIN_SYNC_FOLDER,            "$" },
   { "shell-escape",    OP_SHELL_ESCAPE,                "!" },
   { "enter-command",   OP_ENTER_COMMAND,               ":" },
   { "search",          OP_SEARCH,                      "/" },
@@ -214,6 +214,7 @@ struct binding_t OpPager[] = {
   { "half-up",         OP_HALF_UP,                     NULL },
   { "half-down",       OP_HALF_DOWN,                   NULL },
   { "previous-line",   OP_PREV_LINE,                   NULL },
+  { "bottom",          OP_PAGER_BOTTOM,                NULL },
   { "parent-message",  OP_MAIN_PARENT_MESSAGE,         "P" },