OpenBSD CVS

CVS log for src/usr.bin/mandoc/man_term.c


[BACK] Up to [local] / src / usr.bin / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.197 / (download) - annotate - [select for diffs], Mon Nov 13 19:13:00 2023 UTC (6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.196: +6 -11 lines
Diff to previous 1.196 (colored)

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@

Revision 1.196 / (download) - annotate - [select for diffs], Tue Oct 24 20:30:49 2023 UTC (6 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.195: +27 -2 lines
Diff to previous 1.195 (colored)

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.

Revision 1.195 / (download) - annotate - [select for diffs], Fri Apr 28 20:14:19 2023 UTC (12 months, 3 weeks ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.194: +3 -11 lines
Diff to previous 1.194 (colored)

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>.

Revision 1.194 / (download) - annotate - [select for diffs], Sun Aug 28 09:55:58 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.193: +2 -2 lines
Diff to previous 1.193 (colored)

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).

Revision 1.193 / (download) - annotate - [select for diffs], Tue Aug 16 17:44:53 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +5 -2 lines
Diff to previous 1.192 (colored)

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.

Revision 1.192 / (download) - annotate - [select for diffs], Mon Aug 15 18:44:24 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +21 -25 lines
Diff to previous 1.191 (colored)

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.

Revision 1.191 / (download) - annotate - [select for diffs], Mon Aug 15 13:01:40 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +2 -1 lines
Diff to previous 1.190 (colored)

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.

Revision 1.190 / (download) - annotate - [select for diffs], Wed Apr 27 17:04:15 2022 UTC (2 years ago) by schwarze
Branch: MAIN
Changes since 1.189: +4 -4 lines
Diff to previous 1.189 (colored)

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@.

Revision 1.189 / (download) - annotate - [select for diffs], Mon Jun 28 19:49:57 2021 UTC (2 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.188: +1 -9 lines
Diff to previous 1.188 (colored)

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).

Revision 1.188 / (download) - annotate - [select for diffs], Fri Mar 13 00:31:05 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.187: +10 -77 lines
Diff to previous 1.187 (colored)

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.

Revision 1.187 / (download) - annotate - [select for diffs], Thu Feb 27 01:25:57 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.186: +17 -24 lines
Diff to previous 1.186 (colored)

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@.

Revision 1.186 / (download) - annotate - [select for diffs], Mon Jan 20 10:29:31 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +4 -4 lines
Diff to previous 1.185 (colored)

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.

Revision 1.185 / (download) - annotate - [select for diffs], Tue Jul 23 17:42:14 2019 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.184: +13 -1 lines
Diff to previous 1.184 (colored)

tagging support for .TP and .TQ; try e.g. man -O tag=commit cvs

Revision 1.184 / (download) - annotate - [select for diffs], Mon Jul 22 03:20:55 2019 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +65 -2 lines
Diff to previous 1.183 (colored)

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.

Revision 1.183 / (download) - annotate - [select for diffs], Mon Jul 1 22:43:03 2019 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.182: +2 -2 lines
Diff to previous 1.182 (colored)

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

Revision 1.182 / (download) - annotate - [select for diffs], Thu Jun 27 12:19:39 2019 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +17 -12 lines
Diff to previous 1.181 (colored)

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@.

Revision 1.181 / (download) - annotate - [select for diffs], Sat Jan 5 21:13:55 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.180: +4 -2 lines
Diff to previous 1.180 (colored)

In groff, when the .SY block macro occurs in no-fill mode,
the output line gets broken after the head.  Do the same.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Jan 5 01:29:21 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +65 -82 lines
Diff to previous 1.179 (colored)

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

Revision 1.179 / (download) - annotate - [select for diffs], Sat Jan 5 00:36:46 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +6 -3 lines
Diff to previous 1.178 (colored)

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.

Revision 1.178 / (download) - annotate - [select for diffs], Mon Dec 31 11:01:34 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.177: +7 -48 lines
Diff to previous 1.177 (colored)

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.

Revision 1.177 / (download) - annotate - [select for diffs], Mon Dec 31 07:07:43 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.176: +7 -4 lines
Diff to previous 1.176 (colored)

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.

Revision 1.176 / (download) - annotate - [select for diffs], Sun Dec 30 00:48:47 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +5 -6 lines
Diff to previous 1.175 (colored)

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.

Revision 1.175 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:14 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +1 -2 lines
Diff to previous 1.174 (colored)

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.

Revision 1.174 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:06 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +10 -3 lines
Diff to previous 1.173 (colored)

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.

Revision 1.173 / (download) - annotate - [select for diffs], Sun Aug 26 16:18:38 2018 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored)

Support nesting of elements with next-line scope.
For example, ksh93(1) needs this for .B\n.SM.

Revision 1.172 / (download) - annotate - [select for diffs], Sat Aug 18 17:06:58 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +2 -2 lines
Diff to previous 1.171 (colored)

.SY causes a one-column indentation even without any argument

Revision 1.171 / (download) - annotate - [select for diffs], Sat Aug 18 14:25:55 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +3 -3 lines
Diff to previous 1.170 (colored)

The .nf/.fi (fill mode) requests never have text children
and in particular do not reset font mode.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Aug 18 14:02:52 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.169: +3 -2 lines
Diff to previous 1.169 (colored)

Two consecutive .SY blocks only get a blank line in between
if the first one is explicitly closed with .YS.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Aug 18 13:04:48 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.168: +3 -2 lines
Diff to previous 1.168 (colored)

prevent line breaks in the middle of .OP

Revision 1.168 / (download) - annotate - [select for diffs], Sat Aug 18 02:03:41 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.167: +61 -1 lines
Diff to previous 1.167 (colored)

implement the GNU man-ext .SY/.YS (synopsis block) macro in man,
used in most manual pages of the groff package

Revision 1.167 / (download) - annotate - [select for diffs], Fri Aug 17 20:31:52 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.166: +22 -14 lines
Diff to previous 1.166 (colored)

Remove more pointer arithmetic passing via regions outside the array
that is undefined according to the C standard.  Robert Elz <kre at
munnari dot oz dot au> pointed out i wasn't quite done yet.

Revision 1.166 / (download) - annotate - [select for diffs], Thu Aug 16 23:40:19 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.165: +4 -2 lines
Diff to previous 1.165 (colored)

implement the GNU man-ext .TQ macro in man(7),
used for example by groff_diff(7)

Revision 1.165 / (download) - annotate - [select for diffs], Tue Aug 14 01:26:12 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.164: +3 -1 lines
Diff to previous 1.164 (colored)

support tail arguments on the .ME and .UE macros,
used for example in the ditroff(7) manual of the groff package

Revision 1.164 / (download) - annotate - [select for diffs], Sun Jun 10 15:12:32 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.163: +13 -1 lines
Diff to previous 1.163 (colored)

When formatting man(7) documents that do not contain .SH macros
with -Tps or -Tpdf, do not squeeze the whole text beyond the right
margin.  Bug reported by Will Backman during BSDCan.

Revision 1.163 / (download) - annotate - [select for diffs], Wed Apr 11 17:10:35 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.162: +8 -5 lines
Diff to previous 1.162 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.162 / (download) - annotate - [select for diffs], Mon Jul 31 15:18:59 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.161: +3 -3 lines
Diff to previous 1.161 (colored)

Fix an out of bounds read access to a constant array that caused
segfaults on certain hardened versions of glibc.  Triggered by .sp
or blank lines right before .SS or .SH, or before the first .Sh.
Found the hard way by Dr. Markus Waldner on Debian
and by Leah Neukirchen on Void Linux.

Revision 1.161 / (download) - annotate - [select for diffs], Sun Jun 25 07:23:53 2017 UTC (6 years, 10 months ago) by bentley
Branch: MAIN
Changes since 1.160: +3 -1 lines
Diff to previous 1.160 (colored)

Add support for the MT and ME mailto macros, used for example in wg(8).

feedback and ok schwarze@

Revision 1.160 / (download) - annotate - [select for diffs], Sat Jun 17 13:05:47 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.159: +5 -2 lines
Diff to previous 1.159 (colored)

correct handling of blank lines after \c

Revision 1.159 / (download) - annotate - [select for diffs], Sat Jun 17 01:26:48 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.158: +5 -5 lines
Diff to previous 1.158 (colored)

properly set the default indentation
such that even pages without any .SH macros get it

Revision 1.158 / (download) - annotate - [select for diffs], Wed Jun 14 17:50:43 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.157: +6 -6 lines
Diff to previous 1.157 (colored)

improve rounding rules for scaling units
in horizontal orientation in the terminal formatter

Revision 1.157 / (download) - annotate - [select for diffs], Thu Jun 8 12:54:40 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.156: +7 -7 lines
Diff to previous 1.156 (colored)

make the internal a2roffsu() interface more powerful by returning
a pointer to the end of the parsed data, making it easier to
parse subsequent bytes

Revision 1.156 / (download) - annotate - [select for diffs], Wed Jun 7 17:38:08 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.155: +61 -59 lines
Diff to previous 1.155 (colored)

Prepare the terminal driver for filling multiple columns in parallel,
first step: split column data out of the terminal state struct into
a new column state struct and use an array of such column state
structs.  No functional change.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Jun 4 22:43:50 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.154: +7 -12 lines
Diff to previous 1.154 (colored)

Implement the roff(7) .mc (right margin character) request.
The Tcl/Tk manual pages use this extensively.
Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf;
instead, implement a proper TERMP_BRNEVER flag.

Revision 1.154 / (download) - annotate - [select for diffs], Sun Jun 4 18:48:09 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.153: +1 -2 lines
Diff to previous 1.153 (colored)

Make term_flushln() simpler and more robust:
Eliminate the "overstep" state variable.
The information is already contained in "viscol".
Minus 60 lines of code, no functional change intended.

Revision 1.153 / (download) - annotate - [select for diffs], Tue May 9 14:09:37 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.152: +4 -3 lines
Diff to previous 1.152 (colored)

Trailing \c suppresses the output line break even if
the next line is a text line starting with whitespace.
Quirk found in the sysutils/rancid port.

Revision 1.152 / (download) - annotate - [select for diffs], Sun May 7 21:44:33 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.151: +12 -2 lines
Diff to previous 1.151 (colored)

implement .DT in terms of .ta; needed for print/ghostview, for example

Revision 1.151 / (download) - annotate - [select for diffs], Sun May 7 17:30:58 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.150: +4 -2 lines
Diff to previous 1.150 (colored)

Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

Revision 1.150 / (download) - annotate - [select for diffs], Fri May 5 15:16:25 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.149: +1 -52 lines
Diff to previous 1.149 (colored)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.149 / (download) - annotate - [select for diffs], Fri May 5 13:17:04 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.148: +1 -11 lines
Diff to previous 1.148 (colored)

move .ll to the roff modules

Revision 1.148 / (download) - annotate - [select for diffs], Fri May 5 02:06:17 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.147: +1 -38 lines
Diff to previous 1.147 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.147 / (download) - annotate - [select for diffs], Thu May 4 22:07:44 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.146: +3 -11 lines
Diff to previous 1.146 (colored)

Start roff formatter modules for HTML and termininal output,
used by both the mdoc and man formatters, with the ultimate
goal of reducing code duplication between the two macro formatters.
Made possible by the parser unification.
Add the first formatting function (for the .br request).

Revision 1.146 / (download) - annotate - [select for diffs], Thu May 4 17:48:24 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.145: +14 -3 lines
Diff to previous 1.145 (colored)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:09 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.144: +4 -3 lines
Diff to previous 1.144 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.144 / (download) - annotate - [select for diffs], Wed Feb 15 14:09:07 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.143: +2 -2 lines
Diff to previous 1.143 (colored)

Fix previous:  I forgot that i had to change the convention how
a node is marked as "not a macro" when unifying the parsers.
Confirmed to work by Sevan Janiyan.

Revision 1.143 / (download) - annotate - [select for diffs], Sat Feb 11 21:49:43 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.142: +3 -2 lines
Diff to previous 1.142 (colored)

Do not read one element past the end of the static const termacts array.
Bug found by Sevan Janiyan <venture37 at geeklan dot co dot uk>
who ran the OpenBSD mandoc test suite on Ubuntu on POWER8 (sic!)
and reported that mdoc/Sh/before.in failed in -Tman mode.
If that isn't power testing, i don't know...

Revision 1.142 / (download) - annotate - [select for diffs], Sat Feb 4 11:56:48 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.141: +5 -2 lines
Diff to previous 1.141 (colored)

Do not fix the default indent for all subsequent files; some may use
a different macro language and hence require a different indent.
You can see the effect with "man -a 1 host hostname".

Revision 1.141 / (download) - annotate - [select for diffs], Tue Jan 10 13:46:53 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.140: +9 -9 lines
Diff to previous 1.140 (colored)

unify names of AST node flags; no change of cpp output

Revision 1.140 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:04 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.139: +2 -2 lines
Diff to previous 1.139 (colored)

Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a
tiny loop - not only making data smaller, but code shorter as well.

This gets rid of an implicit invariant that confused both static
analysis tools and human auditors.  No functional change.

Revision 1.139 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.138: +1 -11 lines
Diff to previous 1.138 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.138 / (download) - annotate - [select for diffs], Tue Oct 6 18:30:43 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.137: +33 -33 lines
Diff to previous 1.137 (colored)

modernize style: "return" is not a function; ok cmp(1)

Revision 1.137 / (download) - annotate - [select for diffs], Mon Sep 21 13:24:32 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

Trailing whitespace is significant when determining the width of a tag
in mdoc(7) .Bl -tag and man(7) .TP, but not in man(7) .IP.
Quirk reported by Jan Stary <hans at stare dot cz> on ports@.

Revision 1.136 / (download) - annotate - [select for diffs], Sun Apr 19 19:43:50 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.135: +12 -1 lines
Diff to previous 1.135 (colored)

If an explicit line break request (.br or .sp) occurs within an .HP block,
the next line doesn't hang, but is simply indented.
Issue found by Christian Neukirchen <chneukirchen at gmail dot com>
in the dmsetup(8) manual on Linux.
This patch also improves the indentation of XDGA(3) and XrmGetResource(3).

Revision 1.135 / (download) - annotate - [select for diffs], Sun Apr 19 13:59:37 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

Decouple the token code for "no request or macro" from the individual
high-level parsers to allow further unification of functions that
only need to recognize this code, but that don't care about different
high-level macrosets beyond that.

Revision 1.134 / (download) - annotate - [select for diffs], Sat Apr 18 17:50:02 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.133: +6 -10 lines
Diff to previous 1.133 (colored)

Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Apr 18 16:04:40 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.132: +2 -2 lines
Diff to previous 1.132 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Apr 6 22:06:06 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.131: +5 -2 lines
Diff to previous 1.131 (colored)

Do not mistreat empty arguments to font alternating macros
as vertical spacing requests.  Bug found with xmahjongg(6).

Revision 1.131 / (download) - annotate - [select for diffs], Mon Apr 6 14:58:53 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

On a new RS nesting level, the saved width starts from the default
width, not from the saved width of the previous level.
Improves xterm(1) and XSetEventQueueOwner(3); found in transcode_filter(1).

Revision 1.130 / (download) - annotate - [select for diffs], Mon Apr 6 13:34:54 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.129: +4 -2 lines
Diff to previous 1.129 (colored)

Use the default width for .RS without arguments.
Reduces groff-mandoc differences in base and Xenocara by about 4%.
Found while looking at wpa_supplicant(8).

Revision 1.129 / (download) - annotate - [select for diffs], Sat Apr 4 18:52:12 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.128: +13 -1 lines
Diff to previous 1.128 (colored)

Give man(7) section and subsection headers heanging indentation.
Reduces groff-mandoc differences in base by about 2.5% due to
various Perl manuals having long section titles.
Quirk found in argtable2(3).

Revision 1.128 / (download) - annotate - [select for diffs], Sat Apr 4 17:46:58 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.127: +6 -6 lines
Diff to previous 1.127 (colored)

Rounding rules for horizontal scaling widths are more complicated.
There is a first rounding to basic units on the input side.
After that, rounding rules differ between requests and macros.
Requests round to the nearest possible character position.
Macros round to the next character position to the left.

Implement that by changing the return value of term_hspan()
to basic units and leaving the second scaling and rounding stage
to the formatters instead of doing it in the terminal handler.

Improves for example argtable2(3).

Revision 1.127 / (download) - annotate - [select for diffs], Sat Apr 4 11:43:53 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.126: +12 -1 lines
Diff to previous 1.126 (colored)

Fix a quirk with respect to empty .HP.
Found while writing a regression test for man_macro.c rev. 1.66.
Incidentally, this brings rendering of XFreeEventData(3) closer to groff.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Apr 2 23:47:43 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.125: +16 -18 lines
Diff to previous 1.125 (colored)

Third step towards parser unification:
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Apr 2 22:06:17 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.124: +9 -9 lines
Diff to previous 1.124 (colored)

Second step towards parser unification:
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Apr 2 21:03:18 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.123: +48 -47 lines
Diff to previous 1.123 (colored)

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.

Revision 1.123 / (download) - annotate - [select for diffs], Sun Mar 15 16:51:34 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +3 -2 lines
Diff to previous 1.122 (colored)

Avoid off-by-one read access to the termacts array, which could
sometimes result in missing line breaks before subsection headers.
Found by carsten dot kunze at arcor dot de on SuSE 13.2.

Revision 1.122 / (download) - annotate - [select for diffs], Mon Mar 9 17:41:36 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.121: +3 -7 lines
Diff to previous 1.121 (colored)

Fix vertical spacing at the beginning of tables.
man(7) always prints a blank line, mdoc(7) doesn't.
Problem in mdoc(7) reported by kristaps@.
mdoc(7) part of the patch tested by kristaps@.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Jan 30 22:04:15 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.120: +6 -6 lines
Diff to previous 1.120 (colored)

Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees.
No functional change.

Revision 1.120 / (download) - annotate - [select for diffs], Fri Jan 30 17:31:20 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored)

Delete the redundant tbl span flags, just inspect the actual data
where needed, which is less fragile.
This fixes a subtle NULL pointer access to tp->tbl.cols:
Due to a bug in the man(7) parser, the first span of a table can
end up in a .TP head, in which case tblcalc() was never called.
Found by jsg@ with afl.

Revision 1.119 / (download) - annotate - [select for diffs], Sat Jan 24 02:41:32 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +1 -2 lines
Diff to previous 1.118 (colored)

Strangely, ignoring the roff(7) .na request was implemented in the man(7)
parser.  Simplify the code by moving it into the roff(7) parser, also
making it work for mdoc(7).

Revision 1.118 / (download) - annotate - [select for diffs], Wed Dec 24 18:03:34 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +14 -28 lines
Diff to previous 1.117 (colored)

For .RS, we need to save the information how much we actually indented
because negative indents can get truncated, in which case we no longer
know how to restore the original indent at the end of the block.
This also solves another case of effectively infinite output found
by jsg@ with afl, triggered by very large negative indents.

Revision 1.117 / (download) - annotate - [select for diffs], Wed Dec 24 09:57:41 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.116: +19 -10 lines
Diff to previous 1.116 (colored)

When a man(7) document contains unreasonably large numbers for
indentations or paragraph distances, large output may be generated,
which is practically the same as an endless loop; found by jsg@
with afl.
Reject such unreasonably large numbers beyond arbitrary limits
similar to those used by groff (max. 65 blank lines between paragraphs
and max. SHRT_MAX characters per output line) and fall back to
defaults when exceeded.  Having the limits behave in exactly the
same way is not relevant.

Revision 1.116 / (download) - annotate - [select for diffs], Tue Dec 23 13:48:15 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +72 -106 lines
Diff to previous 1.115 (colored)

support negative horizontal widths in man(7);
minus twenty lines of code in spite of enhanced functionality

Revision 1.115 / (download) - annotate - [select for diffs], Tue Dec 23 09:31:17 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.114: +5 -15 lines
Diff to previous 1.114 (colored)

some scaling unit fixes:
- .sp with an invalid argument is .sp 1v, not .sp 0v
- in man(1), trailing garbage doesn't make scaling units invalid

Revision 1.114 / (download) - annotate - [select for diffs], Tue Dec 23 08:15:37 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.113: +3 -4 lines
Diff to previous 1.113 (colored)

even if the second argument to .IP is invalid, don't print it

Revision 1.113 / (download) - annotate - [select for diffs], Tue Dec 23 01:57:11 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.112: +5 -3 lines
Diff to previous 1.112 (colored)

correctly handle scaling units after .PD

Revision 1.112 / (download) - annotate - [select for diffs], Thu Dec 4 02:05:16 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

fix handling of roff requests having a default scale other than "n",
in particular .sp which uses "v", when the scale is not specified;
cures groff-mandoc differences in about a dozen Xenocara manuals

Revision 1.111 / (download) - annotate - [select for diffs], Thu Dec 4 01:33:23 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.110: +24 -13 lines
Diff to previous 1.110 (colored)

Ignore macros that never produce any text when deciding whether
vertical whitespace is needed before a section or subsection.
Cures groff-mandoc differences in more than 300 manuals,
mostly Xenocara, some curses, a few GNU.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Dec 2 10:07:17 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.109: +5 -4 lines
Diff to previous 1.109 (colored)

Fix the implementation and documentation of \c (continue text input line).
In particular, make it work in no-fill mode, too.
Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).

Revision 1.109 / (download) - annotate - [select for diffs], Fri Nov 21 01:52:44 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.108: +11 -19 lines
Diff to previous 1.108 (colored)

We repeatedly observed assertion crashes in the low-level terminal
output handler because the high level terminal formatters could be
tricked into setting the left margin further to the right than the
right margin.  Today, jsg@ found more of these with afl.

Change the internal interface between both levels, aiming for
simplicity and robustness of the code.  Treat both margins as
*independent* settings:  Now, termp.offset is the requested left
margin, and termp.rmargin is the available space.  Let the lower
level cope with that case of insufficient space.

Obviously, high level code that does centering or flush right
still has to do careful checks, so i did a full audit of margin
settings in the terminal formatters.

Fixes crashes caused by excessively long title or date strings in
the man(7) footer, operating system or date strings in the mdoc(7)
footer, volume strings in the man(7) or mdoc(7) header, and a few
cases related to some non-prologue macros.

Revision 1.108 / (download) - annotate - [select for diffs], Tue Oct 28 17:35:42 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.107: +1 -4 lines
Diff to previous 1.107 (colored)

Make the character table available to libroff so it can check the
validity of character escape names and warn about unknown ones.
This requires mchars_spec2cp() to report unknown names again.
Fortunately, that doesn't require changing the calling code because
according to groff, invalid character escapes should not produce
output anyway, and now that we warn about them, that's fine.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Oct 20 15:49:45 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.106: +2 -2 lines
Diff to previous 1.106 (colored)

correct the spacing after in-line equations
that start at the beginning of an input line
but end before the end of an input line

Revision 1.106 / (download) - annotate - [select for diffs], Mon Oct 20 02:46:00 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.105: +3 -1 lines
Diff to previous 1.105 (colored)

correct spacing *after* inline equations (much simpler than expected)

Revision 1.105 / (download) - annotate - [select for diffs], Mon Oct 20 02:31:44 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.104: +3 -1 lines
Diff to previous 1.104 (colored)

correct spacing before inline equations

Revision 1.104 / (download) - annotate - [select for diffs], Wed Sep 3 05:17:08 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.103: +26 -14 lines
Diff to previous 1.103 (colored)

Implement the traditional -h option for man(1): show the SYNOPSIS only.
As usual, we get mandoc -h and apropos -h for free.
Try stuff like "apropos -h In=dirent" or "apropos -h Fa=timespec".

Only useful for terminal output, so -Tps, -Tpdf, -Thtml ignore -h for now.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Jun 20 22:58:41 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.102: +7 -4 lines
Diff to previous 1.102 (colored)

As suggested by jmc@, only include line and column numbers into messages
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual

Another example this applies to is documents having a prologue,
but lacking a body.  Do not throw a FATAL error for these; instead,
issue a warning and show the empty document, in the man(7) case with
the same amount of blank lines as groff does.  Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.

Revision 1.102 / (download) - annotate - [select for diffs], Wed Apr 23 16:07:06 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.101: +10 -14 lines
Diff to previous 1.101 (colored)

Audit strlcpy(3)/strlcat(3) usage.

* Repair three instances of silent truncation, use asprintf(3).
* Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+...
to use asprintf(3) instead to make them less error prone.
* Cast the return value of four instances where the destination
buffer is known to be large enough to (void).
* Completely remove three useless instances of strlcpy(3)/strlcat(3).
* Mark two places in -Thtml with XXX that can cause information loss
and crashes but are not easy to fix, requiring design changes of
some internal interfaces.
* The file mandocdb.c remains to be audited.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Apr 20 20:17:36 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.100: +16 -11 lines
Diff to previous 1.100 (colored)

fix unchecked snprintf(3) in page header printing:
the length of the title is unknown, and speed doesn't matter here,
so use asprintf/free rather than a static buffer

Revision 1.100 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.99: +73 -117 lines
Diff to previous 1.99 (colored)

KNF: case (FOO):  ->  case FOO, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.99 / (download) - annotate - [select for diffs], Tue Apr 8 07:13:01 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.98: +4 -4 lines
Diff to previous 1.98 (colored)

Add a new term_flushln() flag TERMP_BRIND (if break, then indent)
to control indentation of continuation lines in TERMP_NOBREAK mode.
In the past, this was always on; continue using it
for .Bl, .Nm, .Fn, .Fo, and .HP, but no longer for .IP and .TP.

I looked at this because sthen@ reported the issue in a manual
of a Perl module from ports, but it affects base, too: This patch
reduces groff-mandoc differences in base by more than 15%.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Mar 30 21:27:59 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

Support relative arguments to .ll (increase or decrease line length).

Revision 1.97 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:32 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.96: +13 -1 lines
Diff to previous 1.96 (colored)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.96 / (download) - annotate - [select for diffs], Sat Mar 8 16:19:59 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

In .nf mode, use the MAN_LINE flag to detect input line breaks
instead of the man_node line member.  This is required to preserve
line breaks contained in user-defined macros called in .nf mode.
Found in a code audit triggered by fixing a similar issue in .TP.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Mar 8 15:50:21 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.94: +10 -5 lines
Diff to previous 1.94 (colored)

To find out whether .TP head arguments are same-line or next-line arguments,
use the MAN_LINE flag instead of the man_node line member.
This is required such that user-defined macros wrapping .TP work correctly.

Issue found by Havard Eidnes in Tcl_NewStringObj(3), reported via
the NetBSD bug tracking system and Thomas Klausner <wiz at NetBSD>.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Feb 16 12:30:51 2014 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.93: +9 -6 lines
Diff to previous 1.93 (colored)

when indenting, extend the right margin accordingly, when needed;
fixes a crash reported by blambert@ and a few other, similar ones

Revision 1.93 / (download) - annotate - [select for diffs], Sun Dec 22 23:33:52 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.92: +13 -5 lines
Diff to previous 1.92 (colored)

Polishing the worms in my favourite can, term_flushln().

The TERMP_TWOSPACE flag i introduced in August 2009 was idiosyncratic
and served only a very narrow purpose.  Replace it by a more intuitive
and more general termp attribute "trailspace", to be used together
with TERMP_NOBREAK, to request a minimum amount of whitespace at
the end of the current column.  Adapt all code to the new interface.

No functional change intended;
code reviews to confirm that are welcome *eg*.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Nov 11 00:35:51 2013 UTC (10 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.91: +3 -1 lines
Diff to previous 1.91 (colored)

In the parser, when closing an explicit block that is not open,
close below-subsection implicit scopes that may still be open.
In the formatter, make sure indentation is reset when leaving a scope,
not only when entering the next one.

Improves the formatting of gpg(1); issue reported by jca on ports.

Revision 1.91 / (download) - annotate - [select for diffs], Thu Oct 17 20:51:30 2013 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.90: +31 -1 lines
Diff to previous 1.90 (colored)

Implement the .UR/.UE block (uniform resource identifier) introduced in the
man-ext macros by Eric S. Raymond, enabled by default in groff_man(7).
Usual disclaimer: You don't write new man(7) code, so you are not going
to use these, either.
Improves e.g. the bzr(1) and etherape(1) manuals.
Thanks to naddy@ for bringing these to my attention.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Jan 5 22:18:59 2013 UTC (11 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.89: +4 -4 lines
Diff to previous 1.89 (colored)

In literal mode (.nf), each input line must be kept together
on the same output line, even if it is longer than the output width.
This commit fixes a bug allowing an overly long last line of an
indented block (.RS) to be broken even in literal mode.

The bug was found using the sudo_plugin(4) manual provided by millert@.

I introduced the bug in rev. 1.84 during the g2k12 Budapest hackathon.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Nov 17 00:25:20 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.88: +21 -21 lines
Diff to previous 1.88 (colored)

Cleanup naming of local variables to make the code easier on the eye:
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.

ok kristaps@ some time ago

Revision 1.88 / (download) - annotate - [select for diffs], Sun Jul 29 12:35:05 2012 UTC (11 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.87: +35 -13 lines
Diff to previous 1.87 (colored)

Implement .PD for -Tascii.
Reminded about the missing feature by millert@.
This reduces mandoc/groff differences in base by 25%.
ok millert@

Revision 1.87 / (download) - annotate - [select for diffs], Mon Jul 16 21:58:39 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

Always fix the man(7) subsection header (.SS) indent to 3n,
do not let it depend on the default indent provided by -Oindent.
By default, this doesn't change anything because 7 / 2 = 3;
in -Omdoc mode, it makes man(7) output the same as mdoc(7) output.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Jul 14 10:43:48 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.85: +15 -4 lines
Diff to previous 1.85 (colored)

Translate blank input lines to .sp just like in mdoc(7),
and ignore .sp after .PP.  This fixes vertical spacing
for blank lines after .PP and for .sp after .PP.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Jul 13 14:15:50 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.84: +19 -4 lines
Diff to previous 1.84 (colored)

In -man -Tascii, support .sp with negative argument.
In -mdoc -Tman, improve the framework to control vertical spacing.
Use both to support .Bl -compact (surprisingly hard to get right).

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jul 10 19:53:11 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.83: +36 -33 lines
Diff to previous 1.83 (colored)

multiple fixes to -Tascii .HP rendering:
* do not add an excessive blank line before the block
* in literal mode, start a new line after the tag

getting this to work requires some general (print_man_node) fixes:
* in literal mode, break the output line at the end of each
input line, not just after those input lines ending in text
* but don't break it when there was no output on the line
* and adjust the margins after the .HP tag

these general fixes require an adjustment to -Tascii .TP rendering:
* set up NOBREAK mode before the body, not after the head

finally, based on all this, implement -Tman .Bl -hang in terms of .HP

Revision 1.83 / (download) - annotate - [select for diffs], Sat Jun 2 20:07:09 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.82: +4 -2 lines
Diff to previous 1.82 (colored)

Minimal implementation of .EX and .EE for GNU compatibility.
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Feb 26 19:41:27 2012 UTC (12 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.81: +28 -3 lines
Diff to previous 1.81 (colored)

Support .OP, one of the extended man macros; from kristaps@.
Do not use this GNU extension, we take it for compatibility only.

Revision 1.81 / (download) - annotate - [select for diffs], Mon Dec 5 00:28:12 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.80: +25 -14 lines
Diff to previous 1.80 (colored)

As requested by kristaps@, add and improve comments related to -Omdoc;
while here, clean up some redundant initializations in print_man_head().

Revision 1.80 / (download) - annotate - [select for diffs], Sun Dec 4 00:44:18 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.79: +6 -1 lines
Diff to previous 1.79 (colored)

When a man document contains nothing at all except one or more invalid
macros, do not die on an assertion, but show correct error messages.
Assertions of meta data validity suggested by joerg@.
ok joerg@

Revision 1.79 / (download) - annotate - [select for diffs], Sun Nov 13 15:46:04 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.78: +13 -5 lines
Diff to previous 1.78 (colored)

Implement mdoc(7)-like output style variant for man(7) documents:
* one instead of three blank lines after the page header;
* one instead of three blank lines before the page footer;
* source instead of title(section) in the lower right corner.
Select this style variant with the undocumented command line option -Omdoc.

Revision 1.78 / (download) - annotate - [select for diffs], Sun Nov 13 15:29:44 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +17 -10 lines
Diff to previous 1.77 (colored)

Make the man(7) page footer the same as in groff.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Nov 13 13:05:23 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.76: +14 -13 lines
Diff to previous 1.76 (colored)

Make the default left text margin configurable from the command line,
just like the default right margin already is.  This may be useful for
people with expensive screen real estate.  Besides, it helps automated
man(7) to mdoc(7) output comparisons to validate -Tman output.
ok kristaps@ on an earlier version

Revision 1.76 / (download) - annotate - [select for diffs], Wed Sep 21 09:57:11 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.75: +3 -5 lines
Diff to previous 1.75 (colored)

As noticed by kristaps@, when breaking an overflowing line,
forget about pending whitespace (vbl), or the next line would
be misaligned and potentially too long; but i'm fixing this
in a simpler way than he proposed.
Also remove the kludges in .HP that compensated for this bug.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Sep 20 14:20:47 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

Using user-defined macros, surprisingly, it is possible
to have *next*-line head arguments on the *same* input line.
So .TP must not assume that a head argument with a matching
input line number is a same-line argument (and access a NULL pointer).
Bug found and fix tested by kristaps@ with groff_hdtbl(7).

Revision 1.74 / (download) - annotate - [select for diffs], Tue Sep 20 13:13:21 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.73: +3 -2 lines
Diff to previous 1.73 (colored)

When advancing the left margin, .RS also needs to reset the right margin
to the default and check that the left does not outgrow the right one.
Otherwise, the (rmargin >= offset) assertion fails in term_flushln().
Bug found and fix tested by kristaps@ with NetBSD slapo-retcode(5).

Revision 1.73 / (download) - annotate - [select for diffs], Tue Sep 20 09:02:18 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +5 -5 lines
Diff to previous 1.72 (colored)

Sync print_mdoc_head to print_man_head;
this was forgotten after man_term.c rev. 1.25 on March 2, 2010.
The benefit is a sane page header line when .Dt is very long.
Reminded by Thomas Klausner <wiz at NetBSD>, thanks.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Sep 19 22:36:11 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.71: +23 -13 lines
Diff to previous 1.71 (colored)

Remove the terminal frontend flag TERMP_NOLPAD.

In columnated contexts (.Bl -column, .Bl -tag, .IP, .TP, .HP etc.), do not
pad after writing a column.  Instead, always pad before writing content.

In itself, this change avoids:
 - writing trailing whitespace in some situations
 - with .fi/.nf in .HP, breaking lines that were already padded

It allows several bugfixes included in this patch:
 - Do not count backspace as a character with positive width.
 - Set up proper indentation when encountering .fi/.nf in .HP.
 - Adjust the .HP indentation width to what groff does.
 - Never unlimit the right margin unless in the final column.

This reduces the groff/mandoc-differences in base by nearly 20%,
from 89k to 72k lines of diffs.

ok kristaps@

Revision 1.71 / (download) - annotate - [select for diffs], Sun Sep 18 10:25:28 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

sync to version 1.11.5:
adding an implementation of the eqn(7) language
by kristaps@

So far, only .EQ/.EN blocks are handled, in-line equations are not, and
rendering is not yet very pretty, but the parser is fairly complete.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Jul 7 21:10:48 2011 UTC (12 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.69: +29 -35 lines
Diff to previous 1.69 (colored)

As .RS may nest and may contain embedded paragraphs,
keep a stack of left margins; this fixes e.g. lynx(1).
While here, clean up some code in .TP HEAD;
it can only have text children, anyway.
From kristaps@.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jul 5 04:12:41 2011 UTC (12 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.68: +46 -30 lines
Diff to previous 1.68 (colored)

Sync to bsd.lv (all coded by kristaps@):
 - mdoc(7): fix an assertion if the first line after .Bd -column
   starts with a blank, and some simplifications in mdoc_argv.c
 - man(7): literal mode ends at .SH and .SS (bug reported by naddy@)
 - allow .RS/.RE blocks to nest (bug reported by dcoppa@ and gsoares@)
 - improve vertical spacing of man(7) blocks
 - roff(7): clear user-defined strings when starting a new file
 - correct ID tags in -T[x]html

Revision 1.68 / (download) - annotate - [select for diffs], Sun May 29 21:22:18 2011 UTC (12 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +2 -9 lines
Diff to previous 1.67 (colored)

Merge release 1.11.3, almost all code by kristaps@:
* Unicode output support (no Unicode input yet, though).
* Refactoring: completely handle predefined strings in roff.c.
- New function mandoc_escape() replaces a2roffdeco() and mandoc_special().
- Start using mandoc_getarg() in mdoc_argv.c.
- Clean up parsing of delimiters in mdoc(7).
* And many minor fixes and lots of cleanup.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Apr 24 16:22:02 2011 UTC (13 years ago) by schwarze
Branch: MAIN
Changes since 1.66: +1 -2 lines
Diff to previous 1.66 (colored)

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Mar 20 23:36:42 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +4 -1 lines
Diff to previous 1.65 (colored)

Import the foundation for eqn(7) support.
Written by kristaps@.

For now, i'm adding one line to each of the four frontends
to just pass the input text through to the output,
not yet interpreting any of then eqn keywords.

Revision 1.65 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:33 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +3 -9 lines
Diff to previous 1.64 (colored)

Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

Revision 1.64 / (download) - annotate - [select for diffs], Tue Jan 25 12:35:07 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.63: +4 -1 lines
Diff to previous 1.63 (colored)

Avoid double blank line before a table preceded by .PP.
ok kristaps@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jan 23 14:54:15 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +4 -1 lines
Diff to previous 1.62 (colored)

Fix another regression caused by the reorg of print_man_node() in rev. 1.61:
End-of-sentence spacing got lost for man(7) after plain text lines.

Revision 1.62 / (download) - annotate - [select for diffs], Mon Jan 17 00:15:19 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored)

Refrain from throwing fatal errors for
* .br .sp .nf .fi .na with arguments - just skip the arguments
* .TH lacking arguments - use empty strings instead like groff
* .TH with excessive arguments - skip those
Reminded by Joerg Sonnenberger, ok kristaps@.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Jan 16 03:46:21 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +35 -29 lines
Diff to previous 1.60 (colored)

In literal context, do not generate output line breaks between macro
arguments.  This fixes a long-standing bug reported repeatedly,
in particular by naddy@ and brad@.
Fix by kristaps@, minus one regression caught by my test suite.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jan 16 02:56:47 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +7 -3 lines
Diff to previous 1.59 (colored)

If the first character of a free-form text input line is whitespace,
then it will start a new output line;
from kristaps@.

Revision 1.59 / (download) - annotate - [select for diffs], Tue Jan 11 00:59:28 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +6 -1 lines
Diff to previous 1.58 (colored)

When (cumulative) indentation requested by .in exceeds the right
margin, do not run into an assert(3)ion.
Problem reported by brad@ in gm(1), fix by kristaps@.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.57: +14 -22 lines
Diff to previous 1.57 (colored)

Merge kristaps@' cleaner tbl integration, removing mine;
there are still a few bugs, but fixing these will be easier in tree.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jan 4 01:15:39 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +25 -17 lines
Diff to previous 1.56 (colored)

Multiple man(7) .IP and .TP fixes started during p2k10:

Affecting both -Tascii and -Thtml:
* The .IP HEAD uses the second argument as the width, not the last one.
* Only print the first .IP HEAD argument, not all but the last.

Affecting only -Tascii:
* The .IP and .TP HEADs must be printed without literal mode,
  but literal mode must be restored afterwards.
* After the .IP and .TP bodies, we only want term_newln(), not
  term_flushln(), or we would get two blank lines in literal mode.
* The .TP HEAD does not use TWOSPACE, just like .IP doesn't either.
* In literal mode, clear NOLPAD after each line, or subsequent lines
  would get no indentation whatsoever.

Affecting only -Thtml:
* Only print next-line .TP children, instead of all but the first.

OK kristaps@ on the -Tascii part; and:
"Can you work this into man_html.c, too?"

Revision 1.56 / (download) - annotate - [select for diffs], Sun Dec 19 07:53:12 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +1 -3 lines
Diff to previous 1.55 (colored)

Remove `i' and `r' macro handlers.  These macros, originally part of the
me package, aren't recognised by "groff -mandoc" so we don't need to do
so either.  Besides, they are not used in base or Xenocara, and only at
two or three places in one single port, which are probably typos.
From kristaps@.

Revision 1.55 / (download) - annotate - [select for diffs], Tue Dec 7 00:08:52 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +1 -5 lines
Diff to previous 1.54 (colored)

Complete the merge of bsd.lv version 1.10.7:
No more functional changes, just sync ordering, comments and white space.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Dec 6 22:43:54 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Never print .P, .PP, and .LP header content.
From kristaps@.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Nov 29 02:26:45 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +4 -12 lines
Diff to previous 1.52 (colored)

Now that we have proper .de support in the roff(7) library,
it is time to remove the .Sp, .Vb, and .Ve kludge
that was added to the man(7) library to build Perl manuals.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Nov 29 00:12:02 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +46 -1 lines
Diff to previous 1.51 (colored)

Implement the roff .ft (change font) request for man(7).
Of course, we don't want to encourage low-level physical markup,
but pod2man(1) writes such requests, so Perl manuals contain them,
and some Xenocara and lots and lots of ports manuals use them as well.
In base and Xenocara, this will reduce mandoc -Tlint ERROR noise;
in ports, it will improve rendering of many manuals.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Oct 28 10:42:39 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +47 -71 lines
Diff to previous 1.50 (colored)

Font alternating blocks like .RB must not break the line between children
in literal mode.  Fixing a bug found by naddy@ in the gettext(3) SYNOPSIS.
This required a bit of refactoring:
* consolidate pre_RB(), pre_RI(), and pre_BI() into pre_alternate()
* save the MANT_LITERAL mode before descending into children
* restore MANT_LITERAL mode before printing the last child

Revision 1.50 / (download) - annotate - [select for diffs], Sat Oct 16 20:49:37 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +3 -5 lines
Diff to previous 1.49 (colored)

Do not abort() on tbl errors, reduce the risk that tbl stuff kills a build,
and provide more useful tbl error messages in a non-intrusive way.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 15 22:07:12 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Move tbl width calculation from plain strlen to mandoc terminal width
calculation routines.  This gives us mostly sane table column widths.
"move forward" deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Fri Oct 15 21:33:47 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Move tbl output from plain stdio to mandoc terminal output routines.
This fixes (1) all escape sequences and (2) some aspects of indentation.
Table column widths are still way off, though.
"move forward" deraadt@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Oct 15 20:45:03 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +22 -1 lines
Diff to previous 1.46 (colored)

Minimal glue to integrate tbl into the mandoc man(7) parser and formatter.
The output dosn't look nice yet, escape handling is still missing,
but will follow soon.
"move forward aggressively :-)" deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Sep 21 22:33:41 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +5 -1 lines
Diff to previous 1.45 (colored)

When calculating string lengths, resolve escape sequences and use
their actual lengths.  Will improve vertical alignment in some
uncommon situations, for example when escape sequences occur in
list or column width strings or in .Nm block arguments in the SYNOPSIS.
From kristaps@.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jul 25 18:05:54 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.44: +69 -30 lines
Diff to previous 1.44 (colored)

Sync to bsd.lv; in particular, pull in lots of bug fixes.
new features:
* support the .in macro in man(7)
* support minimal PDF output
* support .Sm in mdoc(7) HTML output
* support .Vb and .nf in man(7) HTML output
* complete the mdoc(7) manual
bug fixes:
* do not let mdoc(7) .Pp produce a newline before/after .Sh; reported by jmc@
* avoid double blank lines related to man(7) .sp and .br
* let man(7) .nf and .fi flush the line; reported by jsg@ and naddy@
* let "\ " produce a non-breaking space; reported by deraadt@
* discard \m colour escape sequences; reported by J.C. Roberts
* map undefined 1-character-escapes to the literal character itself
maintenance:
* express mdoc(7) arguments in terms of an enum for additional type-safety
* simplify mandoc_special() and a2roffdeco()
* use strcspn in term_word() in place of a manual loop
* minor optimisations in the -Tps and -Thtml formatting frontends

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jul 13 01:09:13 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +2 -3 lines
Diff to previous 1.43 (colored)

Merge release 1.10.4 (all code by kristaps@), providing four new features:
1) Proper .Bk support: allow output line breaks at input line breaks,
but keep input lines together in the output, finally fixing
synopses like aucat(1), mail(1) and tmux(1).
2) Mostly finished -Tps (PostScript) output.
3) Implement -Thtml output for .Nm blocks and .Bk -words.
4) Allow iterative interpolation of user-defined roff(7) strings.
Also contains some minor bugfixes and some performance improvements.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jun 27 21:54:42 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

Full .nr nS support, unbreaking the kernel manuals.

Kristaps coded this from scratch after reading my .nr patch;
it is simpler and more powerful.

Registers live in struct regset in regs.h, struct man and struct mdoc
contain pointers to it.  The nS register is cleared when parsing .Sh.
Frontends respect the MDOC_SYNPRETTY flag set in mdoc node_alloc.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jun 26 19:08:00 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +39 -41 lines
Diff to previous 1.41 (colored)

As a first step towards variable-width font support,
move all width calculations in term_*.c, *_width().
From kristaps.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Jun 10 22:50:10 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +14 -9 lines
Diff to previous 1.40 (colored)

minimal initial -Tps support, from kristaps@ GSOC
so far, monospace without font decoration,
but it already has page headers and footers

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jun 6 18:08:41 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +5 -2 lines
Diff to previous 1.39 (colored)

Merge bsd.lv release 1.10.0,
which is mostly the post-hackathon release,
bringing in the OpenBSD changes to bsd.lv,
but which also has a few additional minor fixes:

* .Lb is an in-line macro, not in_line_eoln
* .Bt, .Ud now warn when discarding arguments
* allow bad -man dates to flow verbatim into the front-ends
- so far all reported by Ulrich Spoerlein
* .Ar, .Fl and .Li starting with closing punctuation emit an empty element
* empty .Li macros print nothing, but may cause spacing
* proper EOS handling for .Bt, .Ex, .Rv, and .Ud.
* cleanup: collapse posts_xr into posts_wtext (which is the same)
* efficiency: very simple table lookup for roff.c

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 5 19:09:55 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +3 -8 lines
Diff to previous 1.38 (colored)

Increase the -man -Tascii text width from 65 to 78 characters
in both our old in-tree groff and in mandoc, because
1) It looks and reads better.
2) It agrees with both bsd.lv mandoc and with modern groff.
The tmac.an part was done by millert@, with a minor fix by me.

While touching our old groff, switch off hyphenation, suggested a long
time ago by millert@.  It helps searching and comparisons.

While touching mandoc terminal_man(), explicitely initialize the
tabwidth - not strictly required, but easier to understand
and more robust, also suggested by millert@.

General mumbling of agreement by many,
including millert@ deraadt@ jmc@ sobrado@ ...

Remaining problem:
Setting the title length (.lt) has no effect for me,
but we can fix this in tree in case anybody figures it out.

Revision 1.38 / (download) - annotate - [select for diffs], Mon May 24 01:36:22 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +3 -1 lines
Diff to previous 1.37 (colored)

sync to bsd.lv:
modern groff produces three blank lines before the man(7) footer;
from Joerg Sonnenberger.

Revision 1.37 / (download) - annotate - [select for diffs], Sun May 23 22:45:00 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
  eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
  probably lose information or produce structurally garbled output;
  it will try to produce output anyway but exit non-zero at the end,
  which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
  is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.

Revision 1.36 / (download) - annotate - [select for diffs], Sun May 23 20:57:16 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

implement .AT and .UC; from Joerg Sonnenberger

Revision 1.35 / (download) - annotate - [select for diffs], Thu May 20 00:58:02 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.34: +1 -4 lines
Diff to previous 1.34 (colored)

Support nested roff instructions:
* allow roff_parseln() to be re-run
* allow roff_parseln() to manipulate the line buffer offset
* support the offset in the man and mdoc libraries
* adapt .if, .ie, .el, .ig, .am* and .de* support
* interpret some instructions even in conditional-negative context
Coded by kristaps during the last day of the mandoc hackathon.

To avoid regressions in the OpenBSD tree, commit this together
with some small local additions:
* detect roff block end "\}" even on macro lines
* actually implement the ".if n" conditional
* ignore .ds, .rm and .tr in libroff

Also back my old .if/.ie/.el-handling out of libman, reverting:
man.h 1.15 man.c 1.25 man_macro.c 1.15 man_validate.c 1.19
man_action.c 1.15 man_term.c 1.28 man_html.c 1.9.

Revision 1.34 / (download) - annotate - [select for diffs], Sun May 16 00:54:03 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.33: +1 -7 lines
Diff to previous 1.33 (colored)

In theory, Kristaps never intended to write a roff parser,
but in practice, most real legacy man(7)uals are using so much
low level roff that we can't really get away without at least
partially handling some roff instructions.

As doing this in man(7) only has become messy and as even some
mdoc(7) pages need it, start a minimal partial roff preprocessor.
As a first step, move handling of .am[i], .de[i] and .ig there.
Do not use the roff preprocessor for new manuals!

Now that we have three main parser libraries - roff, man and mdoc -
each one having its own error handling is becoming messy, too.
Thus, start unifying message handling in one central place,
introducing a new generic function mmsg().

coded by kristaps@

Revision 1.33 / (download) - annotate - [select for diffs], Sat May 15 22:18:55 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.32: +1 -3 lines
Diff to previous 1.32 (colored)

For .IP, a single space after the head is sufficient;
by Joerg Sonnenberger.

Revision 1.32 / (download) - annotate - [select for diffs], Sat May 15 21:09:53 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.31: +13 -3 lines
Diff to previous 1.31 (colored)

More systematic output width handling by Joerg Sonnenberger:
* save and restore the output width when switching to MANT_LITERAL
* add an argument to ascii_alloc to specify the output width
* set the default output width to 80 minus 2 characters
* OpenBSD local: set the output width to 65 characters for -man

Revision 1.31 / (download) - annotate - [select for diffs], Sat May 15 18:06:03 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

removed restriction on integer manual sections in -man;
by kristaps@

Revision 1.30 / (download) - annotate - [select for diffs], Fri May 14 19:52:43 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.29: +4 -1 lines
Diff to previous 1.29 (colored)

Integrate kristaps@' end-of-sentence (EOS) framework
which is simpler and more powerful than mine, and remove mine.

* man(7) now has EOS handling, too
* put EOS detection into its own function in libmandoc
* use node and termp flags to communicate the EOS condition
* no more EOS pseudo-macro
* no more non-printable EOS marker character on the formatter level

This slightly breaks EOS detection after trailing punctuation
in mdoc(7) macros, but that will be restored soon.

Revision 1.29 / (download) - annotate - [select for diffs], Fri May 14 14:47:44 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.28: +22 -6 lines
Diff to previous 1.28 (colored)

Merge 1.9.25, keeping local patches;
this does not merge kristaps' end-of-sentences handling yet,
i will check that separately.  This one includes:
* handle \*(Ba as a delimiter
* introduce ARGS_PEND for .Bl -column .It end-of-line special casing
* section ordering: expect EXIT STATUS at the right place
* line break fixes in SYNOPSIS
* allow literal contexts to have arbitrary line lengths
* the input file column number can not be used to identify the beginning
  of a line because white space is allowed after the initial '.'
* proper leading spaces in -man -Tascii mode
* do not let Lb break lines in -mdoc -Thtml LIBRARY

Revision 1.28 / (download) - annotate - [select for diffs], Sun Apr 25 16:32:19 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.27: +4 -1 lines
Diff to previous 1.27 (colored)

Implement roff conditional instructions .if .ie .el, in man(7) only for now;
fixing OpenBSD::PackageName(3p) and friends for espie@.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Mar 26 01:22:05 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.26: +19 -7 lines
Diff to previous 1.26 (colored)

merge 1.9.17, keeping local patches

* much improved pod2man support and low-level roff robustness
* have -Tlint imply -Wall and -fstrict
* use fewer macros and more enum in libman
* and various bug fixes

Revision 1.26 / (download) - annotate - [select for diffs], Thu Mar 25 23:23:01 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.25: +42 -38 lines
Diff to previous 1.25 (colored)

merge 1.9.16, keeping local patches

This is mostly cleanup by kristaps@ after my rather hackish patch
to tolerate the non-text macros .na, .sp, .br in next-line scope;
plus some nesting issues fixed by him, all in man(7).
This survived a full  cd /usr/src; make man.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Mar 2 01:24:04 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.24: +16 -9 lines
Diff to previous 1.24 (colored)

In man(7), do not crash on very long title lines,
and do not emulate groff's habit of printing garbage either,
but just print the wanted information even though the format
must be sacrificed because it won't fit.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Mar 2 01:17:20 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +4 -1 lines
Diff to previous 1.23 (colored)

For -man -Tascii, limit the width of normal text to 65 characters,
and effectively unlimit the width of literal displays.
Following this traditional behaviour allows for automatic output
comparisons.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Mar 2 01:00:39 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +4 -1 lines
Diff to previous 1.22 (colored)

Accept the non-standard macros .Sp (similar to .sp)
and .Vb/.Ve (similar to .nf/.fi) in man(7) mode.
These are not intended to be used manually, but they allow us to
properly render man(7) code autogenerated by pod2man(1),
making Perl and OpenSSL happy in our tree.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Feb 26 12:42:29 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +6 -3 lines
Diff to previous 1.21 (colored)

The groff_man(7) manual says "the first line of text following" .TP is
used as a label, not "the first line following", so allow (some kinds of)
intervening macros - some people actually put macros in between.

On the other hand, when there is no text line before the next block macro,
that is, when the .TP block ends without any text line, then something *is*
broken, so still error out in that case.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Dec 24 02:08:14 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +43 -117 lines
Diff to previous 1.20 (colored)

sync to 1.9.14: rewrite escape sequence handling:
- new function a2roffdeco
- font modes (\f) only affect the current stack point
- implement scaling (\s)
- implement space suppression (\c)
- implement non-breaking space (\~) in -Tascii
- many manual improvements

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 22 23:58:00 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +7 -19 lines
Diff to previous 1.19 (colored)

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.19 / (download) - annotate - [select for diffs], Tue Oct 27 21:40:07 2009 UTC (14 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +35 -36 lines
Diff to previous 1.18 (colored)

sync to 1.9.11: adapt printing of dates to groff conventions,
NetBSD portability fixes and some minor bugfixes and feature enhancements;
also checked that my hyphenation code still works on top of this

Revision 1.18 / (download) - annotate - [select for diffs], Wed Oct 21 19:13:50 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +76 -56 lines
Diff to previous 1.17 (colored)

sync to 1.9.9, featuring:
 * -Thtml output mode
 * roff scaling units
 * and some minor fixes
for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.17 / (download) - annotate - [select for diffs], Mon Oct 19 21:43:16 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +32 -66 lines
Diff to previous 1.16 (colored)

sync to 1.9.7: consolidate some -man -Tascii functions,
and use a static buffer for the footer

Revision 1.16 / (download) - annotate - [select for diffs], Mon Sep 21 20:57:57 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +6 -10 lines
Diff to previous 1.15 (colored)

sync to 1.9.5: make terminal_*, tree_* and out_* functions return void,
making the code simpler

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 21 20:28:43 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +35 -24 lines
Diff to previous 1.14 (colored)

sync to 1.9.5: remove TERMP_STYLE bit field in favour of recursion-friendly
integer flags, simplifying and shortening the code

Revision 1.14 / (download) - annotate - [select for diffs], Fri Sep 18 22:46:14 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +13 -2 lines
Diff to previous 1.13 (colored)

sync to 1.9.2: Add .UC libman macro for compatibility, has no effect.
Correct .UC and .DT to not print their arguments.
Document that .UC and .DT should not be used.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Aug 22 23:17:40 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +94 -20 lines
Diff to previous 1.12 (colored)

another large chunk of -man updates,
among others regarding .DT, .HP, .RS, .RE, .SH, .SS, and scoping,
now in sync vith release 1.9.1

Revision 1.12 / (download) - annotate - [select for diffs], Sat Aug 22 20:19:24 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +1 -6 lines
Diff to previous 1.11 (colored)

Oops, kill an "#ifdef __linux__" that crept in with the previous commit.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Aug 22 20:14:37 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +458 -86 lines
Diff to previous 1.10 (colored)

Kristaps@ significantly overhauled libman.
I'm committing this in one large chunk because in contrast to -mdoc, -man
is mostly untested in OpenBSD anyway, so any fallout can be fixed in-tree.
Among others, improved support for .IP, .HP, and .TP.
Now in sync with release 1.9.0.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Aug 22 18:10:02 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +4 -1 lines
Diff to previous 1.9 (colored)

sync to 1.9.0: move indentation size into *term.c files,
improving -man indentation

Revision 1.9 / (download) - annotate - [select for diffs], Sat Aug 22 15:15:37 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

sync to 1.8.4: support .sp in -man

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jun 23 22:43:30 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.7: +14 -2 lines
Diff to previous 1.7 (colored)

sync to 1.7.20: fix .br support in -man

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jun 21 20:49:33 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +5 -2 lines
Diff to previous 1.6 (colored)

sync to 1.7.19: do not try to print_body() when there is none

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jun 18 23:34:53 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

sync to 1.7.19: improved comment handling

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jun 18 21:34:54 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

sync to 1.7.16: adjust centering of header lines to groff conventions

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 18 21:16:11 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +6 -3 lines
Diff to previous 1.3 (colored)

sync to 1.7.16: catch overflow of the right margin by the .IP macro
currently, this code is deactivated, anyway

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 17 22:27:34 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

strftime returns size_t, not a pointer; no functional change
ok kristaps@

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 14 23:00:57 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +11 -13 lines
Diff to previous 1.1 (colored)

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 6 20:30:40 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN

Initial check-in of mandoc for formatting manuals. ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.