Gentoo Archives: gentoo-user

From: Alexey Mishustin <shumkar@×××××××.ru>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mutt $index_format syntax
Date: Sat, 09 Apr 2011 10:18:02
Message-Id: YGuxguux.1302344195.6152460.shumkar@shumkar.ru
In Reply to: Re: [gentoo-user] mutt $index_format syntax by Vincent Launchbury
1 4/8/2011, "Vincent Launchbury" <vincent@×××××××××××××××.com> âû ïèñàëè:
2
3 >On 2011/04/08 02:40PM, Alexey Mishustin wrote:
4 >> For example, I don't understand what does -15.15 mean (in default value
5 >> "%4C %Z %{%b %d} %-15.15L (%4l) %s" )
6 >
7 >The "-15.15" is the same as the printf(3) format.
8
9 That's it. I had read man printf yesterday, but not found man 3 printf.
10 Seems to contain all information that I need...
11
12 >The minus sign means
13 >left align the field, the first number is the minimum field width, and
14 >the dot specifies that the next number is the precision, which for a
15 >string is the max number of characters to print.
16 >
17 >E.g "-15.20" would be a left aligned field atleast 15 characters wide,
18 >expanding upto 20 total, if the string is long enough. But that could
19 >make things unaligned, so just keep the values the same.
20 >
21 >> why there are no width values for each column,
22 >
23 >%4C -> message number (width 4)
24 >%Z -> Status flags (always 3 characters)
25 >%{%b %d} -> (see below) Short month name, 2 digit day (constant width)
26 >%-15.15L -> Address (width 15)
27 >(%4l) -> # of lines in the message (width 4)
28 >%s -> Subject (last field, width unimportant)
29 >
30 >> what do constructions %{another %s} mean.
31 >
32 >From the online manual [1], "%{format}" passes the date (in the sender's
33 >time zone) to strftime(3), so you could use "%{%Y-%m-%d}" for example,
34 >or just "%D" to use the setting from date_format.
35 >
36 >Perhaps tricky to read, but very flexible. Hope that helps.
37
38 Sure that helps! Thanks a lot.
39
40 >[1] http://www.mutt.org/doc/manual/manual-6.html#index_format
41
42 --
43 Regards,
44 Alex