On 18Nov2022 18:48, Kevin J. McCarthy <ke...@8t8.us> wrote:
On Sat, Nov 19, 2022 at 01:16:47PM +1100, Cameron Simpson wrote:
On 19Nov2022 08:32, Cameron Simpson <c...@cskk.id.au> wrote:
The issue is my index colouring, specificly this line:
 color index white default  "((~P|%f polyname ~h '^from:.*cameron simpson')) | (~v 
~((~P|%f polyname ~h '^from:.*cameron simpson')))"

I'm wondering if it is the `~h` pattern. That would search every header, which I presume exceeds the cache?

~h always opens up the message and scans header by header. It doesn't use the header cache.

Aha. Well that'll do it.

BTW ~() can also be very expensive.

If you mean: it involves walking the thread trees, I accept that. The win of having most threads callapsed but ocrrectly coloured outwieghs that. My naive perusing of the mutt code suggests that the thread structure itself is in memory, yes?

Is there an efficient way to search the _text_ of the `From:` header? Not match the from address part, but the comment string (which is where the "cameron simpson" resides)?

~f scans the display name part of the address in most cases, including for color commands.

If you mean an actual address comment field, e.g. (text), those are considered the display name if none otherwise exists. But if there is also a display name, the parser discards the comment.

Terminology: I'm taking "display name" to be as from here:

    mailbox = name-addr / addr-spec
    name-addr = [display-name] angle-addr
    angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
    display-name = phrase

from https://www.rfc-wiki.org/wiki/RFC2822. Is there a better RFC 2822 page? I used to use a nicely formatted tools.ietf.org URL, but that now redirects to some RFC author editing ... thing.

In this From: header body:

    Cameron Simpson (a comment) <c...@cskk.id.au>

would `~f "cameron simpson"` match it, and would `~f "comment"` _not_ match it?

An example actual header I'm trying to match is this one:

    From: "Cameron Simpson via Discussions on Python.org" 
<notificati...@python1.discoursemail.com>

Anyway, I'll try plain `~f "cameron simnpson"` and see how it goes.

Thanks,
Cameron Simpson <c...@cskk.id.au>

Reply via email to