On Wed, Nov 09, 2011 at 11:01:27AM +0800, stardiviner wrote:
=> On [2011-11-08 12:03:50 -0500]:
Ed Blackman Said:
On Tue, Nov 08, 2011 at 02:13:05PM +0100, Gregor Zattler wrote:
>It's not possible to change the index format for individual
>emails in the index but you can colour different email entries
>differently.

Actually, it is.  If you set index_format to a shell command that
ends with a pipe, that Mutt will run that shell command for each
message and use the output as the actual index_format.  If you pass
index_format expandos as arguments, Mutt will pass the expanded
string.  The shell command could then use that to emit different
formats for different messages.

For example, I have a script called format_date, and have this in
.muttrc:
  set index_format="/path/to/format_date '%[%s]' '%<%s>' |"
This really is a good idea.
I want to set index_format for different type mails like:
new, deleted, replied, signed, encrypted ...
But I do not know how to use those value like ~N ~R ~D ~g ~G etc.
Do you know how to pass them to script ?

Those are patterns, you can't pass them. You can pass the format strings that are listed in muttrc under index_format. It looks like all the patterns you are interested in are reflected in the message flags format string, %Z. So you'd change index_format in .muttrc to:
  set index_format="/path/to/format_flags '%Z' |"

Then create a format_flags script loosely based on mine that parses the flags argument and echos the right index_format based on what's passed in the flags.

--
Ed Blackman

Attachment: signature.txt
Description: Digital signature

Reply via email to