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

Re: [message scoring] Is it possible to ... ?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, March 24 at 03:30 PM, quoth Michael Tatge:
>Is it working? Somehow.
>If I manually enter the score it works. If I put the line in muttrc it's
>not. Even if I source that file in a folder-hook it seems the message
>parsing comes too late for the score to work. Bug?

It's probably an ordering problem: the score is calculated *before* 
the mailbox is sorted (so that it can be used as a sorting mechanism 
or displayed), and yet thread relationships are established as *part* 
of sorting the mailbox and so cannot be used until *after* the mailbox 
is sorted. And *after* the mailbox is sorted, the scores are not 
re-calculated unless you enter in some new ones.

So, if you put in your scores as part of a folder-hook or as part of 
your muttrc, those patterns are evaluated before thread relationships 
between messages have been established. However, if you type your 
scores in manually, while looking at a sorted mailbox, they are being 
evaluated AFTER thread relationships have been established.

My guess is that those scores wouldn't do *anything* if you first 
sorted your mailbox by date-received (i.e. if you didn't sort by 
threads).

I think this is probably an intentional design flaw, as weird as that 
sounds. Mutt doesn't figure out thread relationships if it doesn't 
have to, because doing so is (or once was) computationally expensive 
and requires analyzing all messages in the mailbox. So the mutt 
designers put off doing that calculation until the last possible 
moment: sorting. Unfortunately, this means that stuff like 
this---scoring and anything else that happens BEFORE messages are 
sorted (e.g. things triggered by folder-hooks)---*CANNOT* get access 
to that thread-relationship information. Nor can they get access to 
that thread-relationship information if the thread-based sort doesn't 
happen (i.e. if you've sorted your messages in some other way).

You probably want to try to sweet-talk the mutt developers into 
re-evaluating scores after the thread-relationships are established 
(which, of course, has the potential to force the messages to be 
re-sorted; consider what happens if sort_aux=score). Ideally, 
thread-relationships would be figured out independently of sorting... 
but I wouldn't hold my breath on that one.

~Kyle
- -- 
It has been my experience that folks who have no vices have very few 
virtues.
                                                     -- Abraham Lincoln
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAknI+SsACgkQBkIOoMqOI15TOwCg97uYgi6L9wdQtZC+fO6PqmHy
Y9IAoIKAiQyNhxXclDYBGjpkQtyOTXaO
=oJhN
-----END PGP SIGNATURE-----