#
84680f53 |
| 13-Nov-2023 |
schwarze <schwarze@openbsd.org> |
Reduce the man(7) default global indentation from 7n, which was an oddity in groff-1.01 to groff-1.22.4, to 5n for compatibility with Version 7 AT&T UNIX, 4.3BSD-Reno, groff-1.23.0, and all versions
Reduce the man(7) default global indentation from 7n, which was an oddity in groff-1.01 to groff-1.22.4, to 5n for compatibility with Version 7 AT&T UNIX, 4.3BSD-Reno, groff-1.23.0, and all versions of mdoc(7). OK jmc@ millert@
show more ...
|
#
f6697133 |
| 24-Oct-2023 |
schwarze <schwarze@openbsd.org> |
Implement the man(7) .MR macro, a 2023 GNU extension. The syntax and semantics is almost identical to mdoc(7) .Xr.
This will be needed for reading the groff manual pages once our port will be update
Implement the man(7) .MR macro, a 2023 GNU extension. The syntax and semantics is almost identical to mdoc(7) .Xr.
This will be needed for reading the groff manual pages once our port will be updated to 1.23, and the Linux Manual Pages Project is also determined to start using it sooner or later. I did not advocate for this new macro, but since we want to remain able to read all manual pages found in the wild, there is little choice but to support it. At least it is easy to do, they basically copied .Xr.
show more ...
|
#
3f3c303a |
| 28-Apr-2023 |
schwarze <schwarze@openbsd.org> |
Do not rewrite MAN_LP and MAN_P to MAN_PP because doing that causes confusing warning messages complaining about macros that don't even appear in the input file. As a welcome side effect, this also s
Do not rewrite MAN_LP and MAN_P to MAN_PP because doing that causes confusing warning messages complaining about macros that don't even appear in the input file. As a welcome side effect, this also shortens the code...
Fixing a minibug reported by Alejandro Colomar <alx dot manpages at gmail dot com>.
show more ...
|
#
004600a2 |
| 28-Aug-2022 |
schwarze <schwarze@openbsd.org> |
Stop unconditionally emitting vertical space before .TS (table start). Same change as in groff commit 7ec36dc9 Jul 30 2022 gbranden@ For more details, see https://savannah.gnu.org/bugs/index.php?6284
Stop unconditionally emitting vertical space before .TS (table start). Same change as in groff commit 7ec36dc9 Jul 30 2022 gbranden@ For more details, see https://savannah.gnu.org/bugs/index.php?62841
This change makes sense because: * It improves the formatting of more pages than it degrades. * Existing manual pages are wildly inconsistent in which behaviour they expect: apparently few manual page authors understood the old rules. * It simplifies the rules of how .TS behaves in man(7) and makes them more similar to how it behaves in mdoc(7). * It improves flexibility, making it possible for a table to immediately follow preceding text without a blank line, which some existing pages want to use, for example XCreateWindow(3).
show more ...
|
#
18bbf166 |
| 16-Aug-2022 |
schwarze <schwarze@openbsd.org> |
When starting a new input line, even when continuing the same output line, use the current output position as the reference position for tabs on that input line. This brings mandoc in line with the
When starting a new input line, even when continuing the same output line, use the current output position as the reference position for tabs on that input line. This brings mandoc in line with the behaviour of GNU, Heirloom, and Plan 9 roff.
show more ...
|
#
36ec5596 |
| 15-Aug-2022 |
schwarze <schwarze@openbsd.org> |
Simplify handling of no-fill mode in man(7) by inspecting NODE_NOFILL at the beginning of the node handler, in the same way as it is done in the mdoc(7) node handler.
As a side effect, this also fix
Simplify handling of no-fill mode in man(7) by inspecting NODE_NOFILL at the beginning of the node handler, in the same way as it is done in the mdoc(7) node handler.
As a side effect, this also fixes a bug: if an input line contained nothing but an escape sequence producing no output whatsoever (for example, \fR), the old code incorrectly emitted a blank line anyway, whereas the new code only emits such a blank link if the input line actually produces output (even invisible zero-width output). To make the distinction, the ASCII_NBRZW -> lastcol -> term_newln() mechanism established in term.c rev. 1.149 is used.
show more ...
|
#
dd2df837 |
| 15-Aug-2022 |
schwarze <schwarze@openbsd.org> |
In GNU, Heirloom, and Plan 9 roff, tab positions apply to *input* lines, not to *output* lines. In particular, if an input line gets broken in fill mode and a tab occurs in the second output line, i
In GNU, Heirloom, and Plan 9 roff, tab positions apply to *input* lines, not to *output* lines. In particular, if an input line gets broken in fill mode and a tab occurs in the second output line, it advances to a position of at least (width of the first output line) + (width of a space character even though this is never printed) + (width of the part of the second output line that precedes the tab).
Implement the same logic in mandoc.
Again, do not use tabs in filled text: they have surprising effects, including this one.
show more ...
|
#
1ad7d38c |
| 27-Apr-2022 |
schwarze <schwarze@openbsd.org> |
The .AT, .DT, and .UC macros are allowed inside next-line scope and never produce output at the place of their invocation.
Minibugs found while investigating unrelated afl(1) reports from tb@.
|
#
192c9c52 |
| 28-Jun-2021 |
schwarze <schwarze@openbsd.org> |
In terminal output of man(7) documents, stop printing two extra blank lines before the NAME section and before the page footer. While these blank lines had a long tradition, they didn't really serve
In terminal output of man(7) documents, stop printing two extra blank lines before the NAME section and before the page footer. While these blank lines had a long tradition, they didn't really serve any purpose and merely wasted screen real estate. Besides, this makes output from man(7) more similar to output from mdoc(7).
This commit keeps mandoc compatible with groff-current, where G. Branden Robinson committed the same change on June 16 (groff commit 2278d6ed).
show more ...
|
#
0ac7e6ec |
| 13-Mar-2020 |
schwarze <schwarze@openbsd.org> |
Split tagging into a validation part including prioritization in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and
Split tagging into a validation part including prioritization in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.
Immediate functional benefits include: * Improved prioritization of automatic tags for .Em and .Sy. * Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged. * Explicit tagging of .Er and .Fl now works in HTML output. * Automatic tagging of .IP and .TP now works in HTML output. But mainly, this patch provides clean earth to build further improvements on.
Technical changes: * Main program: Write a tag file for ASCII and UTF-8 output only. * All formatters: There is no more need to delay writing the tags. * mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection. * HTML formatter: If available, use the "string" attribute as the tag. * HTML formatter: New function to write permalinks, to reduce code duplication.
Style cleanup in the vicinity while here: * mdoc(7) terminal formatter: To set up bold font for children, defer to termp_bold_pre() rather than calling term_fontpush() manually. * mdoc(7) terminal formatter: Garbage collect some duplicate functions. * mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions. * Where possible, use switch statements rather than if cascades. * Get rid of some more Yoda notation.
The necessity for such changes was first discussed with kn@, but i didn't bother him with a request to review the resulting -673/+782 line patch.
show more ...
|
#
7ebbefbe |
| 27-Feb-2020 |
schwarze <schwarze@openbsd.org> |
Introduce the concept of nodes that are semantically transparent: they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm a
Introduce the concept of nodes that are semantically transparent: they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm and .Tg, and man(7) .DT and .PD. Use this concept for a variety of improved decisions in various validators and formatters.
While here, * remove a few const qualifiers on struct arguments that caused trouble; * get rid of some more Yoda notation in the vicinity; * and apply some other stylistic improvements in the vicinity.
I found this class of issues while considering .Tg patches from kn@.
show more ...
|
#
7d109111 |
| 20-Jan-2020 |
schwarze <schwarze@openbsd.org> |
Make the code more readable by introducing symbolic constants for tagging priorities. This review also made me find a minor bug: do not upgrade TAG_FALLBACK to TAG_WEAK when there is trailing whitesp
Make the code more readable by introducing symbolic constants for tagging priorities. This review also made me find a minor bug: do not upgrade TAG_FALLBACK to TAG_WEAK when there is trailing whitespace.
show more ...
|
#
30e481c6 |
| 23-Jul-2019 |
schwarze <schwarze@openbsd.org> |
tagging support for .TP and .TQ; try e.g. man -O tag=commit cvs
|
#
1e876328 |
| 22-Jul-2019 |
schwarze <schwarze@openbsd.org> |
Slowly start implementing tagging support for man(7) pages, even though it is obvious that this can never become as good as for mdoc(7) pages. As a first step, tag alphabetic arguments of .IP macros
Slowly start implementing tagging support for man(7) pages, even though it is obvious that this can never become as good as for mdoc(7) pages. As a first step, tag alphabetic arguments of .IP macros, which are often used for lists of options and keywords.
Try "man -O tag=g as" to get the point.
Thanks to Leah Neukirchen for recently reminding me that exploring how much can be done in this respect may be worthwhile: it is likely to slightly improve usability while adding only small amounts of relatively straightforward code.
show more ...
|
#
c8dfc550 |
| 01-Jul-2019 |
schwarze <schwarze@openbsd.org> |
delete trailing whitespace and space-tab sequences; no code change; patch from Michal Nowak <mnowak at startmail dot com> who found these with git pbchk in the illumos tree
|
#
af29ff23 |
| 27-Jun-2019 |
schwarze <schwarze@openbsd.org> |
Improve "man -h" output. 1. For pages lacking a SYNOPSIS, show the NAME section rather than nothing. 2. Do not print a stray blank before the beginning of a SYNOPSIS. Both issues reported by, and pat
Improve "man -h" output. 1. For pages lacking a SYNOPSIS, show the NAME section rather than nothing. 2. Do not print a stray blank before the beginning of a SYNOPSIS. Both issues reported by, and patch OK'ed by, tb@.
show more ...
|
#
1e7e4b62 |
| 05-Jan-2019 |
schwarze <schwarze@openbsd.org> |
In groff, when the .SY block macro occurs in no-fill mode, the output line gets broken after the head. Do the same.
|
#
93d668c7 |
| 05-Jan-2019 |
schwarze <schwarze@openbsd.org> |
minor cleanup, no functional change: * in node type switches, explicitly handle all types, sort them, and abort() on those that cannot occur * avoid testing pointers as truth values, use "!= NULL" *
minor cleanup, no functional change: * in node type switches, explicitly handle all types, sort them, and abort() on those that cannot occur * avoid testing pointers as truth values, use "!= NULL" * avoid testing "constant == variable", use "variable == constant" * prefer sizeof(var) over sizeof(type) * delete one duplicate function * sort some declarations * delete some useless blank lines
show more ...
|
#
94a3c318 |
| 05-Jan-2019 |
schwarze <schwarze@openbsd.org> |
Some high-level block macros have an effect similar to temporarily suspending no-fill mode during their head. Model this with an additional roff parser state flag ROFF_NONOFILL. That is much simple
Some high-level block macros have an effect similar to temporarily suspending no-fill mode during their head. Model this with an additional roff parser state flag ROFF_NONOFILL. That is much simpler than it would be to save and restore the ROFF_NOFILL flag itself, in particular since the latter can be switched (with lasting effect) by the .nf and .fi requests even while its effect is temporarily suspended.
This commit does not change formatting yet, but prepares for future formatting simplifications and improvements.
show more ...
|
#
72236cb3 |
| 31-Dec-2018 |
schwarze <schwarze@openbsd.org> |
Cleanup, minus 25 LOC, no functional change: Delete the complicated mechanism keeping fill mode state locally in the man(7) HTML formatter. Instead, use the state stored in the nodes.
|
#
0438bfdf |
| 31-Dec-2018 |
schwarze <schwarze@openbsd.org> |
Move parsing of the .nf and .fi (fill mode) requests from the man(7) parser to the roff(7) parser. As a side effect, .nf and .fi are now also parsed in mdoc(7) input, though the mdoc(7) formatters s
Move parsing of the .nf and .fi (fill mode) requests from the man(7) parser to the roff(7) parser. As a side effect, .nf and .fi are now also parsed in mdoc(7) input, though the mdoc(7) formatters still ignore most of their effect.
show more ...
|
#
6b86842e |
| 30-Dec-2018 |
schwarze <schwarze@openbsd.org> |
Cleanup, no functional change:
The struct roff_man used to be a bad mixture of internal parser state and public parsing results. Move the public results to the parsing result struct roff_meta, whic
Cleanup, no functional change:
The struct roff_man used to be a bad mixture of internal parser state and public parsing results. Move the public results to the parsing result struct roff_meta, which is already public. Move the rest of struct roff_man to the parser-internal header roff_int.h.
Since the validators need access to the parser state, call them from the top level parser during mparse_result() rather than from the main programs, also reducing code duplication.
This keeps parser internal state out of thee main programs (five in mandoc portable) and out of eight formatters.
show more ...
|
#
99acaf1e |
| 13-Dec-2018 |
schwarze <schwarze@openbsd.org> |
Cleanup, no functional change: Split the top level parser interface out of the utility header mandoc.h, into a new header mandoc_parse.h, for use in the main program and in the main parser only. Move
Cleanup, no functional change: Split the top level parser interface out of the utility header mandoc.h, into a new header mandoc_parse.h, for use in the main program and in the main parser only. Move enum mandoc_os into roff.h because struct roff_man is the place where it is stored. This allows removal of mandoc.h from seven files in low-level parsers and in formatters.
show more ...
|
#
7c539ecb |
| 03-Dec-2018 |
schwarze <schwarze@openbsd.org> |
In the validators, translate obsolete macro aliases (Lp, Ot, LP, P) to the standard forms (Pp, Ft, PP) up front, such that later code does not need to look for the obsolete versions. This reduces the
In the validators, translate obsolete macro aliases (Lp, Ot, LP, P) to the standard forms (Pp, Ft, PP) up front, such that later code does not need to look for the obsolete versions. This reduces the risk of incomplete handling.
show more ...
|
#
63f82d49 |
| 26-Aug-2018 |
schwarze <schwarze@openbsd.org> |
Support nesting of elements with next-line scope. For example, ksh93(1) needs this for .B\n.SM.
|