Yoshiki Vazquez Baeza wrote:
> I think I found the reason why this happens, there's a block of code
> that uncollapses *all* the threads in the current mailbox when it is
> reopened. The comments around that block of code seem to indicate that
> only new emails should be uncollapsed, so I've added an if statement
> (see attached patch) checking for new mails that are unread. This fixes
> the problem that I was having (all threads would uncollapse when flags
> were externally modified).
> 
> Not sure if this is really a bug or the intended behaviour, any feedback
> is greatly appreciated!

Hi Yoshiki,

I haven't looked at the threading code in mutt at all (so it's possible
I'm wrong), but the patch doesn't look quite right to me:

>        for (h = ctx->tree; h; h = h->next)
>        {
> -     for (j = h; !j->message; j = j->child)
> -       ;
> -     mutt_uncollapse_thread (ctx, j->message);
> +        for (j = h; !j->message; j = j->child)
> +          ;

Here, we've located the first message in the thread.

> +        if (!j->message->old && !j->message->read)
> +          mutt_uncollapse_thread (ctx, j->message);

So, here you're only looking at that one message and checking its
old/read flags.

I think the "reopen" occurs when messages disappear from the mailbox.
The comment about uncollapsing "new" messages means messages that have
appeared in the index, not necessarily those with !read.

The sudden uncollapse is certainly not friendly, and there's some room
for improvement here.  It would be great if one of the more experienced
committers would comment about the behavior and ways it could be
improved.

-Kevin

Attachment: signature.asc
Description: PGP signature

Reply via email to