From mboxrd@z Thu Jan 1 00:00:00 1970
Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1])
by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p04DERmV015669
for ; Tue, 4 Jan 2011 08:14:27 -0500 (EST)
Received: (from kristaps@localhost)
by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p04DEQx4020073;
Tue, 4 Jan 2011 08:14:26 -0500 (EST)
Date: Tue, 4 Jan 2011 08:14:26 -0500 (EST)
Message-Id: <201101041314.p04DEQx4020073@krisdoz.my.domain>
X-Mailinglist: mdocml-source
Reply-To: source@mdocml.bsd.lv
MIME-Version: 1.0
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Fix spacing for tables to use term_len().
X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/
Content-Type: text/plain; charset=utf-8
Log Message:
-----------
Fix spacing for tables to use term_len(). Also make term.c properly
recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.
Modified Files:
--------------
mdocml:
index.sgml
tbl_term.c
term.c
Revision Data
-------------
Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -Lterm.c -Lterm.c -u -p -r1.175 -r1.176
--- term.c
+++ term.c
@@ -677,6 +677,12 @@ term_strlen(const struct termp *p, const
if (rhs)
for (i = 0; i < rsz; i++)
sz += (*p->width)(p, *rhs++);
+ } else if (ASCII_NBRSP == *cp) {
+ sz += (*p->width)(p, ' ');
+ cp++;
+ } else if (ASCII_HYPH == *cp) {
+ sz += (*p->width)(p, '-');
+ cp++;
} else
sz += (*p->width)(p, *cp++);
Index: tbl_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl_term.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.7 -r1.8
--- tbl_term.c
+++ tbl_term.c
@@ -206,9 +206,6 @@ tbl_hframe(struct termp *tp, const struc
TBL_OPT_DBOX & sp->tbl->opts))
return;
- tp->flags |= TERMP_NONOSPACE;
- tp->flags |= TERMP_NOSPACE;
-
/*
* Print out the horizontal part of a frame or double frame. A
* double frame has an unbroken `-' outer line the width of the
@@ -465,7 +462,7 @@ tbl_calc_data(struct termp *tp, const st
case (TBL_CELL_HORIZ):
/* FALLTHROUGH */
case (TBL_CELL_DHORIZ):
- tblp->width = 1;
+ tblp->width = term_len(tp, 1);
break;
case (TBL_CELL_LONG):
/* FALLTHROUGH */
@@ -536,7 +533,7 @@ tbl_calc_data_literal(struct termp *tp,
const struct tbl_dat *dp,
struct termp_tbl *tblp)
{
- int sz, bufsz;
+ int sz, bufsz, spsz;
/*
* Calculate our width and use the spacing, with a minimum
@@ -551,16 +548,19 @@ tbl_calc_data_literal(struct termp *tp,
case (TBL_CELL_LONG):
/* FALLTHROUGH */
case (TBL_CELL_CENTRE):
- bufsz = 2;
+ bufsz = term_len(tp, 2);
break;
default:
- bufsz = 1;
+ bufsz = term_len(tp, 1);
break;
}
+ spsz = 0;
if (dp->layout->spacing)
- bufsz = bufsz > dp->layout->spacing ?
- bufsz : dp->layout->spacing;
+ spsz = term_len(tp, dp->layout->spacing);
+
+ if (spsz)
+ bufsz = bufsz > spsz ? bufsz : spsz;
sz += bufsz;
if (tblp->width < sz)
Index: index.sgml
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/index.sgml,v
retrieving revision 1.100
retrieving revision 1.101
diff -Lindex.sgml -Lindex.sgml -u -p -r1.100 -r1.101
--- index.sgml
+++ index.sgml
@@ -331,10 +331,11 @@
version 1.10.9
- Table functionality (see the roff manual) has been
- merged from tbl.bsd.lv. Many back-end
- fixes have also been implemented, primarily in argument handling (quoting) and man documents.
+ Table functionality (see the TS, TE, and T& macros in the roff manual) has been merged from tbl.bsd.lv. Many back-end fixes have also been
+ implemented, primarily in argument handling (quoting) and man
+ documents.
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv