Hello Kevin,

That makes sense, I completely misunderstood those few lines of code.
What really should happen then is that all messages in every thread
should be checked and if a !old message is found, then the thread it
belongs to should be uncollapsed.

I'm also interested in hearing what other devs/users have to say about
this. It may be because I'm relatively new to mutt but I don't really
understand the purpose of uncollapsing all threads when flags have been
externally modified.

Thanks!

Yoshiki.


On (Feb-19-15|12:39), Kevin J. McCarthy wrote:
> 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


Reply via email to