<<< Date Index >>>     <<< Thread Index >>>

Re: Patch to CVS



On 2006-03-14 14:47:13 -0600, Nicholas Longo wrote:

>    if (move_messages)
> -     mutt_message (_("%d kept, %d moved, %d deleted."),
> -       ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
> +     if (purge)
> +        mutt_message (_("%d kept, %d moved, %d deleted."),
> +          ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
> +     else
> +        mutt_message (_("%d kept, %d moved, %d deleted."),
> +          ctx->msgcount, read_msgs, 0);
>    else
> -    mutt_message (_("%d kept, %d deleted."),
> -      ctx->msgcount - ctx->deleted, ctx->deleted);
> -
> +    if (purge)
> +       mutt_message (_("%d kept, %d deleted."),
> +         ctx->msgcount - ctx->deleted, ctx->deleted);
> +    else
> +       mutt_message (_("%d kept, %d deleted."),
> +         ctx->msgcount, 0);

This part of the patched code gets out of hand a bit...  I'd
suggest variables kept, deleted, moved, then:

        kept = ctx->msgcount;
        if (move_messages)
        {
          moved   = read_msgs;
          kept   -= read_msgs;
        }

        if (purge)
        {
          deleted = ctx->deleted;
          kept   -= ctx->deleted;
        }
        
        if (moved && deleted)
          mutt_message (_("%d kept, %d moved, %d deleted."),
            kept, moved, deleted);
        else if (moved)
          mutt_message (_("%d kept, %d moved"),
            kept, moved);
        else if (deleted)
           mutt_message (_("%d kept, %d deleted"),
             kept, deleted);
        else
           mutt_message (_("All (%d) kept."), kept);
                
(All this during offline e-mail reading without looking at the
surrounding code, sorry, so you may have to change variable
names.)

Other than that, the patch looks good.

Regards,
-- 
Thomas Roessler · Personal soap box at <http://log.does-not-exist.org/>.