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
Unknown Object (File)
Mar 7 2024, 8:08 PM
Unknown Object (File)
Feb 16 2024, 10:24 PM
Unknown Object (File)
Feb 6 2024, 4:13 PM
Unknown Object (File)
Jan 20 2024, 5:25 AM
Unknown Object (File)
Jan 12 2024, 1:46 PM
Unknown Object (File)
Jan 10 2024, 4:41 AM
Unknown Object (File)
Jan 10 2024, 4:41 AM
Unknown Object (File)
Dec 23 2023, 6: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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.