CVS log for mandoc/man_term.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.244 / (download) - annotate - [select for diffs], Mon Nov 13 19:13:01 2023 UTC (4 months, 2 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.243: +6 -11 lines
Diff to previous 1.243 (colored) to selected 1.220 (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.243 / (download) - annotate - [select for diffs], Tue Oct 24 20:53:12 2023 UTC (5 months ago) by schwarze
Branch: MAIN
Changes since 1.242: +27 -2 lines
Diff to previous 1.242 (colored) to selected 1.220 (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.242 / (download) - annotate - [select for diffs], Fri Apr 28 20:23:19 2023 UTC (11 months ago) by schwarze
Branch: MAIN
Changes since 1.241: +3 -11 lines
Diff to previous 1.241 (colored) to selected 1.220 (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.241 / (download) - annotate - [select for diffs], Sun Aug 28 09:57:14 2022 UTC (19 months ago) by schwarze
Branch: MAIN
Changes since 1.240: +2 -2 lines
Diff to previous 1.240 (colored) to selected 1.220 (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.240 / (download) - annotate - [select for diffs], Tue Aug 16 17:45:55 2022 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.239: +5 -2 lines
Diff to previous 1.239 (colored) to selected 1.220 (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.239 / (download) - annotate - [select for diffs], Mon Aug 15 18:46:30 2022 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.238: +21 -25 lines
Diff to previous 1.238 (colored) to selected 1.220 (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.289 is used.

Revision 1.238 / (download) - annotate - [select for diffs], Mon Aug 15 13:04:43 2022 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.237: +2 -1 lines
Diff to previous 1.237 (colored) to selected 1.220 (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.237 / (download) - annotate - [select for diffs], Wed Apr 27 17:11:24 2022 UTC (23 months ago) by schwarze
Branch: MAIN
Changes since 1.236: +4 -4 lines
Diff to previous 1.236 (colored) to selected 1.220 (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.236 / (download) - annotate - [select for diffs], Mon Jun 28 19:50:15 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.235: +1 -9 lines
Diff to previous 1.235 (colored) to selected 1.220 (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.235 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:28 2020 UTC (4 years ago) by schwarze
Branch: MAIN
Changes since 1.234: +10 -77 lines
Diff to previous 1.234 (colored) to selected 1.220 (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.234 / (download) - annotate - [select for diffs], Thu Feb 27 01:43:52 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.233: +17 -24 lines
Diff to previous 1.233 (colored) to selected 1.220 (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.233 / (download) - annotate - [select for diffs], Mon Jan 20 10:37:15 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.232: +4 -4 lines
Diff to previous 1.232 (colored) to selected 1.220 (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.232 / (download) - annotate - [select for diffs], Tue Jul 23 17:53:35 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.231: +13 -1 lines
Diff to previous 1.231 (colored) to selected 1.220 (colored)

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

Revision 1.231 / (download) - annotate - [select for diffs], Mon Jul 22 03:21:49 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +65 -2 lines
Diff to previous 1.230 (colored) to selected 1.220 (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.230 / (download) - annotate - [select for diffs], Mon Jul 1 22:56:24 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.229: +2 -2 lines
Diff to previous 1.229 (colored) to selected 1.220 (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.229 / (download) - annotate - [select for diffs], Thu Jun 27 12:20:18 2019 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.228: +17 -12 lines
Diff to previous 1.228 (colored) to selected 1.220 (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.228 / (download) - annotate - [select for diffs], Sat Jan 5 21:18:26 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.227: +4 -2 lines
Diff to previous 1.227 (colored) to selected 1.220 (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.227 / (download) - annotate - [select for diffs], Sat Jan 5 01:29:32 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.226: +65 -82 lines
Diff to previous 1.226 (colored) to selected 1.220 (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.226 / (download) - annotate - [select for diffs], Sat Jan 5 00:36:50 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.225: +6 -3 lines
Diff to previous 1.225 (colored) to selected 1.220 (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.225 / (download) - annotate - [select for diffs], Mon Dec 31 11:01:37 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.224: +7 -48 lines
Diff to previous 1.224 (colored) to selected 1.220 (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.224 / (download) - annotate - [select for diffs], Mon Dec 31 07:08:12 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.223: +7 -4 lines
Diff to previous 1.223 (colored) to selected 1.220 (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.223 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.222: +5 -6 lines
Diff to previous 1.222 (colored) to selected 1.220 (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.222 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:46 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.221: +1 -2 lines
Diff to previous 1.221 (colored) to selected 1.220 (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.221 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:10 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.220: +10 -3 lines
Diff to previous 1.220 (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.220 / (download) - annotate - [selected], Sun Aug 26 16:21:24 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.219: +3 -3 lines
Diff to previous 1.219 (colored)

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

Revision 1.219 / (download) - annotate - [select for diffs], Sat Aug 18 17:07:23 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +2 -2 lines
Diff to previous 1.218 (colored) to selected 1.220 (colored)

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

Revision 1.218 / (download) - annotate - [select for diffs], Sat Aug 18 14:26:12 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.217: +3 -3 lines
Diff to previous 1.217 (colored) to selected 1.220 (colored)

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

Revision 1.217 / (download) - annotate - [select for diffs], Sat Aug 18 14:02:56 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.216: +3 -2 lines
Diff to previous 1.216 (colored) to selected 1.220 (colored)

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

Revision 1.216 / (download) - annotate - [select for diffs], Sat Aug 18 13:05:10 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.215: +3 -2 lines
Diff to previous 1.215 (colored) to selected 1.220 (colored)

prevent line breaks in the middle of .OP

Revision 1.215 / (download) - annotate - [select for diffs], Sat Aug 18 02:08:27 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.214: +61 -1 lines
Diff to previous 1.214 (colored) to selected 1.220 (colored)

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

Revision 1.214 / (download) - annotate - [select for diffs], Fri Aug 17 20:33:37 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.213: +22 -14 lines
Diff to previous 1.213 (colored) to selected 1.220 (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.213 / (download) - annotate - [select for diffs], Thu Aug 16 23:43:37 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.212: +4 -2 lines
Diff to previous 1.212 (colored) to selected 1.220 (colored)

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

Revision 1.212 / (download) - annotate - [select for diffs], Tue Aug 14 01:27:48 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +3 -1 lines
Diff to previous 1.211 (colored) to selected 1.220 (colored)

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

Revision 1.211 / (download) - annotate - [select for diffs], Sun Jun 10 15:12:35 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.210: +13 -1 lines
Diff to previous 1.210 (colored) to selected 1.220 (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.210 / (download) - annotate - [select for diffs], Wed Apr 11 17:11:13 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.209: +8 -5 lines
Diff to previous 1.209 (colored) to selected 1.220 (colored)

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

Revision 1.209 / (download) - annotate - [select for diffs], Mon Jul 31 15:19:06 2017 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3
Changes since 1.208: +3 -3 lines
Diff to previous 1.208 (colored) to selected 1.220 (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.208 / (download) - annotate - [select for diffs], Sun Jun 25 11:42:02 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_2
Changes since 1.207: +3 -1 lines
Diff to previous 1.207 (colored) to selected 1.220 (colored)

add support for the MT and ME mailto macros, used for example in wg(8);
patch from bentley@

Revision 1.207 / (download) - annotate - [select for diffs], Sat Jun 17 13:06:16 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.206: +5 -2 lines
Diff to previous 1.206 (colored) to selected 1.220 (colored)

correct handling of blank lines after \c

Revision 1.206 / (download) - annotate - [select for diffs], Sat Jun 17 01:27:05 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.205: +5 -5 lines
Diff to previous 1.205 (colored) to selected 1.220 (colored)

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

Revision 1.205 / (download) - annotate - [select for diffs], Wed Jun 14 17:51:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.204: +6 -6 lines
Diff to previous 1.204 (colored) to selected 1.220 (colored)

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

Revision 1.204 / (download) - annotate - [select for diffs], Thu Jun 8 12:54:58 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.203: +7 -7 lines
Diff to previous 1.203 (colored) to selected 1.220 (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.203 / (download) - annotate - [select for diffs], Wed Jun 7 17:38:26 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.202: +61 -59 lines
Diff to previous 1.202 (colored) to selected 1.220 (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.202 / (download) - annotate - [select for diffs], Sun Jun 4 22:44:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.201: +7 -12 lines
Diff to previous 1.201 (colored) to selected 1.220 (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.201 / (download) - annotate - [select for diffs], Sun Jun 4 18:50:35 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.200: +1 -2 lines
Diff to previous 1.200 (colored) to selected 1.220 (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.200 / (download) - annotate - [select for diffs], Tue May 9 14:10:01 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.199: +4 -3 lines
Diff to previous 1.199 (colored) to selected 1.220 (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.199 / (download) - annotate - [select for diffs], Sun May 7 21:44:49 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.198: +12 -2 lines
Diff to previous 1.198 (colored) to selected 1.220 (colored)

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

Revision 1.198 / (download) - annotate - [select for diffs], Sun May 7 17:31:45 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.197: +4 -2 lines
Diff to previous 1.197 (colored) to selected 1.220 (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.197 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.196: +1 -52 lines
Diff to previous 1.196 (colored) to selected 1.220 (colored)

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

Revision 1.196 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.195: +1 -11 lines
Diff to previous 1.195 (colored) to selected 1.220 (colored)

move .ll to the roff modules

Revision 1.195 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.194: +1 -38 lines
Diff to previous 1.194 (colored) to selected 1.220 (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.194 / (download) - annotate - [select for diffs], Thu May 4 22:16:09 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.193: +3 -11 lines
Diff to previous 1.193 (colored) to selected 1.220 (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.193 / (download) - annotate - [select for diffs], Thu May 4 17:48:28 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +14 -3 lines
Diff to previous 1.192 (colored) to selected 1.220 (colored)

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

Revision 1.192 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +4 -3 lines
Diff to previous 1.191 (colored) to selected 1.220 (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.191 / (download) - annotate - [select for diffs], Wed Feb 15 14:10:08 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (colored) to selected 1.220 (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.190 / (download) - annotate - [select for diffs], Sat Feb 11 21:49:50 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.189: +3 -2 lines
Diff to previous 1.189 (colored) to selected 1.220 (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.189 / (download) - annotate - [select for diffs], Sat Feb 4 11:58:09 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.188: +5 -2 lines
Diff to previous 1.188 (colored) to selected 1.220 (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.188 / (download) - annotate - [select for diffs], Tue Jan 10 13:47:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +9 -9 lines
Diff to previous 1.187 (colored) to selected 1.220 (colored)

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

Revision 1.187 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:09 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.186: +2 -2 lines
Diff to previous 1.186 (colored) to selected 1.220 (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.186 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:15 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +1 -11 lines
Diff to previous 1.185 (colored) to selected 1.220 (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.185 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:19 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +33 -33 lines
Diff to previous 1.184 (colored) to selected 1.220 (colored)

modernize style: "return" is not a function

Revision 1.184 / (download) - annotate - [select for diffs], Mon Sep 21 13:25:00 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +3 -3 lines
Diff to previous 1.183 (colored) to selected 1.220 (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.183 / (download) - annotate - [select for diffs], Sun Apr 19 19:44:21 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.182: +12 -1 lines
Diff to previous 1.182 (colored) to selected 1.220 (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.182 / (download) - annotate - [select for diffs], Sun Apr 19 14:00:19 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +2 -2 lines
Diff to previous 1.181 (colored) to selected 1.220 (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.181 / (download) - annotate - [select for diffs], Sat Apr 18 17:53:21 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +6 -10 lines
Diff to previous 1.180 (colored) to selected 1.220 (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.180 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:40 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +2 -2 lines
Diff to previous 1.179 (colored) to selected 1.220 (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.179 / (download) - annotate - [select for diffs], Mon Apr 6 22:06:23 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +5 -2 lines
Diff to previous 1.178 (colored) to selected 1.220 (colored)

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

Revision 1.178 / (download) - annotate - [select for diffs], Mon Apr 6 14:59:21 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.177: +2 -2 lines
Diff to previous 1.177 (colored) to selected 1.220 (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.177 / (download) - annotate - [select for diffs], Mon Apr 6 13:35:08 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.176: +4 -2 lines
Diff to previous 1.176 (colored) to selected 1.220 (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.176 / (download) - annotate - [select for diffs], Sat Apr 4 18:52:51 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +13 -1 lines
Diff to previous 1.175 (colored) to selected 1.220 (colored)

Give man(7) section and subsection headers hanging 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.175 / (download) - annotate - [select for diffs], Sat Apr 4 17:47:18 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +6 -6 lines
Diff to previous 1.174 (colored) to selected 1.220 (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.174 / (download) - annotate - [select for diffs], Sat Apr 4 11:44:43 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +12 -1 lines
Diff to previous 1.173 (colored) to selected 1.220 (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.173 / (download) - annotate - [select for diffs], Thu Apr 2 23:48:19 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.172: +16 -18 lines
Diff to previous 1.172 (colored) to selected 1.220 (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.172 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:17 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +9 -9 lines
Diff to previous 1.171 (colored) to selected 1.220 (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.171 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:50 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +48 -47 lines
Diff to previous 1.170 (colored) to selected 1.220 (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.170 / (download) - annotate - [select for diffs], Sun Mar 15 16:53:41 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.169: +3 -2 lines
Diff to previous 1.169 (colored) to selected 1.220 (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.169 / (download) - annotate - [select for diffs], Fri Mar 6 15:48:52 2015 UTC (9 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.168: +3 -7 lines
Diff to previous 1.168 (colored) to selected 1.220 (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.168 / (download) - annotate - [select for diffs], Fri Jan 30 22:04:44 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.167: +6 -6 lines
Diff to previous 1.167 (colored) to selected 1.220 (colored)

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

Revision 1.167 / (download) - annotate - [select for diffs], Fri Jan 30 17:32:16 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored) to selected 1.220 (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.166 / (download) - annotate - [select for diffs], Sat Jan 24 02:41:49 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.165: +1 -2 lines
Diff to previous 1.165 (colored) to selected 1.220 (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.165 / (download) - annotate - [select for diffs], Wed Dec 24 18:04:10 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.164: +14 -28 lines
Diff to previous 1.164 (colored) to selected 1.220 (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.164 / (download) - annotate - [select for diffs], Wed Dec 24 09:58:35 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.163: +19 -10 lines
Diff to previous 1.163 (colored) to selected 1.220 (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.163 / (download) - annotate - [select for diffs], Tue Dec 23 13:48:57 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.162: +72 -106 lines
Diff to previous 1.162 (colored) to selected 1.220 (colored)

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

Revision 1.162 / (download) - annotate - [select for diffs], Tue Dec 23 09:31:46 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.161: +5 -15 lines
Diff to previous 1.161 (colored) to selected 1.220 (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.161 / (download) - annotate - [select for diffs], Tue Dec 23 08:15:53 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.160: +3 -4 lines
Diff to previous 1.160 (colored) to selected 1.220 (colored)

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

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

correctly handle scaling units after .PD

Revision 1.159 / (download) - annotate - [select for diffs], Thu Dec 4 02:05:42 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored) to selected 1.220 (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.158 / (download) - annotate - [select for diffs], Thu Dec 4 01:33:42 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.157: +24 -13 lines
Diff to previous 1.157 (colored) to selected 1.220 (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.157 / (download) - annotate - [select for diffs], Tue Dec 2 10:08:06 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.156: +5 -4 lines
Diff to previous 1.156 (colored) to selected 1.220 (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.156 / (download) - annotate - [select for diffs], Fri Nov 21 01:52:53 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.155: +11 -19 lines
Diff to previous 1.155 (colored) to selected 1.220 (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.155 / (download) - annotate - [select for diffs], Tue Oct 28 17:36:19 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.154: +1 -4 lines
Diff to previous 1.154 (colored) to selected 1.220 (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.154 / (download) - annotate - [select for diffs], Mon Oct 20 15:50:24 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.153: +2 -2 lines
Diff to previous 1.153 (colored) to selected 1.220 (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.153 / (download) - annotate - [select for diffs], Mon Oct 20 02:47:09 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.152: +3 -1 lines
Diff to previous 1.152 (colored) to selected 1.220 (colored)

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

Revision 1.152 / (download) - annotate - [select for diffs], Mon Oct 20 02:33:06 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.151: +3 -1 lines
Diff to previous 1.151 (colored) to selected 1.220 (colored)

correct spacing before inline equations

Revision 1.151 / (download) - annotate - [select for diffs], Wed Sep 3 05:22:45 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.150: +26 -14 lines
Diff to previous 1.150 (colored) to selected 1.220 (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.150 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.149: +1 -3 lines
Diff to previous 1.149 (colored) to selected 1.220 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Jun 20 23:02:31 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.148: +7 -4 lines
Diff to previous 1.148 (colored) to selected 1.220 (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.148 / (download) - annotate - [select for diffs], Wed Apr 23 16:08:33 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.147: +10 -14 lines
Diff to previous 1.147 (colored) to selected 1.220 (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.147 / (download) - annotate - [select for diffs], Sun Apr 20 20:18:12 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.146: +16 -11 lines
Diff to previous 1.146 (colored) to selected 1.220 (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.146 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:04 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.145: +73 -117 lines
Diff to previous 1.145 (colored) to selected 1.220 (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.145 / (download) - annotate - [select for diffs], Tue Apr 8 07:13:11 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.144: +4 -4 lines
Diff to previous 1.144 (colored) to selected 1.220 (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.144 / (download) - annotate - [select for diffs], Sun Mar 30 21:28:01 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.143: +2 -2 lines
Diff to previous 1.143 (colored) to selected 1.220 (colored)

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

Revision 1.143 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:48 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.142: +13 -1 lines
Diff to previous 1.142 (colored) to selected 1.220 (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.142 / (download) - annotate - [select for diffs], Sat Mar 8 16:22:04 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.141: +2 -2 lines
Diff to previous 1.141 (colored) to selected 1.220 (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.141 / (download) - annotate - [select for diffs], Sat Mar 8 15:50:41 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.140: +10 -5 lines
Diff to previous 1.140 (colored) to selected 1.220 (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.140 / (download) - annotate - [select for diffs], Sun Feb 16 12:33:39 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.139: +9 -6 lines
Diff to previous 1.139 (colored) to selected 1.220 (colored)

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

Revision 1.139 / (download) - annotate - [select for diffs], Sun Dec 22 23:34:13 2013 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3
Changes since 1.138: +13 -5 lines
Diff to previous 1.138 (colored) to selected 1.220 (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.138 / (download) - annotate - [select for diffs], Mon Nov 11 00:37:55 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.137: +3 -1 lines
Diff to previous 1.137 (colored) to selected 1.220 (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.137 / (download) - annotate - [select for diffs], Thu Oct 17 20:54:58 2013 UTC (10 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.136: +31 -1 lines
Diff to previous 1.136 (colored) to selected 1.220 (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.136 / (download) - annotate - [select for diffs], Sat Jan 5 22:19:12 2013 UTC (11 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_2
Changes since 1.135: +4 -4 lines
Diff to previous 1.135 (colored) to selected 1.220 (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.135 / (download) - annotate - [select for diffs], Sat Nov 17 00:26:33 2012 UTC (11 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.134: +21 -21 lines
Diff to previous 1.134 (colored) to selected 1.220 (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.134 / (download) - annotate - [select for diffs], Sun Jul 29 12:35:42 2012 UTC (11 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.133: +35 -13 lines
Diff to previous 1.133 (colored) to selected 1.220 (colored)

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

Revision 1.133 / (download) - annotate - [select for diffs], Mon Jul 16 21:59:40 2012 UTC (11 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.132: +2 -2 lines
Diff to previous 1.132 (colored) to selected 1.220 (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.
OpenBSD rev. 1.87

Revision 1.132 / (download) - annotate - [select for diffs], Sat Jul 14 10:47:07 2012 UTC (11 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.131: +15 -4 lines
Diff to previous 1.131 (colored) to selected 1.220 (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.
OpenBSD rev. man.c 1.68 and man_term.c 1.86

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jul 13 14:19:49 2012 UTC (11 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.130: +19 -4 lines
Diff to previous 1.130 (colored) to selected 1.220 (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).
OpenBSD rev. 1.85 and 1.34, respectively.

Revision 1.130 / (download) - annotate - [select for diffs], Tue Jul 10 19:54:11 2012 UTC (11 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.129: +35 -32 lines
Diff to previous 1.129 (colored) to selected 1.220 (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

OpenBSD rev. 1.84 and 1.29, respectively

Revision 1.129 / (download) - annotate - [select for diffs], Sat Jun 2 20:16:23 2012 UTC (11 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.128: +4 -2 lines
Diff to previous 1.128 (colored) to selected 1.220 (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.128 / (download) - annotate - [select for diffs], Sun May 27 17:39:28 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.127: +2 -2 lines
Diff to previous 1.127 (colored) to selected 1.220 (colored)

update Copyright years according to the CVS logs; no code change

Revision 1.127 / (download) - annotate - [select for diffs], Tue Jan 3 15:16:24 2012 UTC (12 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.126: +28 -3 lines
Diff to previous 1.126 (colored) to selected 1.220 (colored)

Add support for `OP', one of the extended man macros.  This also requires
some man(7) changes to accomodate for the an-ext compatibility.

Revision 1.126 / (download) - annotate - [select for diffs], Sun Dec 4 23:10:52 2011 UTC (12 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.125: +38 -19 lines
Diff to previous 1.125 (colored) to selected 1.220 (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.
In the long run, we hope to unify the ouput of both languages and
to pull this out again, but that requires coordination with groff.

Grudgingly ok and, (as usual,-) more comments requested by  kristaps@

Revision 1.125 / (download) - annotate - [select for diffs], Sun Dec 4 00:44:12 2011 UTC (12 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.124: +10 -7 lines
Diff to previous 1.124 (colored) to selected 1.220 (colored)

Jumping out of man_unscope() for the root node is a bad idea
because that will skip root node validation, potentially entering
rendering modules will NULL pointers lurking in the meta data.
Instead, always validate the root node and (as suggested by joerg@)
assert validity of the meta data before using it in the renderers.
ok joerg@

Revision 1.124 / (download) - annotate - [select for diffs], Fri Nov 18 17:04:06 2011 UTC (12 years, 4 months ago) by joerg
Branch: MAIN
Changes since 1.123: +7 -5 lines
Diff to previous 1.123 (colored) to selected 1.220 (colored)

Don't crash if the date can't be extracted. Don't depend on snprintf
handling NULL strings.

Revision 1.123 / (download) - annotate - [select for diffs], Sun Nov 13 15:33:41 2011 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +17 -10 lines
Diff to previous 1.122 (colored) to selected 1.220 (colored)

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

Revision 1.122 / (download) - annotate - [select for diffs], Sun Nov 13 13:15:14 2011 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.121: +14 -13 lines
Diff to previous 1.121 (colored) to selected 1.220 (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.121 / (download) - annotate - [select for diffs], Wed Sep 21 09:57:13 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_0
Changes since 1.120: +3 -5 lines
Diff to previous 1.120 (colored) to selected 1.220 (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.120 / (download) - annotate - [select for diffs], Tue Sep 20 14:20:48 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored) to selected 1.220 (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.119 / (download) - annotate - [select for diffs], Tue Sep 20 13:13:23 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +3 -2 lines
Diff to previous 1.118 (colored) to selected 1.220 (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.118 / (download) - annotate - [select for diffs], Tue Sep 20 09:02:23 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +5 -5 lines
Diff to previous 1.117 (colored) to selected 1.220 (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.117 / (download) - annotate - [select for diffs], Mon Sep 19 22:36:16 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.116: +23 -13 lines
Diff to previous 1.116 (colored) to selected 1.220 (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.

ok kristaps@

Revision 1.116 / (download) - annotate - [select for diffs], Sun Sep 18 21:08:34 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +29 -35 lines
Diff to previous 1.115 (colored) to selected 1.220 (colored)

Support nesting of indented blocks.

This patch was originally written in July 2011 by kristaps@,
i promptly committed it to OpenBSD, and then it was forgotten.
Now i rediscovered it when merging 1.11.7 to OpenBSD.

ok kristaps@  (on his own patch :)

Revision 1.115 / (download) - annotate - [select for diffs], Fri Jul 22 10:50:46 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6, VERSION_1_11_5
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored) to selected 1.220 (colored)

Add character output (-Tpdf, -Tps, -Tascii) for equations.  This is the
minimum: unseparated terms.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Jul 21 11:34:53 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored) to selected 1.220 (colored)

Flip eqn into using parsed nodes.  I've temporarily disabled printing
these in the front-ends except for -Ttree, which will display the parsed
tree.

While here, fix that quoted strings aren't scanned for replacement parts.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Jul 3 22:57:32 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_4
Changes since 1.112: +3 -1 lines
Diff to previous 1.112 (colored) to selected 1.220 (colored)

Fix a TODO noted by schwarze@, originally by Christian Weisgerber:
literal mode (`nf') is ended by SH (and, it turns out, SS as well).
Noted the updated behaviour in man.7 as well.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Jun 29 15:38:09 2011 UTC (12 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.111: +9 -2 lines
Diff to previous 1.111 (colored) to selected 1.220 (colored)

First fix how `sp 1' doesn't imply `1v' (it now does) and that 1
followed by non-digits, e.g. `1g', really means `1'.  Next, fix some
spacing issues where `sp' was invoked in -man after sections or
subsections.  Make sure this behaviour is mirrored in -Thtml.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Jun 18 17:58:48 2011 UTC (12 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.110: +17 -13 lines
Diff to previous 1.110 (colored) to selected 1.220 (colored)

Fix two TODOs with one check-in.  Both of these relate to vertical space
before paragraphs and/or within `RS' blocks.

Revision 1.110 / (download) - annotate - [select for diffs], Sat Jun 18 17:36:52 2011 UTC (12 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.109: +21 -18 lines
Diff to previous 1.109 (colored) to selected 1.220 (colored)

Allow RS/RE blocks to nest.  This requires first the syntax tree to
accomodate for the fix, then for the front-ends.  -T[x]html accepted the
syntax tree natively, but -Tascii had to use relative offsets.  It's
quite a simple fix.

From a TODO by {dcoppa,dsoares}@openbsd.

Revision 1.109 / (download) - annotate - [select for diffs], Tue May 17 14:38:34 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_3
Changes since 1.108: +2 -9 lines
Diff to previous 1.108 (colored) to selected 1.220 (colored)

Add mode for -Tlocale.  This mode, with this commit, behaves exactly
like -Tascii.  While adding this, inline term_alloc() (was a one-liner),
remove some switches around the terminal encoding for the symbol table
(unnecessary), and split out ascii_alloc() into ascii_init(), which is
also called from locale_init().

Revision 1.108 / (download) - annotate - [select for diffs], Sat Apr 30 22:14:42 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_2
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored) to selected 1.220 (colored)

Rename mchars_init() -> mchars_alloc() for consistency.

Revision 1.107 / (download) - annotate - [select for diffs], Sat Apr 30 22:14:02 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.106: +2 -2 lines
Diff to previous 1.106 (colored) to selected 1.220 (colored)

Remove enum mcharst, which hasn't been used in quite some time.

Revision 1.106 / (download) - annotate - [select for diffs], Fri Apr 29 22:18:12 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored) to selected 1.220 (colored)

Move "chars" interface out of out.h and into mandoc.h.  This doesn't
change any code but for renaming functions and types to be consistent
with other mandoc.h stuff.  The reason for moving into libmandoc is that
the rendering of special characters is part of mandoc itself---not an
external part.  From mandoc(1)'s perspective, this changes nothing, but
for other utilities, it's important to have these part of libmandoc.
Note this isn't documented [yet] in mandoc.3 because there are some
parts I'd like to change around beforehand.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Mar 22 10:13:01 2011 UTC (13 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_1
Changes since 1.104: +1 -2 lines
Diff to previous 1.104 (colored) to selected 1.220 (colored)

Step 4: merge chars.h into out.h.  The functions in this file are
necessary to all [real] front-ends, so stop pretending it's special.
While here, add some documentation to the variable types.

Revision 1.104 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:51 2011 UTC (13 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.103: +3 -9 lines
Diff to previous 1.103 (colored) to selected 1.220 (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.103 / (download) - annotate - [select for diffs], Wed Feb 9 09:52:47 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.102: +2 -1 lines
Diff to previous 1.102 (colored) to selected 1.220 (colored)

EQN blocks are now printed in all modes.  This is simply a printing of
the concatenated string (in -T[x]html, it gets a SPAN, too).

Revision 1.102 / (download) - annotate - [select for diffs], Sun Feb 6 21:44:36 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.101: +3 -1 lines
Diff to previous 1.101 (colored) to selected 1.220 (colored)

Add initial libmdoc and libman top-most machinery for accepting TBL
directives.  For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jan 25 12:35:09 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.100: +4 -1 lines
Diff to previous 1.100 (colored) to selected 1.220 (colored)

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

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 23 14:54:21 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.99: +4 -1 lines
Diff to previous 1.99 (colored) to selected 1.220 (colored)

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

Revision 1.99 / (download) - annotate - [select for diffs], Mon Jan 17 00:21:29 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored) to selected 1.220 (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@, ok kristaps@.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jan 16 20:12:45 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored) to selected 1.220 (colored)

When processing a blank text line, do not break out of text processing
into macro processing code.  Fixing a regression introduced in 1.95,
found because it caused segfaults in my regression suite.
OK kristaps@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jan 12 15:23:25 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.96: +34 -28 lines
Diff to previous 1.96 (colored) to selected 1.220 (colored)

Make -man -Tascii not break within literal lines, e.g.,

 .nf
 .B hello world
 .fi

Also, clean up the print_man_node() function a little bit.  This problem
has long since been in the TODO and was recently noted again by Brad
Smith.  The -T[x]html fix will follow...

Revision 1.96 / (download) - annotate - [select for diffs], Wed Jan 12 10:43:22 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.95: +7 -3 lines
Diff to previous 1.95 (colored) to selected 1.220 (colored)

If the first character of free-form text is whitespace, then a newline
shall precede outputted text (surprise!).

Revision 1.95 / (download) - annotate - [select for diffs], Tue Jan 11 00:39:00 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.94: +6 -1 lines
Diff to previous 1.94 (colored) to selected 1.220 (colored)

Don't let `in' creep past the right margin.

From an assertion noted by Brad (at comstyle).

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jan 4 01:23:18 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.93: +25 -16 lines
Diff to previous 1.93 (colored) to selected 1.220 (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.93 / (download) - annotate - [select for diffs], Mon Jan 3 15:30:25 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.92: +3 -1 lines
Diff to previous 1.92 (colored) to selected 1.220 (colored)

For tbl: -man documents print an extra space before `TS' blocks.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Jan 2 12:21:07 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.91: +2 -1 lines
Diff to previous 1.91 (colored) to selected 1.220 (colored)

Turn on -Tascii tbl printing.  The output still has some issues---I'm
not sure whether it's in the header calculation or term.c squashing
spaces or whatever, but let's get this in for general testing as soon as
possible.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Jan 1 12:59:17 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.90: +10 -2 lines
Diff to previous 1.90 (colored) to selected 1.220 (colored)

Add -man support for tables.  Like -mdoc, this consists of an
external-facing function man_addspan() (this required shuffling around
the descope routine) and hooks elsewhere.

Also fixed mdoc.c's post-validation of tables.

Revision 1.90 / (download) - annotate - [select for diffs], Wed Dec 8 10:58:22 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8
Changes since 1.89: +1 -3 lines
Diff to previous 1.89 (colored) to selected 1.220 (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.  Discussed on tech@ with schwarze@.

While at it, remove references to `b' in man.7.  As far as I know, this
was never supported anyway.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Dec 6 15:31:19 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_7
Changes since 1.88: +44 -1 lines
Diff to previous 1.88 (colored) to selected 1.220 (colored)

Add support for `ft' macro found in groff(7).  Based on a patch by
schwarze@, but without the -T[x]html handling, which structurally does
not work.  Also add man.7 documentation (not in original patch).

Revision 1.88 / (download) - annotate - [select for diffs], Mon Dec 6 14:04:11 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.87: +50 -80 lines
Diff to previous 1.87 (colored) to selected 1.220 (colored)

My favourite: removing lots of code in favour of smaller, tighter code.
Merge patch by schwarze@ consolidating RB, BR, etc. into one function.
man_html.c already does this.

Revision 1.87 / (download) - annotate - [select for diffs], Mon Dec 6 13:53:07 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored) to selected 1.220 (colored)

Header for `PP', `P', and `LP' should never be printed.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Dec 5 16:14:16 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.85: +2 -7 lines
Diff to previous 1.85 (colored) to selected 1.220 (colored)

Remove `Sp', `Vb', and `Ve' (as per schwarze@'s changes in OpenBSD),
which are now accomodated for the new libroff modifications.

Revision 1.85 / (download) - annotate - [select for diffs], Wed Sep 15 14:36:16 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.84: +5 -1 lines
Diff to previous 1.84 (colored) to selected 1.220 (colored)

Allow string lengths to account for escapes.  Now all calls to calculate
column width in -Tascii, -Tpdf, and -Tps will account for "more real"
string lengths.

Example:

.Bl -tag -width \s[+123424]foo
.It bar
baz
.El

The size escape will be correctly tossed.

.Bl -tag -width \(aqbar
.It \(aqbar
baz
.El

The \(aq will be correctly handled.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Jul 23 13:22:35 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF, VERSION_1_10_5
Changes since 1.83: +18 -19 lines
Diff to previous 1.83 (colored) to selected 1.220 (colored)

Collapse `nf', `fi', `Vb', and `Ve' into one function as in man_html.c.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Jul 22 23:03:15 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.82: +44 -1 lines
Diff to previous 1.82 (colored) to selected 1.220 (colored)

Added `in' macro support for -man -Tascii.  This is not yet supported in
-Thtml (I'm surprised to note that neither is LITERAL mode).

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jul 22 13:47:50 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.81: +11 -16 lines
Diff to previous 1.81 (colored) to selected 1.220 (colored)

Bring `sp', `Sp', and `br' behaviour for -man in line with how -mdoc's
is handled: correctly.  This removes superfluous line breaks in many
-man manuals.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Jul 22 13:36:25 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.80: +3 -1 lines
Diff to previous 1.80 (colored) to selected 1.220 (colored)

Have `nf' and `fi' flush lines.  This is necessary or the LITERAL will
be meaningless when invoked within a non-flushing context.  This based
on a formatting bug report submitted by Jonathon Gray (jsg@) via
Christian Weisgerber (naddy@).

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jul 13 23:53:20 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored) to selected 1.220 (colored)

correct lots of copyright notices;
ok kristaps@

Revision 1.79 / (download) - annotate - [select for diffs], Wed Jul 7 15:04:54 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_4
Changes since 1.78: +1 -2 lines
Diff to previous 1.78 (colored) to selected 1.220 (colored)

Re-constitution of `ds' symbol processing.  First, push the
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff.  Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros).  Remove term.c's invocation of the
roff_getstrn() function.  Removed function documentation in roff.3 and
added roff.7 `ds' documentation.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Jun 26 15:36:37 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_3
Changes since 1.77: +2 -1 lines
Diff to previous 1.77 (colored) to selected 1.220 (colored)

Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept a
const struct regset pointer.  No functionality.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jun 25 18:53:14 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.76: +39 -41 lines
Diff to previous 1.76 (colored) to selected 1.220 (colored)

Initial chunks for variable-width fonts.  Pushes all width calculations
in mdoc_term.c and man_term.c down into term.c.  This is still not
implemented in term.c, although stubs for width calculations are in
place.  From now on, offset, rmargin, and other layout variables are
abstract screen widths.  They will resolve to the the familiar values
for -Tascii but -Tps will eventually use points instead of chars.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:28 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored) to selected 1.220 (colored)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Jun 10 23:24:37 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored) to selected 1.220 (colored)

Fix a regression that crept in in man_term.c 1.73 and mdoc_term.c 1.144.
When the title line uses special characters, mandoc will segfault.
Thus, first set up the character tables, then print the header,
as we always did.

Found in OpenBSD /usr/src/usr.sbin/bind/bin/check/named-checkconf.8.

While here, set p->tabwidth in terminal_man() for symmetry
with terminal_mdoc(), as suggested by millert@ (and already
committed to OpenBSD earlier).   Since 5 is the default, this
is not strictly required, but it is certainly clearer and more
robust.

"looks fine" kristaps@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jun 9 08:07:13 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored) to selected 1.220 (colored)

Have the standard manpage header and footer print on every page of -Tps
output.  This is more tricky than you may think:  we can't just call the
header function out-of-state (i.e., before a flushln has occured)
because we'd clobber our current state.  Thus, we call at the beginning
and dump the output into an auxiliary buffer.

For the record, I don't think there's any other clean way to do this.
The only other Way That Works is to copy-aside *all* termp state, zero
it, and do the necessary headf/footf.  This is just as complex, as
memory needs to be alloc'd and free'd per margin.

Unfortunately, this prohibits page numbering (the margin is only printed
once), so I'll probably end up re-writing this down the line.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Jun 7 20:57:09 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_1
Changes since 1.72: +15 -9 lines
Diff to previous 1.72 (colored) to selected 1.220 (colored)

First check-in of PostScript output.  This does not change any logic
within term.c, but does add a small shim over putchar() that switches on
the output engine.  Prints, for this initial version, only monospace and
without font decorations.  It's a start.

Revision 1.72 / (download) - annotate - [select for diffs], Wed May 26 14:03:54 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.71: +5 -2 lines
Diff to previous 1.71 (colored) to selected 1.220 (colored)

Allow bad -man dates to flow verbatim into the front-ends.  Noted by
Ulrich Spoerlein.

Revision 1.71 / (download) - annotate - [select for diffs], Mon May 17 22:11:42 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.70: +2 -1 lines
Diff to previous 1.70 (colored) to selected 1.220 (colored)

Enable the unified error/warning enumeration in mandoc.h that's
stringified in main.c.

Allow `An' to handle an argument and child (with a warning).

Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a
warning).

Allow inconsistent column syntax to only raise a warning.

Revision 1.70 / (download) - annotate - [select for diffs], Mon May 17 10:50:32 2010 UTC (13 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.69: +2 -1 lines
Diff to previous 1.69 (colored) to selected 1.220 (colored)

Add support for .AT. Properly implement .UC. Add regress tests.

Revision 1.69 / (download) - annotate - [select for diffs], Mon May 17 10:26:49 2010 UTC (13 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.68: +3 -1 lines
Diff to previous 1.68 (colored) to selected 1.220 (colored)

groff uses three vspaces before the footer too.

Revision 1.68 / (download) - annotate - [select for diffs], Sat May 15 22:44:04 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.67: +1 -6 lines
Diff to previous 1.67 (colored) to selected 1.220 (colored)

Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the roff preprocessor.

Revision 1.67 / (download) - annotate - [select for diffs], Sat May 15 20:51:40 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.66: +1 -2 lines
Diff to previous 1.66 (colored) to selected 1.220 (colored)

Pull `ig' out of -man and leave it the roff preparser.

Revision 1.66 / (download) - annotate - [select for diffs], Sat May 15 17:25:21 2010 UTC (13 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.65: +1 -3 lines
Diff to previous 1.65 (colored) to selected 1.220 (colored)

For .IP groff requires a single space only after the head, adopt.

Revision 1.65 / (download) - annotate - [select for diffs], Sat May 15 16:18:23 2010 UTC (13 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.64: +7 -3 lines
Diff to previous 1.64 (colored) to selected 1.220 (colored)

Make the output width an option for ascii_alloc and use that to compute
the default margin. Hard-code 80 chars/line for now.

Revision 1.64 / (download) - annotate - [select for diffs], Sat May 15 15:54:39 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored) to selected 1.220 (colored)

Removed restriction on integer manual sections in -man.

Revision 1.63 / (download) - annotate - [select for diffs], Wed May 12 16:46:28 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_25
Changes since 1.62: +4 -1 lines
Diff to previous 1.62 (colored) to selected 1.220 (colored)

End-of-sentence spacing for -man -Tascii.

Revision 1.62 / (download) - annotate - [select for diffs], Mon May 10 08:31:41 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.61: +12 -12 lines
Diff to previous 1.61 (colored) to selected 1.220 (colored)

Back out OpenBSD special case (ok Ingo Schwarze).

Revision 1.61 / (download) - annotate - [select for diffs], Mon May 10 08:27:09 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.60: +20 -2 lines
Diff to previous 1.60 (colored) to selected 1.220 (colored)

Proper leading spaces for new- and old-groff in -man -Tascii mode.

Revision 1.60 / (download) - annotate - [select for diffs], Mon May 10 08:05:17 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.59: +3 -5 lines
Diff to previous 1.59 (colored) to selected 1.220 (colored)

-man also now has unbound margins for literal context.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Mar 24 20:10:53 2010 UTC (14 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_24, VERSION_1_9_23, VERSION_1_9_22, VERSION_1_9_21, VERSION_1_9_20, VERSION_1_9_19, VERSION_1_9_18, VERSION_1_9_17
Changes since 1.58: +9 -1 lines
Diff to previous 1.58 (colored) to selected 1.220 (colored)

Using man_node_delete() instead of man_node_free()/man_node_freelist() and friends (much simpler).
Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original.
Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).

Revision 1.58 / (download) - annotate - [select for diffs], Tue Mar 23 12:42:22 2010 UTC (14 years ago) by kristaps
Branch: MAIN
Changes since 1.57: +5 -2 lines
Diff to previous 1.57 (colored) to selected 1.220 (colored)

Fixed two very subtle bugs in retaining overstep and maxrmargin widths between parse sequences.

Revision 1.57 / (download) - annotate - [select for diffs], Tue Mar 23 11:30:48 2010 UTC (14 years ago) by kristaps
Branch: MAIN
Changes since 1.56: +24 -10 lines
Diff to previous 1.56 (colored) to selected 1.220 (colored)

Support for pod2man standard header macros (Vb, Ve, Sp).  Based largely on a set of patches by Ingo Schwarze.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Mar 22 05:59:32 2010 UTC (14 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_16
Changes since 1.55: +44 -37 lines
Diff to previous 1.55 (colored) to selected 1.220 (colored)

Accomodate (libman) for next-line macros followed by non-text macros `na', `sp', and `br'.
Based on a patch by Ingo Schwarze.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jan 1 17:14:28 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre2, VERSION_1_9_15
Changes since 1.54: +5 -6 lines
Diff to previous 1.54 (colored) to selected 1.220 (colored)

Big check-in of compatibility layer.  This should work on most major architectures. Thanks to Joerg Sonnenberger.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Nov 12 08:21:05 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre1, VERSION_1_9_14
Changes since 1.53: +3 -12 lines
Diff to previous 1.53 (colored) to selected 1.220 (colored)

Fixed \c support for all input and output modes (documented in mandoc_char.7).

Revision 1.53 / (download) - annotate - [select for diffs], Thu Nov 12 08:00:21 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.52: +2 -14 lines
Diff to previous 1.52 (colored) to selected 1.220 (colored)

Deprecated ".i <notext>" support (nobody uses it -- it can be re-added, but adds a bit of complexity that I'd rather avoid).

Revision 1.52 / (download) - annotate - [select for diffs], Thu Nov 12 05:50:12 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.51: +36 -80 lines
Diff to previous 1.51 (colored) to selected 1.220 (colored)

Basically re-wrote -Tascii font handling: instead of incrementers for
bold and underline, we use a stack (no cascading, no double-font-mode).
Font modes with \f only affect the current stack point, as documented in
mdoc.7 and man.7.  While -mdoc stacks fonts with embedded macros, -man
replaces them (the stack is always size 1).  This works for all
invocations in supported systems' manual corpora to date.  It doesn't
support groff's insanity with line-scoped \f as documented in mdoc.7.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Nov 10 12:03:30 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.50: +6 -2 lines
Diff to previous 1.50 (colored) to selected 1.220 (colored)

Noted that -man text decoration is re-set when exiting a macro invocation.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Nov 10 11:45:57 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored) to selected 1.220 (colored)

Disable metafonts when printing document footer.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Nov 5 08:39:36 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.48: +10 -25 lines
Diff to previous 1.48 (colored) to selected 1.220 (colored)

Consolidated `RI' and `IR' handlers (-man -Tascii).

Revision 1.48 / (download) - annotate - [select for diffs], Thu Nov 5 08:37:12 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored) to selected 1.220 (colored)

Fixed `RI' (was reversed).

Revision 1.47 / (download) - annotate - [select for diffs], Fri Oct 30 18:53:08 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_13, VERSION_1_9_12
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored) to selected 1.220 (colored)

More lint fixes.
Removed err.h from inclusions (less main.c--still in progress).

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 27 08:49:44 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.45: +7 -18 lines
Diff to previous 1.45 (colored) to selected 1.220 (colored)

Removed dynamic allocations of header/footer data.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Oct 26 04:09:45 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_11, VERSION_1_9_10
Changes since 1.44: +30 -30 lines
Diff to previous 1.44 (colored) to selected 1.220 (colored)

Full `%U' support.
`Lk' display fixed.
Renamed arg2xxxx as a2xxxx for consistency.
Renamed print_foot to print_man_foot for consistency.
Removed default printing of `~' when `Lk' not provided (not sure where I got that from).

Revision 1.44 / (download) - annotate - [select for diffs], Sat Oct 24 05:45:05 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.43: +4 -1 lines
Diff to previous 1.43 (colored) to selected 1.220 (colored)

Added `PD' to -man (doesn't do anything, yet).

Revision 1.43 / (download) - annotate - [select for diffs], Thu Oct 22 18:55:32 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.42: +3 -7 lines
Diff to previous 1.42 (colored) to selected 1.220 (colored)

Fixed maddening mismatch between groff and strftime mismatch of day ("%e").  Noted by Ulrich Sporlein.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Oct 21 03:31:49 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored) to selected 1.220 (colored)

Fixed strftime stray %d -> %e (pointed out by Ulrich Sporlein).

Revision 1.41 / (download) - annotate - [select for diffs], Sun Oct 18 19:17:14 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_9
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored) to selected 1.220 (colored)

Lint fixes.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Oct 18 19:03:37 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.39: +11 -7 lines
Diff to previous 1.39 (colored) to selected 1.220 (colored)

Made sure devices and formats recognise that -man and -mdoc have different syntax for scaling widths: -mdoc assumes no unit means that the value is a string literal while -man instead uses the default vertical/horizontal scale.

Revision 1.39 / (download) - annotate - [select for diffs], Sun Oct 18 13:34:16 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.38: +51 -117 lines
Diff to previous 1.38 (colored) to selected 1.220 (colored)

Arbitrary horizontal and vertical scaling widths now handled by -mdoc -Tascii.
Terminal scaling backend pushed into term.c.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Oct 18 11:52:18 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.37: +45 -2 lines
Diff to previous 1.37 (colored) to selected 1.220 (colored)

Fitted -man -Tascii with scaling units (.5i, etc.).

Revision 1.37 / (download) - annotate - [select for diffs], Sun Oct 18 11:14:04 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.36: +46 -27 lines
Diff to previous 1.36 (colored) to selected 1.220 (colored)

Added horizontal scaling units to -Tman -Tascii.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Oct 13 10:57:25 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.35: +28 -8 lines
Diff to previous 1.35 (colored) to selected 1.220 (colored)

Moved output definitions into main.h.
Pushed terminal_{mdoc,man} into {mdoc,man}_term.c.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Oct 8 23:00:15 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_8, VERSION_1_9_7
Changes since 1.34: +29 -58 lines
Diff to previous 1.34 (colored) to selected 1.220 (colored)

Consolidated some -man -Tascii functions.
Added many -man -Thtml functions (almost complete).

Revision 1.34 / (download) - annotate - [select for diffs], Wed Oct 7 12:19:39 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.33: +3 -8 lines
Diff to previous 1.33 (colored) to selected 1.220 (colored)

Header buffers in -man -Tascii are static.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 4 15:24:54 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.32: +1 -2 lines
Diff to previous 1.32 (colored) to selected 1.220 (colored)

Structural components of -man -Thtml in place (note that HP is the same as IP, as HTML doesn't "do" this construction without fixed page widths).

Revision 1.32 / (download) - annotate - [select for diffs], Sat Oct 3 19:57:53 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.31: +3 -2 lines
Diff to previous 1.31 (colored) to selected 1.220 (colored)

Added initial -man framework for -Thtml.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Sep 16 09:41:24 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_6, VERSION_1_9_5
Changes since 1.30: +13 -20 lines
Diff to previous 1.30 (colored) to selected 1.220 (colored)

Made tree/term/out() functions return void.
Put err() functions back into front-ends (no use making it needlessly complex).

Revision 1.30 / (download) - annotate - [select for diffs], Tue Sep 15 08:16:20 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.29: +49 -35 lines
Diff to previous 1.29 (colored) to selected 1.220 (colored)

Removed TERMP_BOLD, TERMP_UNDER, TERMP_STYLE in favour of recursive-friendly increments.
Cleaned up confusing behaviour of p->flags.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Aug 22 09:10:38 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_2
Changes since 1.28: +13 -2 lines
Diff to previous 1.28 (colored) to selected 1.220 (colored)

Added `UC' libman macro (has no effect).
Corrected `UC' and `DT' not to print their arguments.
Noted that `UC' and `DT' shouldn't be used.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Aug 21 08:41:05 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_1
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored) to selected 1.220 (colored)

FreeBSD fix (uqs@spoerlein.net).

Revision 1.27 / (download) - annotate - [select for diffs], Thu Aug 20 11:51:07 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored) to selected 1.220 (colored)

Added `DT' macro (pointed out by joerg@netbsd.org).

Revision 1.26 / (download) - annotate - [select for diffs], Wed Aug 19 11:30:40 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.25: +89 -20 lines
Diff to previous 1.25 (colored) to selected 1.220 (colored)

`RS' blocks correctly formatting in output device.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Aug 19 09:14:50 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.24: +3 -1 lines
Diff to previous 1.24 (colored) to selected 1.220 (colored)

Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).

Revision 1.24 / (download) - annotate - [select for diffs], Tue Aug 18 08:48:30 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_0
Changes since 1.23: +82 -35 lines
Diff to previous 1.23 (colored) to selected 1.220 (colored)

Small updates to man.7 (next-line break-exclusions, numerical width example).
Fully tested and correct scope-rewinding of block macros.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 17 11:03:07 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.22: +51 -15 lines
Diff to previous 1.22 (colored) to selected 1.220 (colored)

`IP' and `TP' correctly handle width arguments.
Documented numeric widths.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Aug 13 12:54:52 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.21: +69 -43 lines
Diff to previous 1.21 (colored) to selected 1.220 (colored)

Finished correct `IP' handling.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Aug 13 12:31:50 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +41 -26 lines
Diff to previous 1.20 (colored) to selected 1.220 (colored)

Added proper `TP' support.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Aug 13 12:15:58 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +36 -3 lines
Diff to previous 1.19 (colored) to selected 1.220 (colored)

Added full `HP' libman macro support.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Aug 13 11:45:29 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.18: +189 -46 lines
Diff to previous 1.18 (colored) to selected 1.220 (colored)

Significant overhaul in libman.  Macros are now block- and line-scoped (with
next-line scope extensions possible).  man.7 reflects block and line scoping,
and also includes a REFERENCE section that will be used as a template for the
big mdoc reference.  Many fixes in next-line behaviour for both inline and
block macros.  Added some macros for compatibility (from me.7).  Corrected
quoted-literal handling for libman.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Aug 10 10:09:51 2009 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.17: +90 -20 lines
Diff to previous 1.17 (colored) to selected 1.220 (colored)

Moved indentation size into *term.c files.
Improved handling of libman `IP' macro (still needs work).

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 24 20:22:24 2009 UTC (14 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_5, VERSION_1_8_4
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored) to selected 1.220 (colored)

Added `sp' support to libman.
Added `\c' to known escapes (only used in man, but still).

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jun 18 20:46:19 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_3, VERSION_1_8_2, VERSION_1_8_1, VERSION_1_8_0, VERSION_1_7_24, VERSION_1_7_23, VERSION_1_7_22, VERSION_1_7_21, VERSION_1_7_20
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored) to selected 1.220 (colored)

Added nchild decrement in libman (not used, but better in than forgotten).
Added nchild to libmdoc, deprecated count() functions in validator.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jun 18 19:54:04 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +13 -2 lines
Diff to previous 1.14 (colored) to selected 1.220 (colored)

Fixed libman .br to be a newline, not a .PP alias.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jun 16 19:55:28 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_19
Changes since 1.13: +6 -4 lines
Diff to previous 1.13 (colored) to selected 1.220 (colored)

Removed MAN___: moved MAN_br to its index (comments not passed into parser).
Fix: hashtable not fully formed after removal of MDOC___.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jun 15 20:26:47 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +1 -5 lines
Diff to previous 1.12 (colored) to selected 1.220 (colored)

Removed superfluous ifdef around strftime (schwarze@openbsd.org).
Bumped version (this was supposed to be in 1.7.17).

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 11 13:18:42 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_17, VERSION_1_7_16, VERSION_1_7_15, VERSION_1_7_14
Changes since 1.11: +6 -1 lines
Diff to previous 1.11 (colored) to selected 1.220 (colored)

Backed-out .IP changes for libman (needs work).

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jun 11 12:07:49 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (colored) to selected 1.220 (colored)

Documented some un-clear parts of main.c.
Fixed footer to be new-groff style (OS DATE OS).
Removed sanity check from mdoc_term (unnecessary).

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jun 11 07:26:35 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored) to selected 1.220 (colored)

Fixed email address in manual AUTHOR reference.
Set max right margin to 80 columns (schwarze@openbsd.org).
Fixed centre-field heading position (schwarze@openbsd.org).
Also fixed -Tman centre-field.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 10 20:18:43 2009 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) to selected 1.220 (colored)

Fixed license email address.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Apr 12 19:45:26 2009 UTC (14 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_13
Changes since 1.7: +10 -12 lines
Diff to previous 1.7 (colored) to selected 1.220 (colored)

Using proper license template (const).

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 5 16:34:22 2009 UTC (14 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_12, VERSION_1_7_10, OPENBSD_CHECKIN
Changes since 1.6: +8 -7 lines
Diff to previous 1.6 (colored) to selected 1.220 (colored)

man(3) doesn't use err.h anymore.
Added .i to man(3).
Fixed up manuals.
Fixed up webpage.
Assertion fixes in man(3) (hashtable).
Fixed assertion for .IP in mandoc -man.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 2 06:51:44 2009 UTC (14 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored) to selected 1.220 (colored)

mdoc_tokhash -> hash
Initial man hashtab (BROKEN).

Revision 1.5 / (download) - annotate - [select for diffs], Fri Mar 27 14:56:15 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored) to selected 1.220 (colored)

Added some new manuals (mdoc.3 mandoc_char.7).
Support for .br in libman.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 26 16:23:22 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.3: +58 -27 lines
Diff to previous 1.3 (colored) to selected 1.220 (colored)

All macro-invocations, for consistency, begin with `.' in documentation.
Fixed \\ -> \e in manual documentation.
All preliminary -man macros in place.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Mar 26 15:19:44 2009 UTC (15 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_5
Changes since 1.2: +128 -8 lines
Diff to previous 1.2 (colored) to selected 1.220 (colored)

Added several macros to man_term.c.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Mar 26 14:44:41 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.1: +6 -1 lines
Diff to previous 1.1 (colored) to selected 1.220 (colored)

Fixed after-NLINE-error assertion.
Scanned over all manuals with valgrind.
Version up.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Mar 26 14:38:11 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Diff to selected 1.220 (colored)

Initial front-end formatting for -man pages.

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.




CVSweb