OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.282 / (download) - annotate - [select for diffs], Mon Nov 13 19:13:00 2023 UTC (6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.281: +1 -6 lines
Diff to previous 1.281 (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.281 / (download) - annotate - [select for diffs], Sun Sep 11 09:12:47 2022 UTC (20 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.280: +9 -8 lines
Diff to previous 1.280 (colored)

Finally expand and delete the macro SCALE_VS_INIT().
It's nothing but obfuscation and only used at three places in a single file.
Removing it also makes the code three lines shorter.
The ugliness was already pointed out six years ago by mmcc@.

Revision 1.280 / (download) - annotate - [select for diffs], Tue Aug 16 17:44:53 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.279: +6 -3 lines
Diff to previous 1.279 (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.279 / (download) - annotate - [select for diffs], Mon Apr 6 09:55:49 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.278: +16 -7 lines
Diff to previous 1.278 (colored)

Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.
In HTML output, improve the logic for writing inside permalinks:
skip them when there is no child content or when there is a risk
that the children might contain flow content.

Revision 1.278 / (download) - annotate - [select for diffs], Fri Mar 13 00:31:05 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.277: +82 -202 lines
Diff to previous 1.277 (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.277 / (download) - annotate - [select for diffs], Thu Feb 27 21:38:27 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.276: +6 -10 lines
Diff to previous 1.276 (colored)

Fully support explicit tagging of .Sh and .Ss.
This fixes the offset of two lines in terminal output
and this improves HTML output by putting the id= attribute
and <a> element into the respective <h1> or <h2> element rather
than writing an additional <mark> element.

To that end, introduce node flags NODE_ID (to make the node a link
target, for example by writing an HTML id= attribute or by calling
tag_put()) and NODE_HREF (to make the node a link source, used only
in HTML output, used only to write an <a class="permalink"> element).

In particular:
* In the validator, generalize the concept of the "next node"
such that it also works before .Sh and .Ss.
* If the first argument of .Tg is empty, don't forget to complain
if there are additional arguments, which will be ignored.
* In the terminal formatter, support writing of explicit tags
for all kinds of nodes, not just for .Tg.
* In deroff(), allow nodes to have an explicit string representation
even when they aren't text nodes.  Use this for explicitly tagged
section headers.  Suprisingly, this is sufficient to make HTML
output work, without explicit code changes in the HTML formatter.
* In syntax tree output, display NODE_ID and NODE_HREF.

Revision 1.276 / (download) - annotate - [select for diffs], Thu Feb 27 01:25:57 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.275: +61 -79 lines
Diff to previous 1.275 (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.275 / (download) - annotate - [select for diffs], Mon Jan 20 10:29:31 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.274: +10 -10 lines
Diff to previous 1.274 (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.274 / (download) - annotate - [select for diffs], Sun Jan 19 17:59:01 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.273: +11 -2 lines
Diff to previous 1.273 (colored)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.273 / (download) - annotate - [select for diffs], Thu Jun 27 12:19:39 2019 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.272: +14 -10 lines
Diff to previous 1.272 (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.272 / (download) - annotate - [select for diffs], Mon Jun 3 19:50:31 2019 UTC (4 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.271: +2 -1 lines
Diff to previous 1.271 (colored)

Initialize the local variable "act" in print_mdoc_node().
While there is no bug, it helps clarity, and it is also safer in this
particular code because in case a bug gets introduced later, accessing
a NULL pointer is less dangerous than accessing an uninitialized pointer.

Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4
and 7.4.0 on illumos throw -Wuninitialized false positives.

Revision 1.271 / (download) - annotate - [select for diffs], Fri Jan 4 03:37:42 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.270: +44 -64 lines
Diff to previous 1.270 (colored)

Two functional improvements to filling in terminal output.

1. Fully support no-fill mode in mdoc(7), even when invoked with
low-level roff(7) .nf requests.  As a side effect, this substantially
simplifies the implementation of .Bd -unfilled and .Bd -literal.

2. Let .Bd -centered fill its text, using the new TERMP_CENTER flag.
That finally fixes the long-standing bug that it used to operate in
no-fill mode, which was known to be wrong for at least five years.
This also simplifies the implementation of .Bd -centered considerably.

Revision 1.270 / (download) - annotate - [select for diffs], Sun Dec 30 00:48:48 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.269: +5 -7 lines
Diff to previous 1.269 (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.269 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:14 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.268: +1 -2 lines
Diff to previous 1.268 (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.268 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:06 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.267: +10 -4 lines
Diff to previous 1.267 (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.267 / (download) - annotate - [select for diffs], Fri Aug 17 20:31:52 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.266: +10 -10 lines
Diff to previous 1.266 (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.266 / (download) - annotate - [select for diffs], Wed Apr 11 17:10:35 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.265: +11 -6 lines
Diff to previous 1.265 (colored)

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

Revision 1.265 / (download) - annotate - [select for diffs], Thu Apr 5 09:16:45 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.264: +3 -3 lines
Diff to previous 1.264 (colored)

use the portable \(lq and \(rq internally rather than \(Lq and \(Rq

Revision 1.264 / (download) - annotate - [select for diffs], Sat Jan 13 05:20:10 2018 UTC (6 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.263: +1 -9 lines
Diff to previous 1.263 (colored)

Remove the implicit display feature of .Lk because it was inconsistent
across output devices, counter-intuitive, and resulted in ugly
output for many real-world manual pages.  Always format even long
links in-line.  I already committed a similar change to groff.

OK jmc@, bentley@, and the original author
of the feature, Werner Lemberg <wl@gnu.org>.

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

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

Revision 1.262 / (download) - annotate - [select for diffs], Thu Jun 8 12:54:40 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.261: +4 -2 lines
Diff to previous 1.261 (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.261 / (download) - annotate - [select for diffs], Wed Jun 7 17:38:08 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.260: +76 -74 lines
Diff to previous 1.260 (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.260 / (download) - annotate - [select for diffs], Sun Jun 4 22:43:50 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.259: +9 -23 lines
Diff to previous 1.259 (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.259 / (download) - annotate - [select for diffs], Sun Jun 4 18:48:09 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.258: +12 -41 lines
Diff to previous 1.258 (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.258 / (download) - annotate - [select for diffs], Thu Jun 1 19:05:15 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.257: +3 -2 lines
Diff to previous 1.257 (colored)

Minimal implementation of the \h (horizontal motion) escape sequence.
Good enough to cope with the average DocBook insanity.

Revision 1.257 / (download) - annotate - [select for diffs], Tue May 30 16:31:25 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.256: +15 -7 lines
Diff to previous 1.256 (colored)

fix formatting of intermediate punctuation in .Lk

Revision 1.256 / (download) - annotate - [select for diffs], Tue May 9 14:09:37 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.255: +3 -2 lines
Diff to previous 1.255 (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.255 / (download) - annotate - [select for diffs], Sun May 7 17:30:58 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.254: +29 -11 lines
Diff to previous 1.254 (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.254 / (download) - annotate - [select for diffs], Fri May 5 15:16:25 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.253: +9 -37 lines
Diff to previous 1.253 (colored)

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

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

move .ll to the roff modules

Revision 1.252 / (download) - annotate - [select for diffs], Fri May 5 02:06:17 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.251: +2 -1 lines
Diff to previous 1.251 (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.251 / (download) - annotate - [select for diffs], Thu May 4 22:07:44 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.250: +2 -8 lines
Diff to previous 1.250 (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.250 / (download) - annotate - [select for diffs], Thu May 4 17:48:24 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.249: +17 -5 lines
Diff to previous 1.249 (colored)

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

Revision 1.249 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:09 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.248: +7 -5 lines
Diff to previous 1.248 (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.248 / (download) - annotate - [select for diffs], Mon Apr 17 12:52:00 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.247: +12 -6 lines
Diff to previous 1.247 (colored)

Fix handling of trailing punctuation in .Lk.
This macro is unusual in so far as trailing punction needs to remain
inside the scope because it must be inside, not after the display
of long URIs in terminal output mode.
Improves formatting of fw_update(1), help(1), less(1), sendbug(1),
acx(4), inet6(4), ipsec(4), oce(4), isakmpd.conf(5), afterboot(8),
release(8), traceroute(8).

Revision 1.247 / (download) - annotate - [select for diffs], Fri Apr 14 19:34:54 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.246: +11 -1 lines
Diff to previous 1.246 (colored)

Show long .Lk URIs in like an indented display, similar to groff.
Suggested by bentley@.

Revision 1.246 / (download) - annotate - [select for diffs], Fri Apr 14 18:23:29 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.245: +2 -2 lines
Diff to previous 1.245 (colored)

Do not make the colon after the .Lk link text italic.
I just pushed the same change to GNU troff.

Revision 1.245 / (download) - annotate - [select for diffs], Fri Feb 17 19:14:39 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.244: +5 -3 lines
Diff to previous 1.244 (colored)

Use typographic quotes rather than '"' for .Rs %T (no change for -Tascii
output, of course).  Patch from bentley@ in November 2014.  This can be
committed now because groff merged Anthony's patch yesterday.

Simply committing myself because asking Anthony to go search for
his two-year-old patch and have him discover that it had accumulated
an average of (felt) two or three conflicts per line by now would
have been mean, even if hilarious.

Revision 1.244 / (download) - annotate - [select for diffs], Thu Feb 16 14:38:07 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.243: +11 -5 lines
Diff to previous 1.243 (colored)

Surprisingly, groff does not support scaling units in .Bl -column
column width specifiers, so stop supporting them, too.
As a side effect, this fixes an assertion failure that tb@ found
with afl(1), triggered by: .Bl -column -4n

Revision 1.243 / (download) - annotate - [select for diffs], Thu Feb 16 02:59:42 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.242: +1 -9 lines
Diff to previous 1.242 (colored)

Remove the ENDBODY_NOSPACE flag, simplifying the code.

Comparing to groff output, it appears that all cases where it was used
and made a difference actually require the opposite, ENDBODY_SPACE.

I have no idea why i added it back in 2010; maybe to compensate for
some other bug that has long been fixed.

Revision 1.242 / (download) - annotate - [select for diffs], Mon Feb 6 03:41:44 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.241: +2 -4 lines
Diff to previous 1.241 (colored)

The .Nm macro does not only use the default name when it has no
argument, but also when the first argument is a child macro.
Arcane issue found in the FreeBSD cxgbetool(8) manual that Baptiste
Daroussin <bapt at FreeBSD> sent me long ago for a different reason.

While solving this, switch to the new technique of doing text
production in the validator, reducing code duplication in the
formatters, which also makes -Ttree output clearer.

Revision 1.241 / (download) - annotate - [select for diffs], Sat Feb 4 11:56:48 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.240: +4 -1 lines
Diff to previous 1.240 (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.240 / (download) - annotate - [select for diffs], Wed Jan 11 17:39:45 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.239: +5 -107 lines
Diff to previous 1.239 (colored)

Do text production for .Bt, .Ex, .Rv, .Ud at the validation stage
rather than in the formatters.  Use NODE_NOSRC flag for .Lb and
NODE_NOSRC and NODE_NOPRT for .St.  Results in a more rigorous
syntax tree and in 135 lines less code.

This work was triggered by a question from Abhinav Upadhyay <er dot
abhinav dot upadhyay at gmail dot com> (NetBSD) on discuss@.

Revision 1.239 / (download) - annotate - [select for diffs], Tue Jan 10 23:36:24 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.238: +2 -26 lines
Diff to previous 1.238 (colored)

Use new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At.
More rigorous AST and 40 lines less code.

Revision 1.238 / (download) - annotate - [select for diffs], Tue Jan 10 21:54:34 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.237: +18 -42 lines
Diff to previous 1.237 (colored)

For the .Ux/.Ox family of macros, do text production at the validation
stage rather than in each and every individual formatter, using the
new NODE_NOSRC flag.  More rigorous and also ten lines less code.

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

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

Revision 1.236 / (download) - annotate - [select for diffs], Tue Jan 10 12:54:27 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.235: +13 -2 lines
Diff to previous 1.235 (colored)

Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Use them to mark generated nodes and nodes that shall not produce output.
Let -Ttree output mode display these new flags.
Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments.
Use NODE_NOPRT for .Dd, .Dt, and .Os.

These will help to make handling of text production macros more rigorous.

Revision 1.235 / (download) - annotate - [select for diffs], Tue Nov 8 16:37:42 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.234: +2 -2 lines
Diff to previous 1.234 (colored)

use .Fn in custom sections for tagging, in addition to in DESCRIPTION;
written on the TGV Paris-Strassbourg

Revision 1.234 / (download) - annotate - [select for diffs], Tue Nov 8 16:29:19 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.233: +2 -1 lines
Diff to previous 1.233 (colored)

tag leading .Dv, .Li, and .No in .It;
written on the TGV Paris-Strassbourg

Revision 1.233 / (download) - annotate - [select for diffs], Tue Nov 8 16:23:37 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.232: +25 -3 lines
Diff to previous 1.232 (colored)

implement tag priority 0, which will tag only keys that appear as
tag candidates exactly once, and use it for .Em and .Sy;
written on the TGV Toulouse-Paris

Revision 1.232 / (download) - annotate - [select for diffs], Tue Nov 8 16:04:40 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.231: +4 -2 lines
Diff to previous 1.231 (colored)

generate two tag entries from list entries of the form
.It Macro tag1 ... | Macro tag2 ...
written on the TGV Toulouse-Paris

Revision 1.231 / (download) - annotate - [select for diffs], Sun Oct 9 18:16:46 2016 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +2 -2 lines
Diff to previous 1.230 (colored)

Delete complicated code dealing with .Bl -tag without -width,
and just let it default to -width 6n, which agrees with the
traditional -width Ds that is still in widespread use.

I just pushed a patch upstream to GNU roff that does the same for
groff_mdoc(7).  Before, groff contained code that was even more
complicated than mandoc, but both resulted in quite different
user-visible output.  Now, both agree, and output is nicer for both.

Useless complication noticed by Carsten Kunze (Heirloom roff).

Revision 1.230 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:04 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.229: +26 -25 lines
Diff to previous 1.229 (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.229 / (download) - annotate - [select for diffs], Mon Oct 12 15:27:53 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored)

Use "-" rather than "\(hy" for the heads of .Bl -dash and -hyphen lists.
In UTF-8 output, that renders as ASCII HYPHEN-MINUS (U+002D)
rather than HYPHEN (U+2010), which looks better and matches groff.
In ASCII output, it makes no difference.
Suggested by naddy@.

Revision 1.228 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.227: +4 -55 lines
Diff to previous 1.227 (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.227 / (download) - annotate - [select for diffs], Tue Oct 6 18:30:44 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.226: +79 -79 lines
Diff to previous 1.226 (colored)

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

Revision 1.226 / (download) - annotate - [select for diffs], Sat Sep 26 00:53:15 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.225: +1 -5 lines
Diff to previous 1.225 (colored)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.225 / (download) - annotate - [select for diffs], Mon Sep 21 13:24:32 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.224: +3 -3 lines
Diff to previous 1.224 (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.224 / (download) - annotate - [select for diffs], Mon Sep 14 12:57:30 2015 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.223: +2 -2 lines
Diff to previous 1.223 (colored)

The .Dv macro actually forces normal font.

Revision 1.223 / (download) - annotate - [select for diffs], Sat Jul 25 14:28:40 2015 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.222: +7 -11 lines
Diff to previous 1.222 (colored)

Simplify and make tag_put() more efficient by integrating tag_get()
into it and by only handling NUL-terminated strings.
Minus 25 lines of code, no functional change.

Revision 1.222 / (download) - annotate - [select for diffs], Sat Jul 25 14:22:40 2015 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.221: +16 -2 lines
Diff to previous 1.221 (colored)

implement tagging for .Er

Revision 1.221 / (download) - annotate - [select for diffs], Sat Jul 25 14:17:47 2015 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.220: +18 -3 lines
Diff to previous 1.220 (colored)

basic tag support for function names; written at YYC

Revision 1.220 / (download) - annotate - [select for diffs], Sat Jul 25 14:01:39 2015 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.219: +3 -3 lines
Diff to previous 1.219 (colored)

basic support for tag priorities; written at YYC

Revision 1.219 / (download) - annotate - [select for diffs], Fri Jul 17 22:35:36 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +22 -2 lines
Diff to previous 1.218 (colored)

Initial, still somewhat experimental implementation to leverage
less(1) -T and :t ctags(1)-like functionality to jump to the
definitions of various terms inside manual pages.
To be polished in the tree, so bear with me and report issues.

Technically, if less(1) is used as a pager, information is collected
by the mdoc(7) terminal formatter, first stored using the ohash
library, then ultimately written to a temporary file which is passed
to less via -T.  No change intended for other output formatters or
when running without a pager.

Based on an idea from Kristaps using feedback from many, in particular
phessler@ nicm@ millert@ halex@ doug@ kspillner@ deraadt@.

Revision 1.218 / (download) - annotate - [select for diffs], Sat Apr 18 17:50:02 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.217: +7 -9 lines
Diff to previous 1.217 (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.217 / (download) - annotate - [select for diffs], Sat Apr 18 16:04:40 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.216: +2 -2 lines
Diff to previous 1.216 (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.216 / (download) - annotate - [select for diffs], Sat Apr 4 17:46:58 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.215: +2 -2 lines
Diff to previous 1.215 (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.215 / (download) - annotate - [select for diffs], Thu Apr 2 23:47:43 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.214: +7 -13 lines
Diff to previous 1.214 (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.214 / (download) - annotate - [select for diffs], Thu Apr 2 22:06:17 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.213: +14 -14 lines
Diff to previous 1.213 (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.213 / (download) - annotate - [select for diffs], Thu Apr 2 21:03:18 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.212: +82 -81 lines
Diff to previous 1.212 (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.212 / (download) - annotate - [select for diffs], Mon Mar 9 17:41:36 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +3 -1 lines
Diff to previous 1.211 (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.211 / (download) - annotate - [select for diffs], Mon Mar 9 17:37:45 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.210: +7 -4 lines
Diff to previous 1.210 (colored)

In mdoc(7), don't mistreat negative .sp arguments as large positive ones.
Instead, use the same logic as for man(7).

Revision 1.210 / (download) - annotate - [select for diffs], Tue Feb 17 20:33:44 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored)

Render \(lq and \(rq as '"' in -Tascii mode but leave the rendering
of .Do/.Dc, .Dq, .Lb, and .St untouched.
Reduces groff-mandoc differences in base by about 7%.
Reminded of the issue by naddy@.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Feb 12 12:20:47 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.208: +4 -3 lines
Diff to previous 1.208 (colored)

Delete the mdoc_node.pending pointer and the function calculating
it, make_pending(), which was the most difficult function of the
whole mdoc(7) parser.  After almost five years of maintaining this
hellhole, i just noticed the pointer isn't needed after all.

Blocks are always rewound in the reverse order they were opened;
that even holds for broken blocks.  Consequently, it is sufficient
to just mark broken blogs with the flag MDOC_BROKEN and breaking
blocks with the flag MDOC_ENDED.  When rewinding, instead of iterating
the pending pointers, just iterate from each broken block to its
parents, rewinding all that are MDOC_ENDED and stopping after
processing the first ancestor that it not MDOC_BROKEN.  For ENDBODY
markers, use the mdoc_node.body pointer in place of the former
mdoc_node.pending.

This also fixes an assertion failure found by jsg@ with afl,
test case #467 (Bo Bl It Bd Bc It), where (surprise surprise)
the pending pointer got corrupted.

Improved functionality, minus one function, minus one struct field,
minus 50 lines of code.

Revision 1.208 / (download) - annotate - [select for diffs], Wed Feb 11 14:14:53 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.207: +3 -4 lines
Diff to previous 1.207 (colored)

do not access a NULL pointer if an .Eo block lacks a tail;
found by jsg@ with afl, test case #16

Revision 1.207 / (download) - annotate - [select for diffs], Thu Feb 5 01:46:38 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.206: +1 -4 lines
Diff to previous 1.206 (colored)

fix handling of empty .An macros

Revision 1.206 / (download) - annotate - [select for diffs], Thu Feb 5 00:13:34 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.205: +4 -7 lines
Diff to previous 1.205 (colored)

Simplify by deleting the "lastline" member of struct mdoc_node.
Minus one struct member, minus 17 lines of code, no functional change.

Revision 1.205 / (download) - annotate - [select for diffs], Sun Feb 1 23:10:15 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.204: +55 -14 lines
Diff to previous 1.204 (colored)

fix .Eo/.Ec spacing

Revision 1.204 / (download) - annotate - [select for diffs], Sat Jan 31 00:11:52 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.203: +2 -2 lines
Diff to previous 1.203 (colored)

Use relative offsets instead of absolute pointers for the terminal
font stack.  The latter fail after the stack is grown with realloc().
Fixing an assertion failure found by jsg@ with afl some time ago
(test case number 51).

Revision 1.203 / (download) - annotate - [select for diffs], Fri Jan 30 22:04:15 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.202: +5 -4 lines
Diff to previous 1.202 (colored)

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

Revision 1.202 / (download) - annotate - [select for diffs], Fri Jan 23 14:19:52 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.201: +6 -6 lines
Diff to previous 1.201 (colored)

Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra"
when the only child is .Mt, not when the preceding node is .An,
to improve robustness.  Triggered by a question from Svyatoslav
Mishyn <juef at openmailbox dot org> (Crux Linux).

Revision 1.201 / (download) - annotate - [select for diffs], Wed Dec 24 23:31:59 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.200: +57 -50 lines
Diff to previous 1.200 (colored)

Support negative indentations for mdoc(7) displays and lists.
Not exactly recommended for use, rather for groff compatibility.
While here, introduce similar SHRT_MAX limits as in man(7),
fixing a few cases of infinite output found by jsg@ with afl.

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

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

Revision 1.199 / (download) - annotate - [select for diffs], Tue Dec 23 09:31:17 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.198: +9 -18 lines
Diff to previous 1.198 (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.198 / (download) - annotate - [select for diffs], Tue Dec 2 10:07:17 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.197: +3 -2 lines
Diff to previous 1.197 (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.197 / (download) - annotate - [select for diffs], Sun Nov 30 05:28:00 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.196: +3 -2 lines
Diff to previous 1.196 (colored)

Multiple fixes with respect to .Pf:
* The first argument of .Pf is not parsed.
* Normal delimiter handling does not apply to the first argument of .Pf.
* Warn if nothing follows a prefix (inspired by groff_mdoc(7)).
* In that case, do not suppress spacing.

Revision 1.196 / (download) - annotate - [select for diffs], Fri Nov 28 16:53:38 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.195: +3 -9 lines
Diff to previous 1.195 (colored)

mop up and #ifdef turd deraadt@ stepped into

Revision 1.195 / (download) - annotate - [select for diffs], Fri Nov 28 16:02:23 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.194: +11 -7 lines
Diff to previous 1.194 (colored)

Be more careful about meta->name.  For weird input, it can be NULL.
Fixing a NULL access jsg@ found with afl.

Revision 1.194 / (download) - annotate - [select for diffs], Thu Nov 27 22:27:40 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.193: +6 -4 lines
Diff to previous 1.193 (colored)

Multiple fixes with respect to .Eo:
1. Correctly parse stray .Ec without preceding .Eo,
avoiding an assertion violation found by jsg@ with afl.
2. Correctly parse .Ec arguments when breaking another block.
3. Correct spacing around closing delimiter when breaking another block.
4. Sync some related formatting control from -Tascii to -Thtml.

Revision 1.193 / (download) - annotate - [select for diffs], Thu Nov 27 16:20:27 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +5 -5 lines
Diff to previous 1.192 (colored)

Fix the obsolete .Db (toggle debug mode) macro to ignore its arguments
and not trigger an assertion when there is more than one argument;
the latter found by jsg@ with afl.

Revision 1.192 / (download) - annotate - [select for diffs], Tue Nov 25 03:04:32 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +10 -7 lines
Diff to previous 1.191 (colored)

Do not access a NULL pointer when a section has no body,
which can for example happen for .Sh Xo .Sh without .Xc.
Crash found by jsg@ with afl.

Revision 1.191 / (download) - annotate - [select for diffs], Fri Nov 21 01:52:44 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +9 -11 lines
Diff to previous 1.190 (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.190 / (download) - annotate - [select for diffs], Wed Nov 19 21:59:19 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.189: +5 -3 lines
Diff to previous 1.189 (colored)

Let .Ao and .Aq render as "<>" after .An and as "\(la\(ra" elsewhere,
just like groff; minibug noticed by bentley@.

Revision 1.189 / (download) - annotate - [select for diffs], Mon Nov 17 06:44:35 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.188: +2 -2 lines
Diff to previous 1.188 (colored)

Multiple fixes with respect to in-line macros:
* .No selects the default font; relevant e.g. in .Bf blocks
* no need to force empty .Li elements
* closing delimiters as leading macro arguments do not suppress space
* opening delimiters at the end of a macro line do not suppress space
* correctly handle delimiter spacing in -Tman
As a side effect, these fixes let mandoc warn about empty .No macros
as requested by bentley@.

Revision 1.188 / (download) - annotate - [select for diffs], Mon Nov 10 21:54:29 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +12 -10 lines
Diff to previous 1.187 (colored)

add required vertical spacing before lists that begin
at the beginning of the first item of an enclosing list
right at the beginning of a new section or subsection;
minibug reported by Steffen Nurpmeso <sdaoden at yandex dot com>

Revision 1.187 / (download) - annotate - [select for diffs], Thu Oct 30 20:05:33 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.186: +13 -26 lines
Diff to previous 1.186 (colored)

Major bugsquashing with respect to -offset and -width:
1. Support specifying the .Bd and .Bl -offset as a macro default width;
while here, simplify the code handling the same for .Bl -width.
2. Correct handling of .Bl -offset arguments:  unlike .Bd -offset, the
arguments "left", "indent", and "indent-two" have no special meaning.
3. Fix the scaling of string length -offset and -width arguments in -Thtml.
Triggered by an incomplete documentation patch from bentley@.

Revision 1.186 / (download) - annotate - [select for diffs], Tue Oct 28 17:35:42 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +1 -4 lines
Diff to previous 1.185 (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.185 / (download) - annotate - [select for diffs], Mon Oct 20 15:49:45 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +2 -2 lines
Diff to previous 1.184 (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.184 / (download) - annotate - [select for diffs], Mon Oct 20 02:46:00 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +3 -1 lines
Diff to previous 1.183 (colored)

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

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

correct spacing before inline equations

Revision 1.182 / (download) - annotate - [select for diffs], Mon Oct 13 22:00:42 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +7 -3 lines
Diff to previous 1.181 (colored)

Properly scale string length measurements for PostScript and PDF output;
this doesn't change anything for ASCII and UTF-8.
Problem reported by bentley@.

Revision 1.181 / (download) - annotate - [select for diffs], Wed Sep 17 20:17:55 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +17 -45 lines
Diff to previous 1.180 (colored)

simplify handling of .An -[no]split for terminal output:
delete one static function, one flag #define, and 25 lines of code;
no functional change

Revision 1.180 / (download) - annotate - [select for diffs], Wed Sep 3 05:17:08 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +25 -18 lines
Diff to previous 1.179 (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.179 / (download) - annotate - [select for diffs], Thu Aug 21 12:56:24 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +5 -4 lines
Diff to previous 1.178 (colored)

Right after .Fl, a middle delimiter triggers an empty scope,
just like a closing delimiter.  This didn't work in groff-1.15,
but it now works in groff-1.22.

After being closed by delimiters, .Nm scopes do not reopen.

Do not suppress white space after .Fl if the next node is a text node
on the same input line; that can happen for middle delimiters.

Fixing an issue reported by jmc@.

Revision 1.178 / (download) - annotate - [select for diffs], Sun Aug 17 18:42:07 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.177: +10 -5 lines
Diff to previous 1.177 (colored)

Segfault fixes from kristaps@.
Note that .It and .Nm blocks without bodies cannot be generated by
valid mdoc(7) syntax but are a adequate representations of invalid
mdoc(7) constructs like Bl -hang It Bo Sh and Sh SYNOPSIS Nm Bo Sh.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Aug 8 16:17:09 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.176: +6 -2 lines
Diff to previous 1.176 (colored)

Bring the handling of defective prologues even closer to groff,
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED.  Warn about it.
* Missing section in .Dt does not default to 1.  But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings.  Warn about it.

Revision 1.176 / (download) - annotate - [select for diffs], Fri Aug 8 15:26:28 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +5 -2 lines
Diff to previous 1.175 (colored)

Get rid of the useless FATAL error "child violates parent syntax".
When finding items outside lists, simply skip them and throw an ERROR.
Handle subsections before the first section instead of bailing out.

Revision 1.175 / (download) - annotate - [select for diffs], Fri Aug 8 15:10:15 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +32 -23 lines
Diff to previous 1.174 (colored)

Various improvements related to .Ex and .Rv:
* let .Nm fall back to the empty string, not to UNKNOWN
* never let .Rv copy an argument from .Nm
* avoid spurious \fR after empty .Nm in -Tman
* correct handling of .Ex and .Rv in -Tman
* correct the wording of the output for .Rv without arguments
* use non-breaking spaces in .Ex and .Rv output where required
* split MANDOCERR_NONAME into a warning for .Ex and an error for .Nm

Revision 1.174 / (download) - annotate - [select for diffs], Fri Aug 8 15:03:24 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +14 -3 lines
Diff to previous 1.173 (colored)

Partial implementation of .Bd -centered.

In groff, .Bd -centered operates in fill mode, which is relatively
hard to implement, while this implementation operates in non-fill
mode so far.  As long as you pay attention that your lines do not
overflow, it works.  To make sure that rendering is the same for
mandoc and groff, it is recommended to insert .br between lines
for now.  This implementation will need improvement later.

Revision 1.173 / (download) - annotate - [select for diffs], Mon Jul 7 15:03:24 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.172: +5 -2 lines
Diff to previous 1.172 (colored)

no need to skip content before first section header

Revision 1.172 / (download) - annotate - [select for diffs], Thu Jul 3 23:23:45 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +2 -2 lines
Diff to previous 1.171 (colored)

Fix formatting of empty .Bl -inset item heads.
Downgrade empty item heads from ERROR to WARNING.
Show the list type in the error message.
Choose better variable names for nodes in post_it().

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jul 2 19:54:39 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +8 -6 lines
Diff to previous 1.170 (colored)

When .Sm is called without an argument, groff toggles the spacing mode,
so let us do the same for compatibility.  Using this feature is of
course not recommended except in manual page obfuscation contests.

Revision 1.170 / (download) - annotate - [select for diffs], Wed Jul 2 03:47:07 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.169: +29 -6 lines
Diff to previous 1.169 (colored)

Implement the obsolete macros .En .Es .Fr .Ot for backward compatibility,
since this is hardly more complicated than explicitly ignoring them
as we did in the past.  Of course, do not use them!

Revision 1.169 / (download) - annotate - [select for diffs], Wed Apr 23 16:07:06 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.168: +15 -18 lines
Diff to previous 1.168 (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.168 / (download) - annotate - [select for diffs], Sun Apr 20 20:17:36 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.167: +8 -5 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Sun Apr 20 19:39:35 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored)

make sure static buffers for snprintf(3) are large enough
and cast snprintf return value to (void) where they are

Revision 1.166 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.165: +208 -325 lines
Diff to previous 1.165 (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.165 / (download) - annotate - [select for diffs], Tue Apr 8 07:13:01 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.164: +14 -13 lines
Diff to previous 1.164 (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.164 / (download) - annotate - [select for diffs], Tue Apr 8 04:40:29 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.163: +3 -1 lines
Diff to previous 1.163 (colored)

If the SYNOPSIS section contains an excessively long .Nm,
adjust the right margin to avoid running into an assertion;
output in that case now agrees with groff, too.

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

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

Revision 1.162 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:32 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.161: +17 -3 lines
Diff to previous 1.161 (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.161 / (download) - annotate - [select for diffs], Sun Feb 16 12:30:51 2014 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.160: +6 -3 lines
Diff to previous 1.160 (colored)

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

Revision 1.160 / (download) - annotate - [select for diffs], Wed Dec 25 21:24:03 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.159: +2 -3 lines
Diff to previous 1.159 (colored)

Oops, .Fa never breaks the output line in the middle of any of its
arguments, not even outside SYNOPSIS mode.  Quite surprising as .Fn
does break the line in the middle of its arguments outside SYNOPSIS
mode, and only doesn't do that in SYNOPSIS mode.  Wonders of groff...

Revision 1.159 / (download) - annotate - [select for diffs], Wed Dec 25 15:12:39 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.158: +5 -7 lines
Diff to previous 1.158 (colored)

Garbage collect two local variables each used only one single time.

Revision 1.158 / (download) - annotate - [select for diffs], Wed Dec 25 14:40:29 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.157: +23 -8 lines
Diff to previous 1.157 (colored)

In the SYNOPSIS, implement hanging indentation for .Fo
and avoid output line breaks inside .Fa arguments.
This reduces groff-mandoc differences in base by more than 8%.
Patch from Franco Fichtner <franco at lastsummer dot de> (DragonFly).

Revision 1.157 / (download) - annotate - [select for diffs], Wed Dec 25 00:39:13 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.156: +3 -1 lines
Diff to previous 1.156 (colored)

Do not break output lines in .Fn function arguments in SYNOPSIS mode.
Following an idea from Franco Fichtner, but implemented more cleanly.
This reduces groff-mandoc-differences in base by a fantastic 7.5%.

Revision 1.156 / (download) - annotate - [select for diffs], Tue Dec 24 23:04:29 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.155: +3 -14 lines
Diff to previous 1.155 (colored)

Delete the unused flag TERMP_IGNDELIM
and the empty callback termp_igndelim_pre().
Sort the remaining termp flags.

Revision 1.155 / (download) - annotate - [select for diffs], Tue Dec 24 20:45:21 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.154: +9 -18 lines
Diff to previous 1.154 (colored)

It turns out SYNOPSIS mode does not imply .Bk in general,
but only within .Nm blocks.  Simplify the code accordingly.
This reduces groff-mandoc differences in base by about 2%.

Triggered by research done by Franco Fichtner.

Revision 1.154 / (download) - annotate - [select for diffs], Tue Dec 24 19:10:34 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.153: +2 -2 lines
Diff to previous 1.153 (colored)

When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins)
to the line where the second one starts.
This fixes the bug that .Bk allowed output line breaks right after block
macros spanning more than one input line, even when the next macro follows
on the same line.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Dec 23 02:19:57 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.152: +17 -1 lines
Diff to previous 1.152 (colored)

Implement a long-standing desideratum,
hanging indentation for .Fn in SYNOPSIS mode,
exploiting the new trailspace feature
by deliberately *NOT* using it.

Revision 1.152 / (download) - annotate - [select for diffs], Sun Dec 22 23:33:52 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.151: +31 -18 lines
Diff to previous 1.151 (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.151 / (download) - annotate - [select for diffs], Sun Jun 2 18:16:51 2013 UTC (10 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.150: +5 -5 lines
Diff to previous 1.150 (colored)

Let .Do .Dq .Ql .So .Sq generate the correct roff(7) character escape
sequences such that output modes like -Tutf8 have a chance to select
nice glyphs.  This doesn't change anything for -Tascii, and, for now,
it doesn't affect -Tps and -Tpdf either.
OK matthew@ bentley@; like the idea tedu@; no opinion jmc@.

Revision 1.150 / (download) - annotate - [select for diffs], Wed May 29 16:11:32 2013 UTC (10 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.149: +3 -7 lines
Diff to previous 1.149 (colored)

Simplify condition, avoid duplicate code; no functional change.

Revision 1.149 / (download) - annotate - [select for diffs], Wed May 29 15:40:14 2013 UTC (10 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.148: +2 -2 lines
Diff to previous 1.148 (colored)

In SYNOPSIS mode, .Ek doesn't end a keep.
Found and fixed on the plane to the OpenBSD t2k13 hackathon in Toronto.

Revision 1.148 / (download) - annotate - [select for diffs], Sat May 18 17:47:17 2013 UTC (11 years ago) by schwarze
Branch: MAIN
Changes since 1.147: +3 -2 lines
Diff to previous 1.147 (colored)

Should termp_xx_pre() ever get called for a macro it cannot handle,
use abort(3), just like in the three other comparable cases in this file,
instead of ignoring the problem and causing a null pointer access.
Cosmetical issue reported by Ulrich Spoerlein <uqs@spoerlein.net>
found by Coverity Scan CID 976115.
No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Sat Nov 17 00:25:20 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.146: +38 -37 lines
Diff to previous 1.146 (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.146 / (download) - annotate - [select for diffs], Fri Nov 16 17:16:29 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.145: +7 -7 lines
Diff to previous 1.145 (colored)

Improve formatting of badly nested font blocks.
The basic idea is to already pop the font at the end marker
instead of allowing it to linger until the final end of the block.

This requires a few preliminaries:
* For each block, save a pointer to the previous font
  to be used in case the block breaks another and gets extended.
* That requires making node information writable during rendering.
* Now fonts may get popped in the wrong order; hence, after the stack
  has already been rewound further by some block that began earlier,
  ignore popping a font that was put on the stack later.
* To be able to exploit all this for font blocks, tie processing
  to their body, not their block, which is more logical anyway.

Triggered by florian@ reporting vaguely similar issues with list blocks.

Revision 1.145 / (download) - annotate - [select for diffs], Wed Jul 11 16:55:29 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

fix position and formatting of %U

Revision 1.144 / (download) - annotate - [select for diffs], Tue Jul 10 14:35:57 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.143: +12 -8 lines
Diff to previous 1.143 (colored)

* implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .It
* fix -Tman .Bl -bullet .It
* adjust the -Tascii .Bl -bullet -dash -hyphen .It
default and minimum width to new groff standards,
it changed from 4n (in groff 1.15) to 2n (in groff 1.21)
* same for -Tascii -enum, it changed from 5n to 2n
* use -hang formatting for -Tascii -enum -width 2n
* for -Tascii -enum, the default is -width 3n

Revision 1.143 / (download) - annotate - [select for diffs], Mon Jul 9 23:52:47 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.142: +14 -16 lines
Diff to previous 1.142 (colored)

fix -Tascii .Fd line breaking
and implement -Tman .Fd

Revision 1.142 / (download) - annotate - [select for diffs], Sun Jul 8 22:48:38 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.141: +16 -17 lines
Diff to previous 1.141 (colored)

fix .Lk for -Tascii and implement it for -Tman

Revision 1.141 / (download) - annotate - [select for diffs], Sun Jul 8 16:50:36 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.140: +3 -1 lines
Diff to previous 1.140 (colored)

implement -Tman .An
also reset -[no]split mode at .Sh AUTHORS in -Tascii

Revision 1.140 / (download) - annotate - [select for diffs], Sun Nov 13 13:05:23 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.139: +9 -9 lines
Diff to previous 1.139 (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.139 / (download) - annotate - [select for diffs], Thu Nov 3 20:32:33 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.138: +6 -2 lines
Diff to previous 1.138 (colored)

Correct .Eo spacing:
no space between the delimiters and the enclosed text.
The mdoc_html.c part was added by kristaps; ok kristaps@.

Revision 1.138 / (download) - annotate - [select for diffs], Sun Oct 16 12:18:32 2011 UTC (12 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.137: +3 -1 lines
Diff to previous 1.137 (colored)

Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

Revision 1.137 / (download) - annotate - [select for diffs], Tue Sep 20 09:02:18 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.136: +23 -16 lines
Diff to previous 1.136 (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.136 / (download) - annotate - [select for diffs], Mon Sep 19 22:36:11 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.135: +9 -24 lines
Diff to previous 1.135 (colored)

Remove the terminal frontend flag TERMP_NOLPAD.

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

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

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

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

ok kristaps@

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

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

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

Revision 1.134 / (download) - annotate - [select for diffs], Tue Jul 5 04:12:41 2011 UTC (12 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.133: +3 -2 lines
Diff to previous 1.133 (colored)

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

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

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

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

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

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

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

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

Revision 1.130 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:33 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.129: +6 -10 lines
Diff to previous 1.129 (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.129 / (download) - annotate - [select for diffs], Sun Feb 6 22:56:45 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.128: +9 -3 lines
Diff to previous 1.128 (colored)

Do not break the line between the arguments of .Bsx .Dx .Fx .Nx .Ox .Ux.
Original patch from kristaps@, but i fixed a regression regarding .Bk.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Feb 6 22:25:36 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.127: +22 -17 lines
Diff to previous 1.127 (colored)

Some pre-handlers produce output, so reorder the code to set up
keep flags before they are called.
Without this bugfix, .Bk was ineffective in some cases.
"looks reasonable" kristaps@

Revision 1.127 / (download) - annotate - [select for diffs], Sun Feb 6 17:33:20 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.126: +3 -2 lines
Diff to previous 1.126 (colored)

If .Ns is specified on its own line, ignore it, like groff does;
from kristaps@.

Revision 1.126 / (download) - annotate - [select for diffs], Sun Jan 30 18:28:01 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.125: +21 -7 lines
Diff to previous 1.125 (colored)

Make .Bx accept not more than two arguments.
Convert the first character of the second argument to uppercase.
Append the second argument with a hyphen.
Improves chpass(1), column(1), fstat(1), ...
from kristaps@

Revision 1.125 / (download) - annotate - [select for diffs], Sun Jan 30 17:41:59 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

Like in groff, if .%B is specified, quote .%T; from kristaps@.

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

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

Revision 1.123 / (download) - annotate - [select for diffs], Sun Jan 9 16:09:41 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +4 -2 lines
Diff to previous 1.122 (colored)

Only .Bd -literal has 8-character tabs,
while .Bd -unfilled has 5-character tabs just like normal text;
from kristaps@.

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

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

Revision 1.121 / (download) - annotate - [select for diffs], Wed Dec 29 00:47:31 2010 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.120: +32 -39 lines
Diff to previous 1.120 (colored)

Reorg by Kristaps:  In libmdoc, replace the union of pointers to structs
of macro-specific data by a pointer to a union of structs, which makes the
code simpler and more robust at the expense of a small memory overhead.
Merging was somewhat difficult because we mustn't break tbl(1) support
which the bsd.lv version does not yet have.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Dec 26 21:04:19 2010 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +45 -4 lines
Diff to previous 1.119 (colored)

Behave more like groff (both old and new): Specifying both .%T and .%J in
an .Rs block causes the title to be quoted instead of underlined, such
that journal title and article title appear visually different.
Original diff from kristaps@, simplified by me, tweaked again by kristaps@.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Dec 21 23:57:31 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

Migrate .An to use a pointer to its data, like everybody else.
In preparation for a simpler ref-counted system for node data.
From kristaps@.

Revision 1.118 / (download) - annotate - [select for diffs], Tue Dec 21 23:46:18 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +1 -6 lines
Diff to previous 1.117 (colored)

Vertical spacing improvements from kristaps@, small tweaks by me:
Add a "last child" member to struct mdoc_node.
Remove .Pp or .Lp if it is the first or last child of an .Sh or .Ss body.
Thus, no need to do the same in the front-ends any longer.
Tolerate some cases of .Pp inside .Bl.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Dec 19 12:10:33 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.116: +3 -2 lines
Diff to previous 1.116 (colored)

Handle .Bk the same way as groff 1.20.1:
.Bk without arguments defaults to -words.
.Bk with invalid arguments (including -lines) has no effect.
ok kristaps@

Revision 1.116 / (download) - annotate - [select for diffs], Sat Dec 11 14:29:56 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +15 -2 lines
Diff to previous 1.115 (colored)

Make SYNOPSIS sections and code having .nr nS enabled
behave as if the whole code were wrapped in .Bk/.Ek,
i.e. keeping input lines together on output lines.
This is compatible with new groff behaviour and deviates
from historical groff.
Tweaked version of a patch sent by kristaps@ on July 16, 2010.
ok kristaps@ jmc@ sobrado@ millert@

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

Do not follow .D1 and .Dl inside .Bd with a blank line.
Kristaps@ came up with this improvement when he merged
my patch introducing support for nested displays.

Revision 1.114 / (download) - annotate - [select for diffs], Wed Dec 1 22:02:29 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

Merge mdoc_action.c into mdoc_validate.c, because having two places to do
basically the same things just causes code duplication and confusion.
Work by kristaps@, including a few bugfixes he found during the merge,
and reapplying OpenBSD changes on top.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Oct 23 23:30:41 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

let .Bsx print just "BSD/OS" like in modern groff
from Ulrich Spoerlein <uqs at spoerlein dot net>

Revision 1.112 / (download) - annotate - [select for diffs], Sat Oct 23 16:08:36 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +3 -1 lines
Diff to previous 1.111 (colored)

.Sm no longer produces a linebreak when used in .Bd
also avoid an extra space after the opening bracket in .Op in -Thtml
from kristaps@

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

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

Revision 1.110 / (download) - annotate - [select for diffs], Sat Oct 16 13:38:29 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.109: +21 -0 lines
Diff to previous 1.109 (colored)

Support tbl(1) code embedded into mdoc(7) input files.
Very similar to what i have done in man(7) yesterday.
Allows to build cpu(4) on HPPA, wi(4), and phantasia(6).
Now we are able to build all tbl code in base.

Revision 1.109 / (download) - annotate - [select for diffs], Fri Oct 1 21:38:26 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.108: +4 -5 lines
Diff to previous 1.108 (colored)

* need a space before .No even if it starts with a closing delimiter
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No
* do not let opening delimiters fall out of the front of .Ns (from kristaps@)
This fixes a few spacing issues in csh(1) and ksh(1).
OK kristaps@

Revision 1.108 / (download) - annotate - [select for diffs], Mon Sep 27 21:25:28 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.107: +20 -0 lines
Diff to previous 1.107 (colored)

Merge the last bits of 1.10.6 (released today), most were already in:
* ignore double-.Pp
* ignore .Pp before .Bd and .Bl (unless -compact in specified)
* avoid double blank line upon .Pp, .br and friends in literal context
* cast enums to int when passing them to exit(3) to please lint(1)
While merging, fix a regression introduced by kristaps@:
Outside literal mode, double blank lines must both be printed.
To achieve this again after kristaps@ improvements in 1.10.6,
treat such blank lines as .sp (instead of .Pp as in 1.10.5)
and drop .Pp before .sp just like dropping .Pp before .Pp.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Sep 26 18:55:22 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.106: +116 -223 lines
Diff to previous 1.106 (colored)

consolidate all enclosure opening and closing functions
to help code comprehension and reduce code size
also remove redundant TERMP_NOSPACE here and there
from kristaps@

Revision 1.106 / (download) - annotate - [select for diffs], Sun Sep 26 18:23:54 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.105: +8 -2 lines
Diff to previous 1.105 (colored)

no punctuation after .%* outside .Rs
in .Rs, mark full stops after .%* as end of a sentence
from kristaps@

Revision 1.105 / (download) - annotate - [select for diffs], Thu Sep 23 20:39:13 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.104: +12 -6 lines
Diff to previous 1.104 (colored)

When the HEAD of an .Nm block in the SYNOPSIS might be wider
than the column containing it, the TERMP_HANG flag is required,
but avoid the flag when we know that the HEAD is shorter,
because in that case, the flag might ruin the alignment.

Problem originally reported by jmc@, who also spotted a regression
in an earlier version of this patch.

"feel free to commit" kristaps@

Revision 1.104 / (download) - annotate - [select for diffs], Mon Sep 20 20:02:27 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.103: +25 -1 lines
Diff to previous 1.103 (colored)

Format multiple authors (.%A) in the same way as groff:
Two authors with "and", but without a comma.
Three or more with commata, and an "and" before the last one.
From kristaps@.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Aug 21 14:00:59 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.102: +1 -14 lines
Diff to previous 1.102 (colored)

Backout previous.
As Kristaps found out, i was wrong: .Bl -column phrases do not ignore
spacing rules for trailing punctuation in general.  In particular,
- the rightmost column of a column list is unaffected
- columns terminated by the .Ta macro instead of a tab are unaffected
- columns ending in a blank are unaffected
Spacing rules for trailing punctuation are only ignored when the tab
follows the punctuation immediately, without a blank in between,
because then the combination of punctuation and tab is treated by roff
as a word, and the punctuation is not recognized as isolated.
The reason this doesn't work in mandoc is that in the special case
of .Bl -column (not in general!), mandoc treats tabs as word delimiters.
We either need to solve this differently, or call it a bug in roff.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Aug 20 22:51:24 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.101: +14 -1 lines
Diff to previous 1.101 (colored)

.Bl -column phrases ignore spacing rules for trailing punctuation
and render it just like normal text.
Minimal fix of a formatting bug in operator(7) reported by ray@.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Aug 18 01:45:22 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.100: +8 -6 lines
Diff to previous 1.100 (colored)

Correctly print .Lk arguments in -Tascii.
Issue reported by Aldis Berzoja, fix by kristaps@.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Aug 4 18:52:55 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.99: +5 -6 lines
Diff to previous 1.99 (colored)

In .Bd -literal, break the output line after the last element of each
input line, not after the first element.  Since free-form text lines
only have a single element in literal mode, this is only relevant for
macro lines inside literal displays, and only for those containing
more than one macro.  Fixes e.g. awk(1) and boot_config(8).
Note this fix differs from what kristaps@ committed to bsd.lv because
those changes introduce regressions with respect to blank lines in
literal mode.
With permission from deraadt@ to still fix bugs in mandoc.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Jul 31 21:43:07 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.98: +3 -4 lines
Diff to previous 1.98 (colored)

Merge bsd.lv version 1.10.5: last larger batch of bug fixes before release.
NOT including Kristaps' .Bd -literal changes which cause regressions.
Features:
* -Tpdf now fully working
Bugfixes:
* proper handling of quoted strings by .ds in roff(7)
* allow empty .Dd
* make .Sm start no-spacing after the first output word
* underline .Ad
* minor fixes in -Thtml
and some optimisations in terminal output.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jul 25 18:05:54 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.97: +7 -2 lines
Diff to previous 1.97 (colored)

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

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jul 21 21:44:28 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.96: +3 -2 lines
Diff to previous 1.96 (colored)

In the SYNOPSIS, .Nm at the beginning of an input line starts
an .Nm block, and gets special handling (new line, indentation).
But .Nm in the middle of a line is just a normal in-line element,
so make sure it does NOT get the special handling.
Partly fixes the test(1) SYNOPSIS; indentation after "[" is still
excessive, which is an unrelated and more difficult issue.
Reminded of the problem by jmc@;
OK kristaps@.

Revision 1.96 / (download) - annotate - [select for diffs], Fri Jul 16 00:03:29 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.95: +5 -3 lines
Diff to previous 1.95 (colored)

After .Sm on, spacing ought to restart right away, before the next token,
and not with a delay, after the next token.  But be careful not to cause
leading white space at the beginning of a line or column.
Improves chmod(1), ksh(1), tar(1), ps(1) and probably many more.
ok kristaps@ jmc@ sobrado@

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

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

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jul 1 15:36:59 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.93: +43 -3 lines
Diff to previous 1.93 (colored)

Improve .Nm indentation in the SYNOPSIS;
kristaps@ will do the missing HTML part soon.
"looks nicer" jmc@
"seems perfect to me" sobrado@
"slap it in" kristaps@

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 29 17:10:30 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.92: +25 -8 lines
Diff to previous 1.92 (colored)

Support for badly nested blocks, written around the time of
the Rostock mandoc hackathon and tested and polished since,
supporting constructs like:

.Ao Bo    Ac    Bc        (exp breaking exp)
.Aq Bo    eol   Bc        (imp breaking exp)
.Ao Bq    Ac    eol       (exp breaking imp)
.Ao Bo So Bc    Ac  Sc    (double break, inner before outer)
.Ao Bo So Ac    Bc  Sc    (double break, outer before inner)
.Ao Bo    Ac So Bc  Sc    (broken breaker)
.Ao Bo So Bc Do Ac  Sc Dc (broken double breaker)

There are still two known issues which are tricky:

1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol)
fails outright, triggering a bogus syntax error.
2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc
or Ao Ao Bq Ac Ac eol) still has a minor rendering error left:
"<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">".

We can fix these later in the tree, let's not grow this diff too large.

"get it in" kristaps@

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

Full .nr nS support, unbreaking the kernel manuals.

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

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

Revision 1.91 / (download) - annotate - [select for diffs], Sun Jun 27 17:49:58 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.90: +14 -4 lines
Diff to previous 1.90 (colored)

minor .Bk fixes:
* do not print invalid arguments verbatim (no groffs prints them, either)
* do not trigger TERMP_PREKEEP twice
* do not die from invlid arguments (groff won't die, either)
* continue to ignore even valid arguments (just like groff)
ok kristaps@ on the previous version, before removing my last bug ;)

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jun 27 01:24:02 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.89: +22 -2 lines
Diff to previous 1.89 (colored)

Basic implementation of .Bk/.Ek.
OK and one stylistic tweak by kristaps@.

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

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

Revision 1.88 / (download) - annotate - [select for diffs], Sat Jun 26 17:56:43 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.87: +49 -112 lines
Diff to previous 1.87 (colored)

merge release 1.10.2
* bug fixes:
- interaction of ASCII_HYPH with special chars (found by Ulrich Spoerlein)
- handling of roff conditionals (found by Ulrich Spoerlein)
- .Bd -offset will no more default to 6n
* maintenance:
- more caching of .Bd and .Bl arguments for efficiency
- deconstify man(7) validation routines
- add FreeBSD library names (provided by Ulrich Spoerlein)
* start PostScript font-switching

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

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

Revision 1.86 / (download) - annotate - [select for diffs], Tue Jun 8 00:11:47 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.85: +91 -77 lines
Diff to previous 1.85 (colored)

Merge more bits that will be going into 1.10.1:

Clean up vertical spacing in the SYNOPSIS, making the code much more
systematic; this doesn't solve all SYNOPSIS problems yet, in particular
not those related to keeps, indentation and the low-level .nr roff
instruction, but it's a nice step forward and i couldn't find relevant
regressions.  (from kristaps)

Besides,
* make the output width configurable (default: -Owidth=80) (kristaps)
* use mmap with MAP_SHARED (from Joerg Sonnenberger)

Revision 1.85 / (download) - annotate - [select for diffs], Sun Jun 6 20:30:08 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.84: +86 -73 lines
Diff to previous 1.84 (colored)

Merge bsd.lv version 1.10.1 (to be released soon).

The main step forward is that this now has *much* better .Bl -column
support, now supporting many manuals that previously errored out
without producing any output.

Other fixes include:
* do not die from multiple list types, use the first and warn
* in .Bl without a type, default to -item
* various tweaks to .Dt
* fix .In, .Fd, .Ft, .Fn and .Fo formatting
* some documentation fixes and additions
* and fix a couple of bugs reported by Ulrich Spoerlein:
* better support for roff block-end "\}" without a preceding dot
* .In must not break the line outside SYNOPSIS
* spelling in some error messages

While merging, fix one regression in .In spacing
that needs to go to bsd.lv, too.

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

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

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

Revision 1.83 / (download) - annotate - [select for diffs], Mon May 24 00:37:01 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.82: +2 -1 lines
Diff to previous 1.82 (colored)

Fix the code to add a line break before .Nm in the SYNOPSIS;
patch from Joerg Sonnenberger;
this finally fixes the test(1) SYNOPSIS.

Revision 1.82 / (download) - annotate - [select for diffs], Mon May 24 00:00:10 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.81: +48 -91 lines
Diff to previous 1.81 (colored)

Increase performance by saving the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can know whether to
dump list line arguments into the body (`Bl -column' overflowing).
Remove a2list() and arg_listtype() because of this.

From kristaps@.

While merging, fix a regression in mdoc_term.c, print_bvspace():
The bsd.lv version of this broke vertical spacing in .Bl -column.

Revision 1.81 / (download) - annotate - [select for diffs], Sun May 23 22:45:01 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.80: +7 -3 lines
Diff to previous 1.80 (colored)

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

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

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

Written by kristaps@.

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

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

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

allow non-numeric manual sections in -mdoc;
while here, allow LIBRARY in section 9;
by kristaps@

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

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

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

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

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

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

Revision 1.76 / (download) - annotate - [select for diffs], Sat May 8 02:10:09 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.75: +2 -22 lines
Diff to previous 1.75 (colored)

sync to bsd.lv mdoc_term.c 1.117, mdoc_html.c 1.61:
fixed %T: it now correctly underlines, instead of quoting;
noted by jmc@, fixed by kristaps@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Apr 23 00:23:46 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.74: +10 -7 lines
Diff to previous 1.74 (colored)

Handle literal tab characters both in literal context (.Bd -literal)
and outside.  In literal context, tab stops are at each eigth column;
outside, they are at each fifth column.

Use tabwidth = 5 as the default and temporarily switch to 8 in termp_bd_pre().
This requires to move the term_flushln() of the final line of a display from
termp_bd_post() to termp_bd_pre(); the former still needs term_newln()
to handle the final lines of non-literal displays.

Handling inside term_flushln() is tricky because a tab collapses with
inter-word spacing, but not with another tab.

Missing feature reported independently by jmc@ and deraadt@.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Apr 12 22:52:19 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

Partial revert of term.c rev. 1.23
because jmc@ noticed that it broke blank lines in literal displays.

The original idea was to suppress stray blank lines.
But we don't want to suppress *all* blank lines,
instead just those caused by nested lists.
So do the check whether there was any output on this line,
i.e. whether or not to break the line,
at the right place, which is after processing the .It body.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Apr 7 23:15:05 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.72: +17 -7 lines
Diff to previous 1.72 (colored)

Merge the good parts of 1.9.23,
avoid the bad parts of 1.9.23, and keep local patches.

Input in general:
 * Basic handling of roff-style font escapes \f, \F.
 * Quoted punctuation does not count as punctuation.

mdoc(7) parser:
 * Make .Pf callable; noted by Claus Assmann.
 * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@.
 * Do not warn when .Er is used outside certain sections.
 * Replace mdoc_node_free[list] by mdoc_node_delete.
 * Replace #define by enum for rew*() return values.

man(7) parser:
 * When .TH is missing, use default section and date.

Output in general:
 * Curly braces do not count as punctuation.
 * No space after .Fl w/o args when a macro follows on the same line.

HTML output:
 * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT().
 * Print whitespace after, not before .Vt .Fn .Ft .Fo.

Checked that all manuals in base still build.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Apr 3 17:06:19 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.71: +5 -2 lines
Diff to previous 1.71 (colored)

no need to die from .Xr without arguments, we can just ignore it

ok deraadt@

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

merge 1.9.17, keeping local patches

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

Revision 1.70 / (download) - annotate - [select for diffs], Tue Mar 2 00:38:59 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.69: +15 -1 lines
Diff to previous 1.69 (colored)

Proper inter-sentence spacing for mdoc(7).
When a text line or a non-block macro line in the source code ends
in any of ".!?", consider that an end of sentence (EOS).
This makes Jason's rule "new sentence, new line" even more important.
Let the parser detect the EOS and insert a token into the AST.
Let the -Tascii frontend render the EOS token as a double space before
the next word.

Revision 1.69 / (download) - annotate - [select for diffs], Thu Feb 18 02:11:26 2010 UTC (14 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.68: +19 -3 lines
Diff to previous 1.68 (colored)

sync to release 1.9.15:
 * corrected .Vt handling (spotted by Joerg Sonnenberger)
 * corrected .Xr argument handling (based on my patch)
 * removed \\ escape sequence (because it is for low-level roff only)
 * warn about trailing whitespace (suggested by jmc@)
 * -Txhtml support
 * and some general cleanup and doc improvements

Revision 1.68 / (download) - annotate - [select for diffs], Sat Jan 2 02:42:06 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +85 -53 lines
Diff to previous 1.67 (colored)

complete the sync to 1.9.15-pre2: mostly minor fixes
 * bugfix: do not restore TERMP flags when leaving lists, just reset them
 * and a few HTML fixes
 * clarity: return width from a2width, not width+2, and adapt to it
 * manual: document .Bl and .Fl
 * portability: no need to escape '%' in macro names

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jan 1 23:28:03 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.66: +7 -2 lines
Diff to previous 1.66 (colored)

When a .Fl macro without an argument is followed by text,
we need a space in between;
patch by kristaps@, rev. 1.103 and 1.104;
fixes regress/usr.bin/mandoc/mdoc/Fl/noarg.in.

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jan 1 21:37:52 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +40 -27 lines
Diff to previous 1.65 (colored)

Fix .Bl -column horizontal spacing to agree with groff.
My original patch nicely improved by and OK kristaps@;
merged upstream as rev. 1.105, 1.106.

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

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

Revision 1.64 / (download) - annotate - [select for diffs], Wed Dec 23 22:30:17 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

sync to 1.9.13: minor fixes:

correctness/functionality:
 - bugfix: properly ignore lines with only a dot in -man
 - bugfix: .Bl -ohang doesn't allow -width, warn about this
 - improve date string handling by new function mandoc_a2time
 - some HTML improvements
 - significant documentation additions in man.7 and mdoc.7

portability:
 - replace __dead by __attribute__((noreturn))
 - bugfix: correct .Dx rendering
 - some more library names for NetBSD

simplicity:
 - replace hand-rolled putchar(3)-loops by fwrite(3)
 - replace single-character printf(3) by putchar(3)

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

sync to 1.9.12, mostly portability and refactoring:

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

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

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

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

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

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

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

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

Revision 1.60 / (download) - annotate - [select for diffs], Mon Oct 19 21:35:43 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +216 -244 lines
Diff to previous 1.59 (colored)

sync to 1.9.7: kristaps@ renamed part of the DECL_ARGS :-(
intricately mixed with three minor .Bd fixes

Revision 1.59 / (download) - annotate - [select for diffs], Mon Oct 19 16:51:08 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +3 -6 lines
Diff to previous 1.58 (colored)

sync to 1.9.6: minor fixes:
 * avoid blank character before the closing ">" of .In
 * .Bt can not have children

Revision 1.58 / (download) - annotate - [select for diffs], Mon Oct 19 16:27:52 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.57: +29 -9 lines
Diff to previous 1.57 (colored)

sync to 1.9.6: multiple improvements to references (.Rs)
 * validate and order .Rs child nodes
 * underline book title (.%B) and issuer (.%I)
 * enclose title of article (.%T) in quotes
 * avoid calling mdoc_verr directly, use a proper error code instead

Revision 1.57 / (download) - annotate - [select for diffs], Mon Oct 19 13:29:56 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored)

sync to 1.9.6: two newline fixes:
 * newline before .Rs  only below SEE ALSO
 * newline after  .Lb  only below LIBRARY

Revision 1.56 / (download) - annotate - [select for diffs], Mon Oct 19 09:41:22 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)

sync to 1.9.6: fix segfault in .Bl -column

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

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

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

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

Revision 1.53 / (download) - annotate - [select for diffs], Sat Aug 22 22:50:17 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +49 -27 lines
Diff to previous 1.52 (colored)

sync to 1.9.1: .Rv and .Ex accept multiple arguments

Revision 1.52 / (download) - annotate - [select for diffs], Sat Aug 22 18:40:00 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +11 -3 lines
Diff to previous 1.51 (colored)

sync to 1.9.0: like in groff, do not assert vspace between two .Sh macros
in case the first one has no body

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

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

Revision 1.50 / (download) - annotate - [select for diffs], Sat Aug 22 15:36:58 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

sync to 1.8.4: LLVM findings from <uqs at spoerlein dot net>

Revision 1.49 / (download) - annotate - [select for diffs], Sun Aug 9 21:59:41 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +63 -2 lines
Diff to previous 1.48 (colored)

sync to 1.8.4: full .An -[no]split support

Revision 1.48 / (download) - annotate - [select for diffs], Sun Aug 9 21:38:25 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +13 -28 lines
Diff to previous 1.47 (colored)

sync to 1.8.4: now that leading blanks in literal text are preserved,
.Bd printing can be simplified (and must be fixed)

Revision 1.47 / (download) - annotate - [select for diffs], Sun Aug 9 20:37:32 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +28 -6 lines
Diff to previous 1.46 (colored)

sync to 1.8.3: ugly fix for .Bl or .Bd when nested in .Bl -hang

Revision 1.46 / (download) - annotate - [select for diffs], Sun Aug 9 20:11:30 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +20 -4 lines
Diff to previous 1.45 (colored)

sync to 1.8.3: In .Bl -column, handle one column in excess,
but still issue a warning

Revision 1.45 / (download) - annotate - [select for diffs], Sun Aug 9 19:28:21 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.44: +51 -27 lines
Diff to previous 1.44 (colored)

sync to 1.8.3: bring vspace handling in .Bl -column and -diag closer to groff

Revision 1.44 / (download) - annotate - [select for diffs], Sun Aug 9 19:15:14 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +3 -4 lines
Diff to previous 1.43 (colored)

sync to 1.8.3: remove doubled .Bl -diag whitespace

Revision 1.43 / (download) - annotate - [select for diffs], Sun Aug 9 19:01:24 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +8 -1 lines
Diff to previous 1.42 (colored)

sync to 1.8.3: right-most column now fills to the right margin
(undocumented groff behaviour)

Revision 1.42 / (download) - annotate - [select for diffs], Sun Aug 9 18:43:28 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +10 -6 lines
Diff to previous 1.41 (colored)

multiple spacing fixes for .Bl -hang, -tag, -inset and -diag
ok kristaps@ and included in 1.8.3

Revision 1.41 / (download) - annotate - [select for diffs], Sun Aug 9 17:38:24 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +10 -2 lines
Diff to previous 1.40 (colored)

sync to 1.8.2: more .Bl -column fixes, in particular:
1) -column implies -compact
2) do not die from fewer columns than specified (more are still fatal)

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jul 26 23:39:54 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +1 -5 lines
Diff to previous 1.39 (colored)

sync to 1.8.1: remove superfluous NOSPACE in bd post,
and remove unused TERMP_LITERAL

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jul 26 23:32:26 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +8 -1 lines
Diff to previous 1.38 (colored)

sync to 1.8.1: add a comment explaining the non-trivial termpair semantics;
a bug in this very respect was contained in the upstream equivalent
of rev. 1.28, but was squashed while merging into OpenBSD

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jul 26 01:59:46 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +36 -1 lines
Diff to previous 1.37 (colored)

sync to 1.8.1: support .br and .sp

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jul 26 00:49:19 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +2 -4 lines
Diff to previous 1.36 (colored)

sync to 1.8.1: .Bl -diag lacked the second blank after the tag

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jul 25 23:29:15 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

sync to 1.8.1: fix date in footer; from Ulrich Sporlein

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jul 18 22:07:09 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +11 -21 lines
Diff to previous 1.34 (colored)

sync to 1.8.0: a couple of cosmetic fixes:
1) use \(hy instead of \- for .Bl -hyphen (renders the same in -Tascii)
2) clear bold flag after printing the -bullet or -hyphen in .Bl
   (actually, the flags will be reinitialized in termp_it_post, anyway)
3) do not redo the work of the parser in termp_rv_pre and termp_ex_pre
   (instead, just assert() validity of the parse tree)
4) do not bother assigning to the offset in termp_ss_post
   (it will soon be reinitialized in print_node, anyway)

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jul 18 21:16:49 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +28 -17 lines
Diff to previous 1.33 (colored)

sync to 1.8.0: support -offset [0-9]+n and -offset [0-9]+m
(not documented in mdoc.samples, but used in mdoc.samples)
while here, do some cleanup in arg_offset and arg_width

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 18 20:50:38 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +32 -11 lines
Diff to previous 1.32 (colored)

sync to 1.8.0: support .Bl -hang

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jul 18 19:44:38 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +4 -55 lines
Diff to previous 1.31 (colored)

sync to 1.8.0: move mdoc_a2att, mdoc_a2st, and mdoc_a2lib to libmdoc

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jul 18 19:13:44 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (colored)

sync to 1.8.0: for .Fo, do not print a blank before '('

Revision 1.30 / (download) - annotate - [select for diffs], Sat Jul 18 19:00:30 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.29: +6 -2 lines
Diff to previous 1.29 (colored)

sync to 1.8.0: two .Vd in SYNOPSIS get a line break in between,
but not a blank line; as before, the last .Vd in SYNOPSIS is still
followed by a blank line, and .Vd outside SYNOPSIS breaks no lines

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 18 18:46:42 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.28: +85 -73 lines
Diff to previous 1.28 (colored)

sync to 1.8.0: replace macro function declarations by real ones, and sort them

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jul 18 17:26:21 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +11 -21 lines
Diff to previous 1.27 (colored)

sync to 1.8.0: cleanup: remove offset and rmargin from termpair

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jul 18 17:11:44 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +38 -53 lines
Diff to previous 1.26 (colored)

sync to 1.8.0: remove ambiguous TERMPAIR_SETFLAG macro and set flags manually

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jul 18 16:38:10 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +35 -64 lines
Diff to previous 1.25 (colored)

sync to 1.8.0: consolidated Bsx, Dx, Fx, Nx, Ox, Ux into one common function

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jul 18 15:34:27 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +7 -8 lines
Diff to previous 1.24 (colored)

sync to 1.8.0: .Nd is now a BFI, was an ELEM,
and use \(en instead of \- for .Nd

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 13 00:26:24 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +10 -2 lines
Diff to previous 1.23 (colored)

sync to 1.7.24: In the .Nd line, \(em is typographically more sound than \- ,
so that's what e.g. NetBSD and FreeBSD do.  However, for *now*, we want to
stick with the exact behaviour of the in-tree groff in OpenBSD.
ok jmc@

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jul 12 23:19:48 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +14 -3 lines
Diff to previous 1.22 (colored)

sync to 1.7.24: make .In handling more similar to new groff

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jul 7 00:42:04 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +1 -5 lines
Diff to previous 1.21 (colored)

The word "indent" has a special meaning in ".Bd -tag -offset indent",
but *not* in ".Bd -tag -width indent", so in the latter case, it should
not be handled specially.
ok kristaps@ and jmc@  and contained in 1.7.22

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jul 6 23:37:27 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

sync to 1.7.21: increment offset by the value of .Bd -offset
instead of resetting it to the value;
no functional change, as currently offset is always 0 at this point,
but perhaps it's safer with respect to possible future changes

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 6 22:55:33 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

.Bd -offset indent-two is two times 6, not two times 5 spaces
ok kristaps@  and contained in 1.7.21

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jun 27 13:03:51 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.18: +5 -3 lines
Diff to previous 1.18 (colored)

sync to 1.7.20: minimum offset for .Bl -enum is 5 spaces, not 4

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jun 27 12:43:11 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

sync to 1.7.20: (1) -width Ds is 6 spaces, not 8, see the manual.
(2) When determining the offset, add two more spaces to the width.
For -width Ds, these two bugs cancelled each other,
but for -width [01-9]+n, they did not, leaving the offset to narrow.
(3) When determining the width using strlen,
we need to add two spaces instead of one, just like in the case (2).

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jun 27 12:04:45 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

sync to 1.7.20: .Bd -indent uses 6-space, not 5-space indent

Revision 1.16 / (download) - annotate - [select for diffs], Sat Jun 27 11:56:05 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

sync to 1.7.20: .Bl -diag get two spaces after the tag

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 27 11:49:37 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)

sync to 1.7.20: handle [01-9]+m -width specifiers

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 27 10:59:07 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +5 -3 lines
Diff to previous 1.13 (colored)

sync to 1.7.20: .D1 and .Dl use 6-space, not 5-space indent;
while here, a lint fix n lb_pre

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

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

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jun 21 19:53:47 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +8 -3 lines
Diff to previous 1.11 (colored)

sync to 1.7.19: proper font decorations for special and .It characters

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

sync to 1.7.19: improved comment handling

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jun 18 21:50:45 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +20 -18 lines
Diff to previous 1.9 (colored)

sync to 1.7.16: Moved MDOC_TEXT type checks into assertions (should be
caught by parser).  Added some FIXME notes in mdoc output (largely that
things should be asserted, not caught).

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

sync to 1.7.16: support .Bd -offset left

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

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

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

sync to 1.7.16: footer in new groff style

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

sync to 1.7.16: make a couple of macros callable, reserve "|",
and some tweaks to .Lk

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

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

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 15 02:53:35 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +5 -119 lines
Diff to previous 1.3 (colored)

sync to 1.7.16: an output function is the wrong place for validation code

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 15 01:07:46 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

sync to 1.7.16: adapt INDENT to groff conventions

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

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

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

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

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