Discussion:
[bug-mailutils] headline=%d + - alignment broken
積丹尼 Dan Jacobson
2018-01-18 10:52:19 UTC
Permalink
(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
Sergey Poznyakoff
2018-01-18 17:22:08 UTC
Permalink
Post by 積丹尼 Dan Jacobson
There is no way that they should both act the same here according to the page.
Fixed (f74ed5e0).

Regards,
Sergey

Loading...