source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: The GNU tbl(1) program contained in the groff package internally
@ 2020-10-25 18:28 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2020-10-25 18:28 UTC (permalink / raw)
  To: source

Log Message:
-----------
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.

Modified Files:
--------------
    mandoc:
        tbl_term.c
    mandoc/regress/tbl/data:
        block_width.out_ascii
    mandoc/regress/tbl/layout:
        center.out_ascii
        spacing.out_ascii
        span.out_ascii
    mandoc/regress/tbl/mod:
        expand.out_ascii
        font.out_ascii

Revision Data
-------------
Index: span.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/span.out_ascii,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lregress/tbl/layout/span.out_ascii -Lregress/tbl/layout/span.out_ascii -u -p -r1.4 -r1.5
--- regress/tbl/layout/span.out_ascii
+++ regress/tbl/layout/span.out_ascii
@@ -37,7 +37,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        |a | b | c | d | e |
        +--+---+---+---+---+
        leaked tab settings:
-       a b   c   d   e   f
+       a    b    c    d    e    f
 
 
 
Index: center.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/center.out_ascii,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/tbl/layout/center.out_ascii -Lregress/tbl/layout/center.out_ascii -u -p -r1.3 -r1.4
--- regress/tbl/layout/center.out_ascii
+++ regress/tbl/layout/center.out_ascii
@@ -18,7 +18,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        *****   *****   *****
 
        leaked tab settings:
-       a    b       c       de
+       a    b    c    de
 
 
 
Index: spacing.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/spacing.out_ascii,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/tbl/layout/spacing.out_ascii -Lregress/tbl/layout/spacing.out_ascii -u -p -r1.1 -r1.2
--- regress/tbl/layout/spacing.out_ascii
+++ regress/tbl/layout/spacing.out_ascii
@@ -32,7 +32,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        |a  || b |
        +---++---+
        leaked tab settings:
-       a b     cdef
+       a    b    c    d    e    f
 
 
 
Index: tbl_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.73 -r1.74
--- tbl_term.c
+++ tbl_term.c
@@ -190,17 +190,6 @@ term_tbl(struct termp *tp, const struct 
 
 		tblcalc(&tp->tbl, sp, tp->tcol->offset, tp->tcol->rmargin);
 
-		/* Tables leak .ta settings to subsequent text. */
-
-		term_tab_set(tp, NULL);
-		coloff = sp->opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ||
-		    sp->opts->lvert;
-		for (ic = 0; ic < sp->opts->cols; ic++) {
-			coloff += tp->tbl.cols[ic].width;
-			term_tab_iset(coloff);
-			coloff += tp->tbl.cols[ic].spacing;
-		}
-
 		/* Center the table as a whole. */
 
 		offset = tp->tcol->offset;
Index: block_width.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/data/block_width.out_ascii,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/tbl/data/block_width.out_ascii -Lregress/tbl/data/block_width.out_ascii -u -p -r1.3 -r1.4
--- regress/tbl/data/block_width.out_ascii
+++ regress/tbl/data/block_width.out_ascii
@@ -61,6 +61,6 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
      |  |   |   |   |   |   |   | 90        |
      +--+---+---+---+---+---+---+-----------+
      leaked tab settings:
-       b   c   d   e   f   g   h
+          b    c    d    e    f    g    h
 
 OpenBSD                          July 4, 2017                          OpenBSD
Index: expand.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/expand.out_ascii,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/tbl/mod/expand.out_ascii -Lregress/tbl/mod/expand.out_ascii -u -p -r1.2 -r1.3
--- regress/tbl/mod/expand.out_ascii
+++ regress/tbl/mod/expand.out_ascii
@@ -97,7 +97,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        x    x    x   x    x    123456789012345678901234567890123456789012    x
 
        leaked tab settings:
-       a b    c   d    e    f                                            g    h
+       a    b    c    d    e    f    g    h
 
 
 
Index: font.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/font.out_ascii,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/tbl/mod/font.out_ascii -Lregress/tbl/mod/font.out_ascii -u -p -r1.2 -r1.3
--- regress/tbl/mod/font.out_ascii
+++ regress/tbl/mod/font.out_ascii
@@ -15,7 +15,7 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        | _\ba_\bn_\bd   |  so   |   o\bon\bn   |
        +-------+-------+--------+
        leaked tab settings:
-       a      b       c        de
+       a    b    c    d    e
 
 
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-25 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-25 18:28 mandoc: The GNU tbl(1) program contained in the groff package internally schwarze

source@mandoc.bsd.lv

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mandoc-source

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mandoc-source mandoc-source/ http://inbox.vuxu.org/mandoc-source \
		source@mandoc.bsd.lv
	public-inbox-index mandoc-source

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git