headline=%d + - alignment broken

積丹尼 Dan Jacobson <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.bugs
Message-ID <[email protected]>
(info "(mailutils) Mail Variables") is wrong about %+ and %-.
There is no way that they should both act the same here according to the page.

$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%44d< %m [%f] %s %l/%o"' --headers
>Thu Jan 18 18:19                            < 1 [Dan Jacobson]  11/320
$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%+44d< %m [%f] %s %l/%o"' --headers
>                            Thu Jan 18 18:19< 1 [Dan Jacobson]  11/320
$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%-44d< %m [%f] %s %l/%o"' --headers
>                            Thu Jan 18 18:19< 1 [Dan Jacobson]  11/320

According to the page % should match either %+ or %-, but not both. But
here we see something quite different.

OK now let's try
$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%4d< %m [%f] %s %l/%o"' --headers
>Thu < 1 [Dan Jacobson]  11/320
$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%+4d< %m [%f] %s %l/%o"' --headers
>Thu < 1 [Dan Jacobson]  11/320
$ LC_TIME=C mail.mailutils --exec='set datefield headline=">%-4d< %m [%f] %s %l/%o"' --headers
>Thu < 1 [Dan Jacobson]  11/320

Anyway, if the user wanted
>18:19< 1 [Dan Jacobson]  11/320
he will just have pipe it to sed(1).

P.S., sed works great with --headers, but is not a solution when going
interactive (no --headers).

Anyway the program doesn't act like the Info page says it should.

$ mail --version
mail (GNU Mailutils) 3.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.