[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-dev
Subject:    bug#1778: mutt: sync-mailbox fails too often
From:       Thorsten Gunkel <tgunkel () gmx ! de>
Date:       2004-01-24 19:53:20
Message-ID: 20040124195319.GA9409 () tgunkel ! myfqdn ! de
[Download RAW message or body]

Package: mutt
Version: 1.5.5.1i
Severity: normal
Tags: patch

Hi,
I have the following lines in my mutt config:

macro index q  \
 "<sync-mailbox><change-folder>?<toggle-mailboxes>" \
  "Index -> Folder List"

So when you're ready with one mailbox you just have to press q to save
all your changes (if any) and get a list of all the other mailboxes.

This works great as long as the current mailbox has still one message
left. If you entered an empty mailbox or deleted all messages you
can't leave the mailbox because <sync-mailbox> will fail and the whole
macro stops with "There are no messages."

Reading the source it seems that mutt first does some standard checks
to see if it *could* write changes to the mailbox before it checks *if*
there are any changes. IMHO it would be better if mutt first checks if
there are any changes and then if they could be written back.
Small demo patch below.

regards,
 Thorsten

--- mutt/curs_main.c    2004-01-24 19:33:18.000000000 +0100
+++ mutt_new/curs_main.c        2004-01-24 20:45:38.000000000 +0100
@@ -984,6 +984,13 @@
       
       case OP_MAIN_SYNC_FOLDER:
 
+       // don't fail with empty mailboxes if there seems nothing to sync
+       if (Context && !Context->msgcount && !Context->changed && !Context->deleted)
+         {
+           mutt_message _("Mailbox is empty and unchanged.");
+         }
+       else
+         {
        CHECK_MSGCOUNT;
         CHECK_VISIBLE;
        CHECK_READONLY;
@@ -1031,6 +1038,7 @@
        }
         else
          menu->redraw = REDRAW_FULL;
+         }
        break;
 
       case OP_MAIN_CHANGE_FOLDER:


-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux thorsten 2.4.24 #1 Mon Jan 12 02:18:16 CET 2004 i686
Locale: LANG=C, LC_CTYPE=de_DE

Versions of packages mutt depends on:
ii  libc6                    2.2.5-11.5      GNU C Library: Shared libraries an
ii  libncurses5              5.2.20020112a-7 Shared libraries for terminal hand
ii  libsasl7                 1.5.27-3        Authentication abstraction library


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic