OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.66 / (download) - annotate - [select for diffs], Sun Aug 28 10:57:52 2022 UTC (20 months, 3 weeks 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.65: +3 -7 lines
Diff to previous 1.65 (colored)

Stop skipping vertical space after boxed tables.

Skipping such space used to be a bug in GNU tbl(1), and a kludge
was added to mandoc to produce identical output.
The bug was fixed in groff commit 8818c07c Jul 30 2022 gbranden@
https://savannah.gnu.org/bugs/index.php?49390

Consequently, now is the time to get rid of the kludge.

Revision 1.65 / (download) - annotate - [select for diffs], Tue Apr 26 14:46:30 2022 UTC (2 years ago) by schwarze
Branch: MAIN
Changes since 1.64: +3 -2 lines
Diff to previous 1.64 (colored)

At the end of every tbl(7) cell, clear the \z state.
This is needed because the TERMP_MULTICOL mode is designed such
that term_tbl() buffers all the cells of the table row before the
normal reset logic near the end of term_flushln() can be reached.

This fixes an assertion failure triggered by \z near the end
of a table cell, found by tb@ using afl(1).

Revision 1.64 / (download) - annotate - [select for diffs], Fri Apr 8 16:53:40 2022 UTC (2 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.63: +6 -3 lines
Diff to previous 1.63 (colored)

When calculating the with of spanned columns, which for example matters
for centering text spanning multiple tbl(7) columns, correctly account
for the spacing between columns instead of wrongly assuming the default
spacing of 3n.

Patch from Simon Branch <simonmbranch at gmail dot com>.

Revision 1.63 / (download) - annotate - [select for diffs], Tue Aug 10 12:36:42 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.62: +20 -6 lines
Diff to previous 1.62 (colored)

Support two-character font names (BI, CW, CR, CB, CI)
in the tbl(7) layout font modifier.

Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use
the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead,
which simplifies and unifies some code.

While here, also support CB and CI in roff(7) \f escape sequences
and in roff(7) .ft requests for all output modes.  Using those is
certainly not recommended because portability is limited even with
groff, but supporting them makes some existing third-party manual
pages look better, in particular in HTML output mode.

Bug-compatible with groff as far as i'm aware, except that i consider
font names starting with the '\n' (ASCII 0x0a line feed) character
so insane that i decided to not support them.

Missing feature reported by nabijaczleweli dot xyz in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002.
I used none of the code from the initial patch submitted by
nabijaczleweli, but some of their ideas.
Final patch tested by them, too.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Oct 25 18:21:07 2020 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.61: +1 -12 lines
Diff to previous 1.61 (colored)

The GNU tbl(1) program contained in the groff package internally
uses roff(7) tabulator settings to implement tables, and it used
to leak the changed tabulator settings from tables to the subsequent
roff(7) code.  In mandoc/tbl_term.c rev. 1.42 (June 17, 2017), code
was added to be bug-compatible with groff.

In commit d0e03cf6 (Oct 20, 2020), GNU tbl(1) changed behaviour
to save the tabulator settings before starting a table and restore
them afterwards.  Adjust mandoc for compatibility.

Since mandoc implements tables without using roff(7) tabulator
settings, saving and restoring tabulator settings is not needed in
mandoc.  Simply deleting the code that changed tabulator settings
by reverting tbl_term.c rev. 1.42 is sufficient in mandoc.
Also adjust the desired output of the regression tests
to match the new behaviour of both groff and mandoc.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jan 11 16:24:33 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.60: +13 -14 lines
Diff to previous 1.60 (colored)

Fix a logic error:
When both the first and the third column are spans, do not use
the number of columns of the span starting in column two
for the span starting in column zero.

With afl, Jan Schreiber <jes at posteo dot de> found cases where
this caused NULL pointer accesses because too many layout cells
were consumed.

While here, make the code more similar at the three places
that iterate over data cells.

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

delete trailing whitespace and space-tab sequences; no code change;
patch from Michal Nowak <mnowak at startmail dot com>
who found these with git pbchk in the illumos tree

Revision 1.59 / (download) - annotate - [select for diffs], Tue Jun 11 15:40:41 2019 UTC (4 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +11 -5 lines
Diff to previous 1.58 (colored)

Do not access a NULL pointer if a table contains a horizontal line
next to a table line having fewer columns than the table as a whole.
Bug found by Stephen Gregoratto <dev at sgregoratto dot me>
with aerc-config(5).

Revision 1.58 / (download) - annotate - [select for diffs], Mon Mar 18 08:00:26 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.57: +5 -3 lines
Diff to previous 1.57 (colored)

fix a NULL pointer access on empty tbl(7) data cells
that bentley@ found in syncthing-bep(7)

Revision 1.57 / (download) - annotate - [select for diffs], Sat Mar 16 21:35:11 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +18 -13 lines
Diff to previous 1.56 (colored)

When drawing a horizontal line in tbl(7) UTF-8 output, it is not
sufficient to look at two data rows, but up to three are needed:
the one above to identify vertical lines branching off upward, the
row itself (in case the line is in a data row rather than a layout
line) to figure out the horizontal line style, and the row below
to identify vertical lines branching off downward.

As an example, bentley@ reported from the mpv(1) manual page that
in a tbl(7) having a vertical line in the middle and a horizontal
line in the bottom data row, the vertical line extended below the
bottom horizontal line.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Feb 9 21:01:24 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +45 -48 lines
Diff to previous 1.55 (colored)

The horizontal line in a data cell containing only "_" or "="
connects to the horizontally adjacent vertical line or cell;
fixing a bug reported by bentley@.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jan 31 16:06:13 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +8 -4 lines
Diff to previous 1.54 (colored)

Fix tbl(7) centering in mdoc(7) documents.

Since resetting of offsets works quite differently in the mdoc(7)
and man(7) formatters, the tbl(7) formatter needs to save the global
offset on entry and restore it on exit.  The additional indentation
needed for table centering has to be added to its own offset variable
and applied to each line of the table, rather than only to the first.

Bug found by bentley@ in emulators/fceux(6).

Revision 1.54 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:30 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +2 -1 lines
Diff to previous 1.53 (colored)

Cleanup, no functional change:
No need to expose the tbl(7) syntax tree data structures everywhere.
Move them to their own include file, "tbl.h", and improve comments.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Nov 29 23:08:08 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +19 -5 lines
Diff to previous 1.52 (colored)

Do not draw horizontal lines through vertical spans
which are requested in the data section rather than in the layout.
Mini-feature found in misc/pfm(1).

Revision 1.52 / (download) - annotate - [select for diffs], Thu Nov 29 21:40:08 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +106 -72 lines
Diff to previous 1.51 (colored)

Now that it is better understood how borders work,
rewrite tbl_hrule() in a simpler way.
Fix several bugs in the process.

No more special flags, just use the existing TBL_OPT_* from mandoc.h.
Reduce the number of tracked rows from three to two, which is more logical:
one above the line and one below is sufficient to figure out crossings.
No more magic quirks, all conditions are readily comprehensible now.
Add comments.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Nov 28 13:43:26 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +8 -5 lines
Diff to previous 1.50 (colored)

additional check needed after the previous (box drawing) patch

Revision 1.50 / (download) - annotate - [select for diffs], Wed Nov 28 04:47:46 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +318 -151 lines
Diff to previous 1.49 (colored)

In -T utf8 output mode, render tbl(7) borders with the Unicode
box drawing characters, U+2500 to U+257F.

Originally suggested by bentley@ four years ago,
reminded this summer by Pali Rohar.

Binary and decimal arithmetics are boring,
so let's use some ternary arithmetics for a change.

That said, some other aspects are too complicated for my liking,
so this could use some polishing in the future.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Nov 25 19:23:59 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +18 -18 lines
Diff to previous 1.48 (colored)

In tbl(7) -T html output,
span cells horizontally and vertically as requested by the layout.
Does not handle spans requested in the data section yet.

To be able to do this, record the number of rows spanned
in the first data cell (struct tbl_dat) of a vertical span.

Missing feature reported by Pali dot Rohar at gmail dot com.

Revision 1.48 / (download) - annotate - [select for diffs], Sun Aug 19 23:10:16 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.47: +52 -27 lines
Diff to previous 1.47 (colored)

Do alignment of non-numeric strings in numeric cells the same way
as groff, and also honour the explicit alignment indicator "\&".
This required an almost complete rewrite of both the measurement
function and the formatter function for numeric cells.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Aug 19 19:32:17 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +21 -7 lines
Diff to previous 1.46 (colored)

do not print horizontal lines inside vertical spans

Revision 1.46 / (download) - annotate - [select for diffs], Sat Aug 18 16:44:52 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +5 -7 lines
Diff to previous 1.45 (colored)

Do not allocate a column for decimal points if all numbers are integers.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jul 31 16:14:04 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.44: +5 -2 lines
Diff to previous 1.44 (colored)

Ignore explicitly specified negative column widths rather than
wrapping around to huge numbers and risking memory exhaustion;
fixes Debian ps(1).  Bug reported by Dr. Markus Waldeck.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jul 8 13:43:09 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +10 -9 lines
Diff to previous 1.43 (colored)

Correctly handle horizontal spans at the beginning of rows,
fixing an assertion failure found by jsg@ with afl(1).

While here, also drop printing of whitespace in tbl_data()
which makes no difference because column positioning code
in term_tbl() already takes care of that.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jun 27 18:23:29 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +28 -21 lines
Diff to previous 1.42 (colored)

Implement spacing of columns as defined in the table layout;
this is for example used by lftp(1)
and, ironically, misused by our very own tbl(7) manual...

Revision 1.42 / (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.41: +12 -1 lines
Diff to previous 1.41 (colored)

tables leak tab settings to subsequent text

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jun 16 20:00:41 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +176 -63 lines
Diff to previous 1.40 (colored)

Multiple tbl(7) improvements:
* Do not discard data that lacks a matching layout cell but remains
within the number of columns of the table as a whole.
* Do not insert dummy data rows for any layout row starting with a
horizontal line, but only for layout rows that would discard all
the data on a matching non-empty data row.
* Print horizontal lines specified in the layout even if there is
no matching data cell.
* Improve the logic for extending vertical lines to adjacent rows,
for choosing cross marks versus line segments, and some related details.

Revision 1.40 / (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.39: +2 -2 lines
Diff to previous 1.39 (colored)

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

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jun 13 14:38:38 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +32 -17 lines
Diff to previous 1.38 (colored)

fix the interaction of the allbox option with spanned cells in the layout

Revision 1.38 / (download) - annotate - [select for diffs], Mon Jun 12 22:48:52 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +6 -3 lines
Diff to previous 1.37 (colored)

Two minor fixes for the "allbox" modifier:
1. It does not reduce explicit "||" in the layout to "|".
2. It does not cause three horizontal lines at the end of a table,
even if the table ends with an explicit "_" data line.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jun 12 20:44:57 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +8 -2 lines
Diff to previous 1.36 (colored)

implement the tbl(7) "allbox" option;
used for example by curs_getch(3) and GLwDrawingArea(3)

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jun 12 20:14:03 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

fix column width calculation for text block cells

Revision 1.35 / (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.34: +163 -63 lines
Diff to previous 1.34 (colored)

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

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jun 8 18:11:15 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +9 -3 lines
Diff to previous 1.33 (colored)

Implement w layout specifier (minimum column width).
Improve width calculation of text blocks.
Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.

Revision 1.33 / (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.32: +7 -7 lines
Diff to previous 1.32 (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.32 / (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.31: +9 -18 lines
Diff to previous 1.31 (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.31 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 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.30: +1 -6 lines
Diff to previous 1.30 (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.30 / (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.29: +3 -3 lines
Diff to previous 1.29 (colored)

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

Revision 1.29 / (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.28: +1 -2 lines
Diff to previous 1.28 (colored)

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

Revision 1.28 / (download) - annotate - [select for diffs], Mon Mar 9 17:41:36 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.27: +1 -4 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Mon Mar 9 17:30:29 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +4 -3 lines
Diff to previous 1.26 (colored)

Flush the line preceding a table before clearing the right margin,
such that that line isn't output with unlimited width.
Problem reported and fix OK by kristaps@.

Revision 1.26 / (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.25: +3 -3 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Fri Jan 30 17:31:20 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

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

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 30 04:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +16 -21 lines
Diff to previous 1.23 (colored)

Abolish struct tbl_head and replace it by an "int col" member in
struct tbl_cell.  No functional change, minus 40 lines of code.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jan 30 02:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +3 -5 lines
Diff to previous 1.22 (colored)

Auditing the tbl(7) code for more NULL pointer accesses, i came out
empty-handed; so this is just KNF and some code simplifications,
no functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jan 28 04:18:31 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +19 -3 lines
Diff to previous 1.21 (colored)

implement the tbl(7) "center" layout option

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jan 27 05:20:30 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +97 -124 lines
Diff to previous 1.20 (colored)

Multiple parser and formatter fixes for line drawing in tbl(7).
* Allow mixing vertical line bars with the layout options
of the preceding layout cell.
* Correctly combine box options with layout lines.
* Correctly print vertical lines in data rows, with the right spacing.
* Correctly print cross markers and left and right ends of
horizontal lines even if vertical lines differ above and below.
* Avoid the bogus error message "no table data cells"
when a table data section starts with a horizontal line.
No increase in code size.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Dec 24 15:37:23 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +8 -4 lines
Diff to previous 1.19 (colored)

Prevent unsigned integer underflow when a number is too wide
for a table cell with an "nz" layout specification,
causing essentially infinite output as found by jsg@ with afl.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Oct 14 18:16:57 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

even if a table has zero columns, do not segfault in the formatter;
bug reported by bentley@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Oct 14 02:16:02 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Rudimentary implementation of the e, x, and z table layout modifiers
to equalize, maximize, and ignore the width of columns.
Does not yet take vertical rulers into account,
and does not do line breaks within table cells.
Considerably improves the lftp(1) manual; issue noticed by sthen@.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Oct 13 23:31:26 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +21 -3 lines
Diff to previous 1.16 (colored)

implement font modifiers in table layouts

Revision 1.16 / (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.15: +33 -33 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Fri Mar 28 23:25:54 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.14: +6 -4 lines
Diff to previous 1.14 (colored)

Allow leading and trailing vertical lines,
and format them in the same way as groff.
While here, do not require whitespace before vertical lines
in layout specifications.
Issues found by bentley@ in mpv(1).

Revision 1.14 / (download) - annotate - [select for diffs], Fri May 31 21:37:09 2013 UTC (10 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.13: +17 -17 lines
Diff to previous 1.13 (colored)

The name "struct tbl" was badly misleading for two reasons:
1) This struct almost exclusively contains the table options.
2) Information about the table as a whole is actually in "struct tbl_node".
Besides, "struct tbl" was almost impossible to search for.
So rename it to "struct tbl_opts".  No functional change.

Revision 1.13 / (download) - annotate - [select for diffs], Sun May 27 01:01:24 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.12: +7 -3 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Sat May 26 20:53:17 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +12 -4 lines
Diff to previous 1.11 (colored)

Correct width of horizontal spans; relevant in case of centered or
flush right text, for boxes, and when more columns follow the span.

Issue found by sthen@ in the net/arp-scan(1) port manual.

Revision 1.11 / (download) - annotate - [select for diffs], Sat May 26 20:03:34 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +28 -60 lines
Diff to previous 1.10 (colored)

Do not handle vertical lines as additional tbl(7) columns,
instead save their properties with the following column.
This simplifies layout parsing and saves a lot of code
related to column handling.

At output time, print all white space and vertical lines
separating columns before printing the following column,
and none after printing the preceding column, considerably
simplifying white space handling and width calculations.

No functional change, but it saves 150 lines of code,
and it allows the next patch to tbl_term.c, tbl_literal().

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 20 23:05:46 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.9: +101 -96 lines
Diff to previous 1.9 (colored)

Major rewrite of the horizontal spacing of tables
to work both with and without frames and rulers.
Started during BSDCan 2011 in Ottawa, finished during s2k11 in Ljubljana.
ok kristaps@

Revision 1.9 / (download) - annotate - [select for diffs], Sun Sep 18 15:54:48 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

sync to version 1.11.7 from kristaps@
main new feature: support the roff(7) .tr request
plus various bugfixes and some refactoring

regressions are so minor that it's better to get this in
and fix them in the tree

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jan 25 12:07:26 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.7: +10 -7 lines
Diff to previous 1.7 (colored)

correct horizontal spacing of data cells
correct alignment of centered cells
adjust horizontal rule width to the new spacing
ok kristaps@

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jan 16 01:11:50 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +39 -25 lines
Diff to previous 1.6 (colored)

Various tbl improvements from kristaps@:
* horizontal lines do not consume layout lines
* skip excessive data cells
* prepare rendering of spanned cells
* support vertical spans

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jan 9 14:30:48 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +108 -255 lines
Diff to previous 1.5 (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.5 / (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.4: +362 -321 lines
Diff to previous 1.4 (colored)

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

Revision 1.4 / (download) - annotate - [select for diffs], Fri Oct 15 22:16:51 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +6 -1 lines
Diff to previous 1.3 (colored)

Do not crash on spanned headings.
This doesn't give us nice column widths yet with spanned headings, but
it helps mkhybrid(8) to survive the build and produce complete output.
"move forward" deraadt@

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

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

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

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

Revision 1.1 / (download) - annotate - [select for diffs], Fri Oct 15 19:20:03 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN

Import tbl parser and renderer written by kristaps@.
Unchanged code from bsd.lv release 0.1.5, but without the main program.
Not yet linked to the build; next commit will integrate it into mandoc.

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.