CVS log for mandoc/tbl_term.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.79 / (download) - annotate - [select for diffs], Sun Aug 28 10:58:31 2022 UTC (19 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.78: +3 -7 lines
Diff to previous 1.78 (colored) to selected 1.17 (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.78 / (download) - annotate - [select for diffs], Tue Apr 26 14:52:05 2022 UTC (23 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (colored) to selected 1.17 (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.77 / (download) - annotate - [select for diffs], Thu Apr 14 16:43:44 2022 UTC (23 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.76: +5 -2 lines
Diff to previous 1.76 (colored) to selected 1.17 (colored)

support for hunting memory leaks;
designed and written last autumn, polished today

Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 8 16:53:45 2022 UTC (23 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.75: +6 -3 lines
Diff to previous 1.75 (colored) to selected 1.17 (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.75 / (download) - annotate - [select for diffs], Tue Aug 10 12:55:04 2021 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.74: +20 -6 lines
Diff to previous 1.74 (colored) to selected 1.17 (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.74 / (download) - annotate - [select for diffs], Sun Oct 25 18:28:23 2020 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.73: +1 -12 lines
Diff to previous 1.73 (colored) to selected 1.17 (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.54 (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.54 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.73 / (download) - annotate - [select for diffs], Sat Jan 11 16:26:08 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +13 -14 lines
Diff to previous 1.72 (colored) to selected 1.17 (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.72 / (download) - annotate - [select for diffs], Mon Jul 1 22:56:24 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored) to selected 1.17 (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.71 / (download) - annotate - [select for diffs], Tue Jun 11 16:04:36 2019 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +11 -5 lines
Diff to previous 1.70 (colored) to selected 1.17 (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.70 / (download) - annotate - [select for diffs], Mon Mar 18 08:00:34 2019 UTC (5 years ago) by schwarze
Branch: MAIN
Changes since 1.69: +5 -3 lines
Diff to previous 1.69 (colored) to selected 1.17 (colored)

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

Revision 1.69 / (download) - annotate - [select for diffs], Sat Mar 16 21:35:48 2019 UTC (5 years ago) by schwarze
Branch: MAIN
Changes since 1.68: +18 -13 lines
Diff to previous 1.68 (colored) to selected 1.17 (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.68 / (download) - annotate - [select for diffs], Sat Feb 9 21:02:47 2019 UTC (5 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.67: +45 -48 lines
Diff to previous 1.67 (colored) to selected 1.17 (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.67 / (download) - annotate - [select for diffs], Thu Jan 31 16:06:22 2019 UTC (5 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.66: +8 -4 lines
Diff to previous 1.66 (colored) to selected 1.17 (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.66 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:35 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored) to selected 1.17 (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.65 / (download) - annotate - [select for diffs], Thu Nov 29 23:08:13 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +19 -5 lines
Diff to previous 1.64 (colored) to selected 1.17 (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.64 / (download) - annotate - [select for diffs], Thu Nov 29 21:40:53 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +106 -72 lines
Diff to previous 1.63 (colored) to selected 1.17 (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.63 / (download) - annotate - [select for diffs], Wed Nov 28 13:43:54 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +8 -5 lines
Diff to previous 1.62 (colored) to selected 1.17 (colored)

additional check needed after the previous (box drawing) patch

Revision 1.62 / (download) - annotate - [select for diffs], Wed Nov 28 04:47:51 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +318 -151 lines
Diff to previous 1.61 (colored) to selected 1.17 (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.61 / (download) - annotate - [select for diffs], Sun Nov 25 19:24:20 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +18 -18 lines
Diff to previous 1.60 (colored) to selected 1.17 (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.60 / (download) - annotate - [select for diffs], Sun Aug 19 23:10:28 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +52 -27 lines
Diff to previous 1.59 (colored) to selected 1.17 (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.59 / (download) - annotate - [select for diffs], Sun Aug 19 19:32:21 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +21 -7 lines
Diff to previous 1.58 (colored) to selected 1.17 (colored)

do not print horizontal lines inside vertical spans

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

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

Revision 1.57 / (download) - annotate - [select for diffs], Mon Jul 31 16:14:10 2017 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored) to selected 1.17 (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.56 / (download) - annotate - [select for diffs], Sat Jul 8 13:43:15 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_2
Changes since 1.55: +10 -9 lines
Diff to previous 1.55 (colored) to selected 1.17 (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.55 / (download) - annotate - [select for diffs], Tue Jun 27 18:25:02 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +28 -21 lines
Diff to previous 1.54 (colored) to selected 1.17 (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.54 / (download) - annotate - [select for diffs], Sat Jun 17 14:55:30 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +12 -1 lines
Diff to previous 1.53 (colored) to selected 1.17 (colored)

tables leak tab settings to subsequent text

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jun 16 20:01:06 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +176 -63 lines
Diff to previous 1.52 (colored) to selected 1.17 (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.52 / (download) - annotate - [select for diffs], Wed Jun 14 17:51:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored) to selected 1.17 (colored)

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

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jun 13 14:39:13 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +32 -17 lines
Diff to previous 1.50 (colored) to selected 1.17 (colored)

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

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jun 12 22:49:16 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +6 -3 lines
Diff to previous 1.49 (colored) to selected 1.17 (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.49 / (download) - annotate - [select for diffs], Mon Jun 12 20:45:18 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +8 -2 lines
Diff to previous 1.48 (colored) to selected 1.17 (colored)

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

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jun 12 20:14:18 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored) to selected 1.17 (colored)

fix column width calculation for text block cells

Revision 1.47 / (download) - annotate - [select for diffs], Mon Jun 12 19:05:47 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +163 -63 lines
Diff to previous 1.46 (colored) to selected 1.17 (colored)

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

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jun 8 18:11:22 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +9 -3 lines
Diff to previous 1.45 (colored) to selected 1.17 (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.45 / (download) - annotate - [select for diffs], Wed Jun 7 17:38:26 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.44: +7 -7 lines
Diff to previous 1.44 (colored) to selected 1.17 (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.44 / (download) - annotate - [select for diffs], Sun Jun 4 22:44:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +9 -18 lines
Diff to previous 1.43 (colored) to selected 1.17 (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.43 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:16 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13_4, VERSION_1_13
Changes since 1.42: +1 -6 lines
Diff to previous 1.42 (colored) to selected 1.17 (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.42 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:20 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored) to selected 1.17 (colored)

modernize style: "return" is not a function

Revision 1.41 / (download) - annotate - [select for diffs], Sat Sep 26 00:54:04 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +1 -2 lines
Diff to previous 1.40 (colored) to selected 1.17 (colored)

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

Revision 1.40 / (download) - annotate - [select for diffs], Fri Mar 6 15:48:53 2015 UTC (9 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.39: +1 -4 lines
Diff to previous 1.39 (colored) to selected 1.17 (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.39 / (download) - annotate - [select for diffs], Fri Mar 6 11:03:03 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.38: +4 -3 lines
Diff to previous 1.38 (colored) to selected 1.17 (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.38 / (download) - annotate - [select for diffs], Sat Jan 31 00:12:41 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored) to selected 1.17 (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.37 / (download) - annotate - [select for diffs], Fri Jan 30 17:32:16 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored) to selected 1.17 (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.36 / (download) - annotate - [select for diffs], Fri Jan 30 04:11:50 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.35: +16 -21 lines
Diff to previous 1.35 (colored) to selected 1.17 (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.35 / (download) - annotate - [select for diffs], Fri Jan 30 02:09:04 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.34: +3 -5 lines
Diff to previous 1.34 (colored) to selected 1.17 (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.34 / (download) - annotate - [select for diffs], Wed Jan 28 04:19:35 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +19 -3 lines
Diff to previous 1.33 (colored) to selected 1.17 (colored)

implement the tbl(7) "center" layout option

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jan 27 05:21:45 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +97 -124 lines
Diff to previous 1.32 (colored) to selected 1.17 (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.32 / (download) - annotate - [select for diffs], Wed Dec 24 15:38:55 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +8 -4 lines
Diff to previous 1.31 (colored) to selected 1.17 (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.31 / (download) - annotate - [select for diffs], Tue Oct 14 18:18:05 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored) to selected 1.17 (colored)

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

Revision 1.30 / (download) - annotate - [select for diffs], Tue Oct 14 02:16:06 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored) to selected 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.29 / (download) - annotate - [select for diffs], Mon Oct 13 23:31:46 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.28: +19 -3 lines
Diff to previous 1.28 (colored) to selected 1.17 (colored)

implement font modifiers in table layouts

Revision 1.28 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored) to selected 1.17 (colored)

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

Revision 1.27 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:05 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.26: +33 -33 lines
Diff to previous 1.26 (colored) to selected 1.17 (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.26 / (download) - annotate - [select for diffs], Fri Mar 28 23:26:25 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.25: +6 -4 lines
Diff to previous 1.25 (colored) to selected 1.17 (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.25 / (download) - annotate - [select for diffs], Fri May 31 21:37:17 2013 UTC (10 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3, VERSION_1_12_2
Changes since 1.24: +17 -17 lines
Diff to previous 1.24 (colored) to selected 1.17 (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.24 / (download) - annotate - [select for diffs], Sun May 27 18:02:49 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +7 -3 lines
Diff to previous 1.23 (colored) to selected 1.17 (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.

"Please check them in and I'll look into them later!" kristaps@

Revision 1.23 / (download) - annotate - [select for diffs], Sun May 27 17:59:23 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +12 -4 lines
Diff to previous 1.22 (colored) to selected 1.17 (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.

"Please check them in and I'll look into them later!" kristaps@

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 27 17:54:54 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +28 -60 lines
Diff to previous 1.21 (colored) to selected 1.17 (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().

"Please check them in and I'll look into them later!" kristaps@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Sep 20 23:05:49 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_1, VERSION_1_12_0
Changes since 1.20: +101 -96 lines
Diff to previous 1.20 (colored) to selected 1.17 (colored)

Major rewrite of the horizontal spacing of tables
to work both with and without frames and rulers.
ok kristaps@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jul 17 15:43:00 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6, VERSION_1_11_5
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.17 (colored)

Fix copyright email.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 25 12:07:30 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_11_4, VERSION_1_11_3, VERSION_1_11_2, VERSION_1_11_1, VERSION_1_10_10
Changes since 1.18: +11 -8 lines
Diff to previous 1.18 (colored) to selected 1.17 (colored)

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

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jan 11 14:12:01 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)

Add support for "^" vertical spanners.  Unlike GNU tbl, raise
error-class messages when data is being ignored by specifying it in "^"
cells (either as-is or in blocks).

Also note again that horizontal spanners aren't really supported...

Revision 1.17 / (download) - annotate - [selected], Mon Jan 10 14:56:06 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.16: +13 -15 lines
Diff to previous 1.16 (colored)

Make dp->string always consist of a value.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jan 10 14:40:30 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.15: +26 -13 lines
Diff to previous 1.15 (colored) to selected 1.17 (colored)

First, make extra data cells be thrown away.  This makes "dp->layout"
always hold, which cleans up the table stuff a bit.

Second, set a "spans" value per data cell consisting of the number of
skipped TBL_CELL_SPAN layout cells.

Third, make tbl_term.c understand how to skip over spanned sections when
iterating over the header queue.

What remains is to calculate the widths of spanned cells.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jan 8 17:16:48 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored) to selected 1.17 (colored)

The numerical column type centres on the *last* decimal point.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jan 8 17:00:27 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +1 -4 lines
Diff to previous 1.13 (colored) to selected 1.17 (colored)

Give the "n" cell type knowledge of its spacing.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 7 14:59:52 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.12: +13 -12 lines
Diff to previous 1.12 (colored) to selected 1.17 (colored)

Fixes: T} can be followed by a delimiter then more data.  Make this
work and add documentation for it.

Also make tbl_term() not puke if the number of data cells is less than
the number of layout cells (which happens from time to time).  This
still needs work because we should pad out empty cells so that the
borders all work out.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jan 7 13:20:58 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.11: +12 -9 lines
Diff to previous 1.11 (colored) to selected 1.17 (colored)

Quiesce lint with some type handling.  Does not change anything.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 5 15:37:23 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.10: +101 -249 lines
Diff to previous 1.10 (colored) to selected 1.17 (colored)

Stuff tbl_calc() into out.c so that it can be shared by all output modes
(isn't now, but will need to be, used by -T[x]html also).  Necessitated
a lot of churn in getting tbl_calc* code out of tbl_term.c and into
out.c, including renaming some structures and so on.  The abstraction is
in having a pointer to a wrapper function for calculating string widths.
The char devices use term_strlen and term_len; the others will probably
just use strlen().

While at it, remove some superfluous assertions in the tbl code.  This
allows all tbl manuals to clear.

Lastly, set the right-margin to be the maximum margin for each table
span.  This allows big, complicated tbl-pages like terminfo to be
displayed.  They're ugly, but they work.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jan 4 15:02:00 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +6 -8 lines
Diff to previous 1.9 (colored) to selected 1.17 (colored)

Support `T{' and `T}' data blocks.  When a standalone `T{' is
encountered as a line's last data cell, move into TBL_PART_CDATA mode
whilst leaving the cell's designation as TBL_DATA_NONE.  When new data
arrives that's not a standalone `T}', append it to the cell contends.
Close out and warn appropriately.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jan 4 13:21:45 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored) to selected 1.17 (colored)

Have horizontal spanner not clobber pre-set width.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jan 4 13:14:26 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.7: +10 -10 lines
Diff to previous 1.7 (colored) to selected 1.17 (colored)

Fix spacing for tables to use term_len().  Also make term.c properly
recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jan 4 12:06:21 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +10 -29 lines
Diff to previous 1.6 (colored) to selected 1.17 (colored)

Fix to make horizontal spanners in the layout be properly printed.
mandoc also now warns (so does tbl(1)) if a horizontal spanner is
specified along with data.

While here, fix up some documentation and uncomment the tbl reference.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jan 3 16:04:41 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored) to selected 1.17 (colored)

Switch on the `TS' documentation in roff.7.  As per off-line discussion,
this may be moved to tbl.7, but for the time being, keep it in the
document as it's developed.

Also note that my handling of horizontal rules in layouts needs some
work.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 3 15:07:59 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +29 -18 lines
Diff to previous 1.4 (colored) to selected 1.17 (colored)

Add in support for number table cells that account for escapes and so
on.  Note also that -Tps and -Tpdf, with these last two commits, produce
more readable output ("less crappy").

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 3 14:57:04 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.3: +46 -23 lines
Diff to previous 1.3 (colored) to selected 1.17 (colored)

Clean up the tbl top-level printing code and document the parts of it.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jan 3 14:45:59 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +39 -34 lines
Diff to previous 1.2 (colored) to selected 1.17 (colored)

Start using term_strlen() instead of strlen().  tbl_term.c can now
properly handle embedded escapes when calculating its widths.  NOTE:
this doesn't yet apply to the decimal-point calculation.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jan 3 13:59:21 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +228 -39 lines
Diff to previous 1.1 (colored) to selected 1.17 (colored)

Make width calculations occur within tbl_term.c, not tbl.c.  This allows
for front-ends to make decisions about widths, not the back-end.

To pull this off, first make each tbl_head contain a unique index value
(0 <= index < total tbl_head elements) and remove the tbl_calc() routine
from the back-end.

Then, when encountering the first tbl_span in the front-end, dynamically
create an array of configurations (termp_tbl) keyed on each tbl_head's
unique index value.  Construct the decimals and widths at this time,
then continue parsing as before.

The termp_tbl and indexes are required because we pass a const tbl AST
into the front-end.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jan 2 12:21:07 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Diff to selected 1.17 (colored)

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

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




CVSweb