Index screen - could it feature time segments?
Remco Rijnders
remco at webconquest.com
Sun Aug 2 10:24:24 UTC 2020
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho wrote in
<173ae7cb050.2742.b94389c50b70d4ef8bda8663b7428fe1 at kraav.com>:
>Hi. I'm looking for a way to get mutt index to segment list display
>with Today, Yesterday, Last Week, 2 weeks ago etc separators.
>
>Feels like it should be technically possible, but I haven't been able
>to find a configuration or a patch for this.
I don't think this is possible "out of the box", as you are limited by
what options $index_format [1] offers, which in turn uses $date_format
[2], which in turn uses the functionality offered by the systems
strftime(3) function. That said, you could use a script as a filter
which provide such functionality [3] by passing it the timestamp of
the message and returning the desired string to display.
I do not know of a script that will do exactly what you want, though
they may exist. If not, you can roll your own, perhaps using some
scripting around the datediff command from the dateutils package [4]?
Hopefully this gives you some pointers to get you started.
Kind regards,
Remco
--
1: http://www.mutt.org/doc/manual/#index-format
2: http://www.mutt.org/doc/manual/#date-format
3: http://www.mutt.org/doc/manual/#formatstrings-filters
4: https://www.fresse.org/dateutils/#datediff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-users/attachments/20200802/7ccb7471/attachment.asc>
More information about the Mutt-users
mailing list