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

2009-03-24 Thread Wilkinson, Alex
Hi all,

I would like to score any thread that i have replied to i.e. the entire thread.

Is this possible ? If yes, any pointers ?

 -aW

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.




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

2009-03-24 Thread Michael Tatge
* On Tue, Mar 24, 2009 08:41PM +0900 Wilkinson, Alex 
(alex.wilkin...@dsto.defence.gov.au) muttered:
 I would like to score any thread that i have replied to i.e. the
 entire thread.
 
 Is this possible ? If yes, any pointers ?

Let's see - what does the manual say about score?

   Usage: score pattern value

Ok, now what patterns do we have?

   ~Q messages which have been replied to

   ~(PATTERN) messages in threads containing messages matching a certain
   pattern, e.g. all threads containing messages from you: ~(~P)

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?

HTH,

Michael
-- 
...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly).
(By Matt Welsh)

PGP-Key-ID: 0xDC1A44DD
Jabber: init...@amessage.de


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

2009-03-24 Thread Kyle Wheeler
-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-