OpenBSD CVS

CVS log for src/usr.bin/mandoc/term.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.78 / (download) - annotate - [select for diffs], Tue Aug 16 17:44:53 2022 UTC (21 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (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.77 / (download) - annotate - [select for diffs], Mon Aug 15 13:01:40 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (colored)

In GNU, Heirloom, and Plan 9 roff, tab positions apply to *input* lines,
not to *output* lines.  In particular, if an input line gets broken in
fill mode and a tab occurs in the second output line, it advances to a
position of at least (width of the first output line) + (width of a
space character even though this is never printed) + (width of the part
of the second output line that precedes the tab).

Implement the same logic in mandoc.

Again, do not use tabs in filled text: they have surprising effects,
including this one.

Revision 1.76 / (download) - annotate - [select for diffs], Mon Oct 4 18:56:24 2021 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.75: +2 -1 lines
Diff to previous 1.75 (colored)

Provide a cleanup function for the term_tab module, freeing memory
and resetting the internal state to the initial state.
Call this function from the proper place in term_free().

With the way the module is currently used, this does not imply any
functional change, but doing proper cleanup is more robust, makes
it easier during code review to understand what is going on, and
makes it explicit that there is no memory leak.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jan 4 03:20:44 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: 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, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.74: +4 -2 lines
Diff to previous 1.74 (colored)

Implement centering and adjustment to the right margin directly in
the terminal filling routine, controlled by new flags TERMP_CENTER
and TERMP_RIGHT.
This became possible by the recent term_flushln() rewrite.
No functional change yet, but to be used by upcoming commits.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Jul 8 14:51:01 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Jun 17 14:55:02 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

tables leak tab settings to subsequent text

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

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

Revision 1.71 / (download) - annotate - [select for diffs], Mon Jun 12 18:55:42 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +4 -2 lines
Diff to previous 1.70 (colored)

Implement automatic line breaking
inside individual table cells that contain text blocks.
This cures overlong lines in various Xenocara manuals.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jun 7 20:01:07 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.69: +4 -2 lines
Diff to previous 1.69 (colored)

Prepare the terminal driver for filling multiple columns in parallel,
second step: make the per-column byte pointer persistent across
term_flushln() calls, such that a subsequent call can continue at
the point where the previous call left.  If more than one column
is in use, return from term_flushln() when the column is full,
rather than breaking the output line.

No functional change, because nothing sets up multiple columns yet.

Revision 1.69 / (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.68: +15 -9 lines
Diff to previous 1.68 (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.68 / (download) - annotate - [select for diffs], Wed Jun 7 02:13:52 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +3 -2 lines
Diff to previous 1.67 (colored)

The \h escape sequence provides another method for moving backwards,
and after that, previously written output gets overwritten, but
overwriting with blanks does *not* erase previously written content.
Yes, manual pages exist that are crazy enough to rely on that...

Revision 1.67 / (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.66: +6 -3 lines
Diff to previous 1.66 (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.66 / (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.65: +4 -4 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Mon May 8 15:33:43 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

Basic implementation of the roff(7) .ti (temporary indent) request.
Needed by about four dozen ports (thanks to naddy@ for the research).

Revision 1.64 / (download) - annotate - [select for diffs], Sun May 7 17:30:58 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.63: +4 -2 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Thu May 4 22:07:44 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.62: +7 -5 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Sat Nov 7 13:57:55 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.61: +1 -4 lines
Diff to previous 1.61 (colored)

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.

Revision 1.61 / (download) - annotate - [select for diffs], Tue Oct 13 22:57:49 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +1 -2 lines
Diff to previous 1.60 (colored)

Major character table cleanup:
* Use ohash(3) rather than a hand-rolled hash table.
* Make the character table static in the chars.c module:
There is no need to pass a pointer around, we most certainly
never want to use two different character tables concurrently.
* No need to keep the characters in a separate file chars.in;
that merely encourages downstream porters to mess with them.
* Sort the characters to agree with the mandoc_chars(7) manual page.
* Specify Unicode codepoints in hex, not decimal (that's the detail
that originally triggered this patch).
No functional change, minus 100 LOC, and i don't see a performance change.

Revision 1.60 / (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.59: +8 -7 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Fri Jul 17 22:35:36 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Wed Apr 29 18:32:57 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.57: +9 -8 lines
Diff to previous 1.57 (colored)

Replace the kludge for the \z escape sequence by an actual
implementation.  As a side effect, minus ten lines of code.

As another side effect, this also fixes the assertion failure that
used to be triggered by "\z\o'ab'c" at the beginning of an output
line, found by jsg@ with afl (test case 022/Apr27).

Revision 1.57 / (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.56: +3 -3 lines
Diff to previous 1.56 (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.56 / (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.55: +7 -6 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Sat Jan 31 00:11:52 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.54: +2 -3 lines
Diff to previous 1.54 (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.54 / (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.53: +3 -5 lines
Diff to previous 1.53 (colored)

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

Revision 1.53 / (download) - annotate - [select for diffs], Fri Dec 19 17:10:42 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

Enforcing an arbitrary, implementation dependent, undocumented limit
by calling assert() when valid user input exceeds it is a bad idea.
Allocate the terminal font stack dynamically instead of crashing
above 10 entries.  Issue found by jsg@ with afl.

Revision 1.52 / (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.51: +2 -1 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Mon Dec 1 08:05:02 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +8 -4 lines
Diff to previous 1.50 (colored)

header cleanup:
* add missing forward declarations
* remove needless header inclusions
* some style unification

Revision 1.50 / (download) - annotate - [select for diffs], Thu Nov 27 14:31:29 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.49: +1 -6 lines
Diff to previous 1.49 (colored)

remove unneccessary inclusion protection; ok schwarze

Revision 1.49 / (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.48: +2 -2 lines
Diff to previous 1.48 (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.48 / (download) - annotate - [select for diffs], Sun Oct 26 17:11:18 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

Improve -Tascii output for Unicode escape sequences: For the first 512
code points, provide ASCII approximations.  This is already much better
than what groff does, which prints nothing for most code points.

A few minor fixes while here:
* Handle Unicode escape sequences in the ASCII range.
* In case of errors, use the REPLACEMENT CHARACTER U+FFFD for -Tutf8
and the string "<?>" for -Tascii output.
* Handle all one-character escape sequences in mchars_spec2{cp,str}()
and remove the workarounds on the higher level.

Revision 1.47 / (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.46: +3 -4 lines
Diff to previous 1.46 (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.46 / (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.45: +2 -1 lines
Diff to previous 1.45 (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.45 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (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.44 / (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.43: +7 -6 lines
Diff to previous 1.43 (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.43 / (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.42: +3 -3 lines
Diff to previous 1.42 (colored)

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

Revision 1.42 / (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.41: +5 -2 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Wed Dec 25 00:39:13 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (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.40 / (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.39: +8 -9 lines
Diff to previous 1.39 (colored)

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

Revision 1.39 / (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.38: +3 -2 lines
Diff to previous 1.38 (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.38 / (download) - annotate - [select for diffs], Wed Aug 21 21:19:47 2013 UTC (10 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Move the last column-counting members of struct termp (col and maxcols)
from int to size_t, to match some existing ones (offset, *rmargin, viscol).
Move some related local variables from int to size_t as well.

Needed as a preparation to make a generalized adjbuf() function available
beyond the file term.c, i.e. in mandoc.c.
Also saves a couple of ugly casts.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Aug 8 20:07:24 2013 UTC (10 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

Implement the roff(7) font-escape sequence \f(BI "bold+italic".
This improves the formatting of about 40 base manuals
and reduces groff-mandoc formatting differences in base by about 5%.

Revision 1.36 / (download) - annotate - [select for diffs], Mon May 28 13:00:51 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

Implement the roff \z escape sequence, intended to output the next
character without advancing the cursor position; implement it to
simply skip the next character, as it will usually be overwritten.

With this change, the pod2man(1) preamble user-defined string \*:,
intended to render as a diaeresis or umlaut diacritic above the
preceding character, is rendered in a slightly less ugly way,
though still not correctly.  It was rendered as "z.." and is now
rendered as ".".

Given that the definition of \*: uses elaborate manual \h positioning,
there is little chance for mandoc(1) to ever render it correctly,
but at least we can refrain from printing out a spurious "z", and
we can make the \z do something semi-reasonable for easier cases.

Revision 1.35 / (download) - annotate - [select for diffs], Sun May 27 01:01:24 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

Fix the vertical spacing around tbl(7) instances in man(7).

Groff forces the document author to manually request sufficient spacing
after .TE - that is, at least .sp 1v after a table with the "box" option
and at least .sp 2v after a table with the "doublebox" option - or else
it clobbers the box.  I consider that insane, so i'm not imitating groff
in that respect.  Instead, i add at least as much vertical space as groff,
or more where required to avoid clobbering the box.

Consequently, output will be identical for input that looks sane with
groff, and mandoc will make output look better for input that looks bad
with groff.

As a side effect, having identical output for portable input
makes it possible to set up the first regression tests for tbl(7).

Revision 1.34 / (download) - annotate - [select for diffs], Sun Nov 13 13:30:42 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

Support -man -Omdoc to format man(7) manuals in mdoc(7) output style;
so far, this is only accepting the option,
i will commit the (few) formatting tweaks separately.

This is intentionally undocumented for two reasons:
(1) We dream of making it the default at some point, so the option
    will hopefully go away again.
(2) It is not needed for production, but mostly for automated man(7)
    to mdoc(7) output comparisons, to help -Tman development.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Nov 13 13:05:23 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (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.32 / (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.31: +1 -2 lines
Diff to previous 1.31 (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.31 / (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.30: +2 -1 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Sun May 29 21:22:18 2011 UTC (12 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.29: +11 -41 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Sun Jan 9 14:30:48 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Sync tbl handling to bsd.lv release 1.10.9:
* .T} can be followed by a delimiter, then more data.
* Do not limit table column widths (improves terminfo(5)).
* Let numerical cells respect explicitly specified minimum cell widths.
* Let terminal output survive missing data cells.
* Parse and ignore arguments in parentheses on layout cell specifications.
* Move tbl_calc() into out.c such that it can be used by all frontends.
* Give tables an HTML class.
* Some cleanup in tbl -Thtml code.
All code by kristaps@.

Revision 1.28 / (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.27: +10 -3 lines
Diff to previous 1.27 (colored)

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

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jul 31 21:43:07 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.26: +6 -4 lines
Diff to previous 1.26 (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.26 / (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.25: +6 -2 lines
Diff to previous 1.25 (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.25 / (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.24: +17 -13 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Tue Jun 29 14:41:28 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +15 -6 lines
Diff to previous 1.23 (colored)

framework for glyph width encoding; from kristaps@

Revision 1.23 / (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.22: +3 -1 lines
Diff to previous 1.22 (colored)

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

Revision 1.22 / (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.21: +8 -3 lines
Diff to previous 1.21 (colored)

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

Revision 1.21 / (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.20: +4 -2 lines
Diff to previous 1.20 (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.20 / (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.19: +39 -1 lines
Diff to previous 1.19 (colored)

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

Revision 1.19 / (download) - annotate - [select for diffs], Sat May 15 21:09:53 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (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.18 / (download) - annotate - [select for diffs], Fri May 14 19:52:43 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Fri May 14 14:47:44 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.16: +3 -1 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Fri Apr 23 00:23:47 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Tue Apr 13 22:41:48 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

Fix rendering of multiple successive .It macros without intervening text;
another problem reported by jmc@.

The physical output line may contain output from more than one buffer.
Thus, to decide whether a line break is needed, it's insufficient to
only look at the number of bytes in the current output buffer.
Keep track of the number of characters already written, too.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Mar 26 01:22:07 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Thu Dec 24 02:08:14 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.12: +18 -3 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Wed Oct 21 19:13:51 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +4 -1 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Mon Oct 19 09:16:58 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +2 -9 lines
Diff to previous 1.10 (colored)

sync to 1.9.5: partial rewrite of special character and predefined string
tables and the supporting infrastructure, mostly in preparation for
HTML output support

Revision 1.10 / (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.9: +3 -4 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Sat Aug 22 18:10:02 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +1 -6 lines
Diff to previous 1.8 (colored)

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

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

sync to 1.8.5: partial rewrite of the handling of escape sequences:
distinguish special characters and predefined strings,
and add and fix several escape sequences

Revision 1.7 / (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.6: +4 -1 lines
Diff to previous 1.6 (colored)

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

Revision 1.6 / (download) - annotate - [select for diffs], Sun Aug 9 18:43:29 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

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

Revision 1.5 / (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.4: +5 -6 lines
Diff to previous 1.4 (colored)

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

Revision 1.4 / (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.3: +12 -11 lines
Diff to previous 1.3 (colored)

sync to 1.8.0: support .Bl -hang

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
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.2: +2 -1 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: +11 -13 lines
Diff to previous 1.1 (colored)

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

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

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

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