From: David Champion
Subject: Re: X-Label and %y
To: The Mutt Developers List
References: <20000323041058.B20382@smack.uchicago.edu>
<20000323041058.B20382@smack.uchicago.edu>
<20000323115532.A20372@sobolev.rhein.de> <20000323195733.D10666@chamber.dna.fi>
<20000324012154.C28736@faveve.uni-stuttgart.de>
<20000323194020.A4437@smack.uchicago.edu>
<20000324084827.E28519@sobolev.rhein.de>
...
+ %y expands to the X-Label's value, no matter what.
+ %?y tests true if X-Label is present — if %y would have value.
+ %Y expands to the X-Label if X-Label exists, and any of these is true:
1. this message is unthreaded
2. this message is at the top of its thread
3. a. this message is its parent's first child, and its parent has
no X-Label
3. b. this message is its parent's first child, and its parent's
X-Label is different
4. a. this message is not its parent's first child, and its previous
sibling has no X-Label
4. b. this message is not its parent's first child, and its previous
sibling's X-Label is different
+ %?Y tests true if %Y would have value
+ ~y just regex-matches the X-Label's value
As Aaron Schwab noted, it's hard to tell a %Y with no X-Label from a %Y
whose predecessor's X-Label is the same. All I can say is:
"%y?%Y&none?".
Here are some examples I threw together. I wasn't sure where in the
docs they might fit. These are all variations on the default
$index_format.
## If X-Label is present, show it in [brackets], regardless of tree view.
## Warning! This will mess up tree diagramming characters!
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) [%y] %s"
## Same thing, but always use up exactly 8 columns for the label
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) [%-8.8y] %s"
## Same thing, but fill the gap with dashes if no X-Label is present
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) [%?y?%-8.8y&--------?] %s"
## If X-Label is present, show any X-Label that is at the top of a tree,
## or which is different from its predecessor's X-Label. Use a
## fixed-width field to preserve sanity of tree diagrams.
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %?y?[%-5.5Y] ?%s"
## If X-Label is present and different from its predecessor's X-Label,
## show its first 5 characters, left-justified in a 5-column field,
## enclosed in [brackets]. Otherwise, fill an equivalent span with
## whitespace.
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %?Y?[%-5.5Y] & %-5.0Z ?%s"
## Same as previous, but do not respect tree diagrams at all. Show
## X-Labels that are different from their predecessors in the tree
## view, or which are not tree members, and do not consume any space
## otherwise. This is nice when the X-labels are not expected to
## vary within a tree (e.g., for mailing lists).
#set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %?Y?[%Y] ?%s"
|