I'm having some difficulties with the sorting by score ability of Mutt.

Occurs currently on Mutt 1.0pre3i on Linux 2.2.13pre9 and earlier on
0.95.5i, but I think it's my pattern-matching rather than a mutt
problem. I have read the manual, I have tried to understand the
O'Reilly "Regular Expressions" book, and I have looked for examples
in muttrcs on the web (only one used scoring, alas). I even grepped
the source directory for where the error message occurs, and although
I don't understand the code, the fact that it's from "pattern.c" is
a big hint, I should think :)

As I understand (or don't) sections 3.19 and 4.2 of the manual, and
from looking at the one muttrc linked off www.mutt.org which uses
scoring, the format is
        Usage: score pattern value

And examples in http://sec.42.org/mutt/.mutt/muttrc-1.0pre3i.html have
the pattern as things like,

folder-hook . unscore *
folder-hook . score '~A' +50
folder-hook +Listen/freebsd-cvs "score '~F' +999"
folder-hook +Listen/freebsd-cvs "score '~s ports/ ! ~s ^Re: ! ~s Imported' -20"

Following that syntax, I have one folder in which I'm looking for anything
to do with documentation of a particular program where scoring works great: 

folder-hook . set sort=threads
folder-hook IN.cvs-commits set sort=score
folder-hook IN.cvs-commits "score '~s gnome-terminal' 1"
folder-hook IN.cvs-commits "score '~s gnome-core' 1"
folder-hook IN.cvs-commits "score '~s desktop-docs' 1"
folder-hook IN.cvs-commits "score '~s gnome-libs' 1"
folder-hook IN.cvs.commits "score '~s zucchi' 1"

Anything with that lot goes up to the top, and I can read those and
cheerfully ignore the rest. (I realise there are probably ways to 
do this in one line, but since I'm obviously messing up somewhere,
I'm keeping it in a state I can read for now.)

But I also wanted to add anything with words like "documentation",
"guide" and the like anywhere in the message body to go up there,
too. According to the manual, that's b or B. 

When I try

folder-hook IN.cvs.commits "score '~b document' 1"
folder-hook IN.cvs.commits "score '~B document' 1"

I am told "b: not supported in this mode". "not supported in this
mode" is an error which occurs in pattern.c, which doesn't surprise me, 
because I am dreadful at pattern-matching :) But I'm even more
dreadful at C, so I don't understand from looking at that little
bit of it what I'm doing wrong. 

Whilst experimenting with a different folder, where lists called
both junk and junk-not go, when I erroneously put:
folder-hook IN.junk set sort=score
folder-hook IN.junk "score '~h junk-not' 1"                 

I got "h: not supported in this mode". I changed the ~h to a ~e
(probably what I want anyway, but messages from that source are so 
rare that it's hard to test :)), and it now works. Or, at least,
it produces no error message.

However, section 4.2 for pattern-matching has precisely the same
format for each:

~e EXPR         message which contains EXPR in the `Sender'' field
~h EXPR         messages which contain EXPR in the message header

So - um? What's the difference? The use of a hyphen? I thought
perhaps it was that, but 4.1 only mentions hyphens as being special
when they're in square brackets. 

Help? How do I set up something that looks for particular words
in a message and sorts on it? 

On a related note, how do I get my index_format for those folders
to include the score? My default index_format is 
set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"
And I thought that this would work:
folder-hook . set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"
folder-hook IN.cvs-commits set index_format="%2N %2C %Z %{%b %d} %-15.15L (%4l) %s"

But when I try this, it tells me that it doesn't understand %Z -- although
it shows it perfectly well for everything else. 

Any clues on that?

I mentioned problems with scoring before, but had no response. I'm
hoping a clearer (well, clear-ish) explanation will help. :)

Telsa

Reply via email to