Page MenuHomeFreeBSD

mandoc: workaround lack of macro parsing in list -width
ClosedPublic

Authored by vangyzen on May 18 2022, 2:39 PM.
Tags
None
Referenced Files
F163411153: D35245.id106141.diff
Wed, Jul 22, 11:42 PM
Unknown Object (File)
Mon, Jul 20, 2:12 AM
Unknown Object (File)
Tue, Jun 23, 2:49 PM
Unknown Object (File)
Tue, Jun 23, 2:46 PM
Unknown Object (File)
Jun 20 2026, 11:07 PM
Unknown Object (File)
Jun 18 2026, 2:41 AM
Unknown Object (File)
Jun 14 2026, 10:53 PM
Unknown Object (File)
May 30 2026, 7:10 PM
Subscribers

Details

Summary

GNU tools parse macros in the -width argument of lists. mandoc does not,
so it calculates an excessive width. This often squeezes the text into
a very narrow column, especially in nested lists.

Implement the easy workaround suggested in the TODO list. When there is
only one macro, at the beginning of the -width argument, this fixes the
formatting as well as a complete solution.

Relnotes: yes
MFC after: 1 week
Sponsored by: Dell EMC Isilon

I won't commit this directly. I'll submit it upstream first.

Test Plan

See the diffs of formatted pages.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 45621
Build 42509: arc lint + arc unit

Event Timeline

vangyzen edited the summary of this revision. (Show Details)
vangyzen added a reviewer: manpages.
vangyzen edited the test plan for this revision. (Show Details)

Pages formatted with the old and new code.

Phabricator did not quite do what I wanted. There are two diffs here: formatted pages, and code. See the History tab.

Have you proposed this patch to upstream? ingo@openbsd.org is very responsive and should reply back quickly, before adding any custom patch I prefer it to be discussed with upstream first. (don't hesitate to CC me)

Have you proposed this patch to upstream? ingo@openbsd.org is very responsive and should reply back quickly, before adding any custom patch I prefer it to be discussed with upstream first. (don't hesitate to CC me)

Nice timing. I was just looking for the right mailing list. Thanks for the pointer! (I used Phab only as a convenient way to format the diffs.)

This revision was not accepted when it landed; it landed in state Needs Review.May 31 2022, 3:09 PM
This revision was automatically updated to reflect the committed changes.

Ingo will commit something similar in the near future, and Baptiste will import a new release of mandoc. For now, Bapt approved this commit.