Ticket 36 reported an issue where a maildir was removed while the
mailbox was opened. Later, attempting to sync displayed the message
"Writing xxx...", which remained on the screen. The reporter actually
thought mutt was frozen, but it was simply that on a sync error Mutt
wasn't clearing or updating the message window.
There is some error message handling for mbox.c check_mailbox, but I
don't think that is the right place to further propogate messages.
Instead, add an error to the same place the initial "Writing..."
message is created.
/* save changes to disk */
static int sync_mailbox (CONTEXT *ctx, int *index_hint)
{
+ int rc;
+
if (!ctx->mx_ops || !ctx->mx_ops->sync)
return -1;
if (!ctx->quiet)
+ {
+ /* L10N: Displayed before/as a mailbox is being synced */
mutt_message (_("Writing %s..."), ctx->path);
+ }
+
+ rc = ctx->mx_ops->sync (ctx, index_hint);
+ if (rc != 0 && !ctx->quiet)
+ {
+ /* L10N: Displayed if a mailbox sync fails */
+ mutt_error (_("Unable to write %s!"), ctx->path);
+ }
- return ctx->mx_ops->sync (ctx, index_hint);
+ return rc;
}
/* move deleted mails to the trash folder */