groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff/contrib/hdtbl ChangeLog hdtbl.tmac exampl...


From: Werner LEMBERG
Subject: [Groff-commit] groff/contrib/hdtbl ChangeLog hdtbl.tmac exampl...
Date: Sun, 04 Jun 2006 11:02:11 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     06/06/04 11:02:11

Modified files:
        contrib/hdtbl  : ChangeLog hdtbl.tmac 
        contrib/hdtbl/examples: rainbow.roff 

Log message:
        * hdbtl.tmac: Improve error messages.  In particular, handle
        singular and plural correctly by using a pseudo array `nth-{1,2,3}'.
        
        * examples/rainbow.roff: Add copyright notice.  Formatting.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/ChangeLog?cvsroot=groff&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/hdtbl.tmac?cvsroot=groff&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/examples/rainbow.roff?cvsroot=groff&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/ChangeLog,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ChangeLog   31 May 2006 07:48:38 -0000      1.9
+++ ChangeLog   4 Jun 2006 11:02:11 -0000       1.10
@@ -1,3 +1,10 @@
+2006-06-04  Werner LEMBERG  <address@hidden>
+
+       * hdbtl.tmac: Improve error messages.  In particular, handle
+       singular and plural correctly by using a pseudo array `nth-{1,2,3}'.
+
+       * examples/rainbow.roff: Add copyright notice.  Formatting.
+
 2006-05-31  Werner LEMBERG  <address@hidden>
 
        * examples/fontdumps_x.roff, examples/fontdumps_n.roff: Protect

Index: hdtbl.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/hdtbl.tmac,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- hdtbl.tmac  30 May 2006 21:07:11 -0000      1.2
+++ hdtbl.tmac  4 Jun 2006 11:02:11 -0000       1.3
@@ -32,7 +32,7 @@
 .\"    *****************************************************************
 .
 .if (\n[?] == 1) \
-.  tm HDroff: loading table macros file \n[.F].
+.  tm HDroff: Loading table macros file \n[.F].
 .
 .nr *hdtbl 1
 .
@@ -84,6 +84,11 @@
 .
 .\" %beginstrip%
 .
+.\" for better error messages
+.ds nth-1 st
+.ds nth-2 nd
+.ds nth-3 rd
+.
 .nr t*numb 0 1 \"      held table diversion #
 .
 .
@@ -152,7 +157,7 @@
 .      ie "\\*[bc]"=" \
 .        ds t*bc\\n[t*#] =\"
 .      el \
-.        tm \\n[.F]:\\n[.c]: invalid border color `\\*[bc]'.
+.        tm \\n[.F]:\\n[.c]: Invalid border color `\\*[bc]'.
 .  \}\}
 .  ie "\\*[bc]"=" \
 .    ds t*bc\\n[t*#]
@@ -187,9 +192,10 @@
 .    el \{\
 .      ie "\\*[tal]"r" \
 .        nr in\\n[t*#] \\n[.l]-\\n[ll\\n[t*#]]+\\n[.i]
-.      el \
-.        tm \\n[.F]:\\n[.c]: invalid tal-value `\\*[tal]': must be l, c or r
-.  \}\}
+.      el \{\
+.        tmc \\n[.F]:\\n[.c]: Invalid `tal' value `\\*[tal]':
+.        tm1 " must be `l', `c' or `r'.
+.  \}\}\}
 .
 .  nr t*r#\\n[t*#] 0 1               \"        rowindex in TBL
 .  mk toptbl\\n[t*#]
@@ -253,7 +259,7 @@
 .de TR
 .  ft 1
 .  if !\\n[t*#] \
-.    tm \\n[.F]:\\n[.c]: table row (.TR) without preceding table start (.TBL).
+.    tm \\n[.F]:\\n[.c]: Table row (.TR) without preceding table start (.TBL).
 .
 .  if \\n[t*r#\\n[t*#]] \
 .    t*dntr 1 \\n[c#\\*[#t#r]] \\n[t*cols\\n[t*#]] \\*[*#trc*]
@@ -334,8 +340,19 @@
 .  \}
 .
 .  if (\\n[c#\\n[t*#]*\\n[t*r#\\n[t*#]]] > \\n[t*cols\\n[t*#]]) \{\
-.    tmc \\n[.F]:\\n[.c]: \\n[c#\\*[#t#r]] table cols (.TD);
-.    tm1 " only \\n[t*cols\\n[t*#]] were defined.
+.    ds * are
+.    ds ** columns
+.    if (\\n[c#\\*[#t#r]] == 1) \{\
+.      ds * is
+.      ds ** column
+.    \}
+.    tmc \\n[.F]:\\n[.c]: There \\*[*] \\n[c#\\*[#t#r]] table \\*[**] (.TD)
+.
+.    ds * are
+.    if (\\n[t*cols\\n[t*#]] == 1) \
+.      ds * is
+.    tm1 " but only \\n[t*cols\\n[t*#]] \\*[*] expected.
+.
 .    ds *
 .    length * \\n[.F]:\\n[.c]:
 .
@@ -369,11 +386,11 @@
 .de ETB
 .  ie \\n[t*#] \
 .    if !\\n[t*r#\\n[t*#]] \{\
-.      tmc \\n[.F]:\\n[.c]: each table (.TBL)
+.      tmc \\n[.F]:\\n[.c]: Each table (.TBL)
 .      tm1 " should contain at least one table row (.TR)!
 .    \}
 .  el \{\
-.    tmc \\n[.F]:\\n[.c]: table end (.ETB)
+.    tmc \\n[.F]:\\n[.c]: Table end (.ETB)
 .    tm1 " without corresponding tablestart (.TBL)!
 .  \}
 .
@@ -405,7 +422,7 @@
 .    \}
 .    el \{\
 .      rn t*tbl0 t*hold\\n+[t*numb]
-.      tm \\n[.F]:\\n[.c]: table t*hold\\n[t*numb] held.
+.      tm \\n[.F]:\\n[.c]: Table t*hold\\n[t*numb] held.
 .      ds t*held \\*[t*held] t*hold\\n[t*numb] \\n[dn]\"
 .    \}
 .
@@ -438,7 +455,7 @@
 .    \}
 .
 .  if "\\*[t*held]"" \{\
-.    tm \\n[.F]:\\n[.c]: no held tables
+.    tm \\n[.F]:\\n[.c]: No held tables.
 .    return
 .  \}
 .
@@ -677,7 +694,7 @@
 .  \}
 .
 .  if (\\n[ll\\n[t*#]] > \\n[.l]) \
-.    tm \\n[.F]:\\n[.c]: table width larger than column width.
+.    tm \\n[.F]:\\n[.c]: Table width larger than column width.
 .
 .  nr ** (0 >? \\n[t*b\\n[t*#]])
 .  nr * 0 1
@@ -703,7 +720,11 @@
                * (2 * \\n[cscp\\n[t*#]] + \\n[b/2\\n[t*#]]) \
                / 1000 \
                + 50) / 10 * 10)
-.      tmc \\n[.F]:\\n[.c]: the \\n[*]th width value (\\$\\n[*]) is too small.
+.      ds * \\n[*]th
+.      nr *** (\\n[*] % 10)
+.      if d nth-\\n[***] \
+.        ds * \\n[*]\\*[nth-\\n[***]]
+.      tmc \\n[.F]:\\n[.c]: The \\*[*] width value (\\$\\n[*]) is too small.
 .      tm1 " It should be greater than \\n[*h].
 .    \}
 .
@@ -746,8 +767,25 @@
 .  ds #trc \\*[#t#r]*\\n[c#\\*[#t#r]]\"
 .
 .  if (\\$1 & (\\n[c#\\*[#t#r]] <= \\n[t*cols\\n[t*#]])) \{\
-.    tmc \\n[.F]:\\n[.c]: only \\n-[c#\\*[#t#r]] cols in the 
\\n[t*r#\\n[t*#]]th row;
-.    tm1 \\n[t*cols\\n[t*#]] were defined.
+.    ds * are
+.    ds ** columns
+.    if (\\n-[c#\\*[#t#r]] == 1) \{\
+.      ds * is
+.      ds ** column
+.    \}
+.    tmc \\n[.F]:\\n[.c]: There \\*[*] only \\n[c#\\*[#t#r]] \\*[**]
+.
+.    nr * \\n[t*r#\\n[t*#]]
+.    ds * \\n[*]th
+.    nr *** (\\n[*] % 10)
+.    if d nth-\\n[***] \
+.      ds * \\n[*]\\*[nth-\\n[***]]
+.    tmc " in the \\*[*] row
+.
+.    ds * are
+.    if (\\n[t*cols\\n[t*#]] == 1) \
+.      ds * is
+.    tm1 " but \\n[t*cols\\n[t*#]] \\*[*] expected.
 .  \}
 ..
 .
@@ -775,7 +813,7 @@
 .      ie "\\*[bgc]"=" \
 .        ds t*bgc\\$1 =\"
 .      el \
-.  tm \\n[.F]:\\n[.c]: invalid background color `\\*[bgc]'.
+.  tm \\n[.F]:\\n[.c]: Invalid background color `\\*[bgc]'.
 .
 .  if "\\*[args]"" \
 .    return
@@ -788,7 +826,7 @@
 .      ie "\\*[fgc]"=" \
 .        ds t*fgc\\$1 =\"
 .      el \
-.      tm \\n[.F]:\\n[.c]: invalid foreground color `\\*[fgc]'.
+.      tm \\n[.F]:\\n[.c]: Invalid foreground color `\\*[fgc]'.
 .
 .      if "\\*[args]"" \
 .        return
@@ -811,8 +849,8 @@
 .    ie \\n[index] \
 .      ds t*hal\\$1 \\*[hal]\"
 .    el \{\
-.      tmc \\n[.F]:\\n[.c]: invalid hal-value `\\*[t*hal\\$1]':
-.      tm1 " must be b, c, l or r.
+.      tmc \\n[.F]:\\n[.c]: Invalid `hal' value `\\*[t*hal\\$1]':
+.      tm1 " must be `b', `c', `l' or `r'.
 .  \}\}
 .
 .  if "\\*[args]"" \
@@ -824,8 +862,8 @@
 .    ie \\n[index] \
 .      ds t*val\\$1 \\*[val]\"
 .    el \{\
-.      tmc \\n[.F]:\\n[.c]: invalid val-value `\\*[t*val]':
-.      tm1 must be t, m or b.
+.      tmc \\n[.F]:\\n[.c]: Invalid `val' value `\\*[t*val]':
+.      tm1 " must be `t', `m' or `b'.
 .  \}\}
 .
 .  if "\\*[args]"" \
@@ -856,14 +894,14 @@
 .    pops * t*kept
 .    popr * t*kept
 .    if (\\n[*] - \\n[**]) \{\
-.      tm \\n[.F]:\\n[.c]: table \\*[*] higher than page -- ignored!
+.      tm \\n[.F]:\\n[.c]: Table \\*[*] higher than page -- ignored!
 .      break
 .    \}
 .
 .    if (\\n[*] - \\n[.t]) \{\
 .      ds t*kept \\n[*] \\*[t*kept]
 .      ds t*kept \\*[*] \\*[t*kept]
-.      tmc \\n[.F]:\\n[.c]: remaining table(s),
+.      tmc \\n[.F]:\\n[.c]: Remaining table(s),
 .      tm1 " because not all fit onto this page.
 .      break
 .    \}

Index: examples/rainbow.roff
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/examples/rainbow.roff,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- examples/rainbow.roff       30 May 2006 17:28:27 -0000      1.2
+++ examples/rainbow.roff       4 Jun 2006 11:02:11 -0000       1.3
@@ -1,41 +1,90 @@
-.\" Time-stamp: <Rainbow.roff: 13.07.2005 13:08:35 x01 - address@hidden
+.\" -*- mode: roff -*-
+.ig
+
+rainbow.roff
+
+This file is part of groff, the GNU roff type-setting system.
+
+Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+written by Joachim Walsdorff <address@hidden>.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with groff; see the file COPYING.  If not, write to the Free
+Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
+02110-1301, USA.
+
+..
+.
 .time start
+.
 .nr *n 25
 .nr *# 0 1
+.
 .de ctab
-.nr #cc 0
-.PN \\$1 ".nr #cc +1f/\\$1" ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
-".TBL csp=\nl/(12*\\$1+2) border= cpd=0 bgc=\\\\n[t*#] bc="  \
-".if \\\\n+(*#=1 .CPTN Rainbow Colors \(em Nested Tables with Colored \
-Backgrounds val=b" .TR .TD
+.  nr #cc 0
+.  PN \\$1 \
+     ".nr #cc +(1f / \\$1)" \
+     ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
+     ".TBL csp=\n[l]/(12*\\$1+2) border= cpd=0 bgc=\\\\n[t*#] bc=" \
+       ".if (\\\\n+[*#] == 1) \
+          .CPTN Rainbow Colors \[em] Nested Tables with Colored Backgrounds \
+                val=b" \
+       .TR \
+         .TD
 ..
-.ctab \n(*n 1            0           \En[#cc]u      \" rot     -> magenta
-.ctab \n(*n 1-\En[#cc]u  0           1              \" magenta -> blue
-.ctab \n(*n 0            \En[#cc]u   1              \" blue    -> cyan
-.ctab \n(*n 0            1           1-\En[#cc]u    \" cyan    -> green
-.ctab \n(*n \En[#cc]u    1           0              \" green   -> yellow
-.ctab \n(*n 1            1-\En[#cc]u 0              \" yellow  -> red
-.PN 6*\n(*n .ETB
+.
+.ctab \n[*n] 1            0           \En[#cc]u      \" rot     -> magenta
+.ctab \n[*n] 1-\En[#cc]u  0           1              \" magenta -> blue
+.ctab \n[*n] 0            \En[#cc]u   1              \" blue    -> cyan
+.ctab \n[*n] 0            1           1-\En[#cc]u    \" cyan    -> green
+.ctab \n[*n] \En[#cc]u    1           0              \" green   -> yellow
+.ctab \n[*n] 1            1-\En[#cc]u 0              \" yellow  -> red
+.
+.PN 6*\n[*n] .ETB
+.
 .time end
+.
 .bp
+.
 .time start
+.
 .nr *n 25
 .nr *# 0 1
+.
 .de ctab
-.nr #cc 0
-.PN \\$1 ".nr #cc +1f/\\$1" ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
-".TBL border=\nl/(12*\\$1+2) csp=0 cpd=0 bc=\\\\n[t*#] bgc="  \
-".if \\\\n+(*#=1 .CPTN Rainbow Colors \(em Nested Tables with Colored Borders \
- val=b" .TR .TD
+.  nr #cc 0
+.  PN \\$1 \
+     ".nr #cc +(1f / \\$1)" \
+     ".defcolor \En[t*#] rgb \\$2 \\$3 \\$4" \
+     ".TBL border=\n[l]/(12*\\$1+2) csp=0 cpd=0 bc=\\\\n[t*#] bgc=" \
+       ".if (\\\\n+[*#] == 1) \
+          .CPTN Rainbow Colors \[em] Nested Tables with Colored Borders \
+                val=b" \
+       .TR \
+         .TD
 ..
-.ctab \n(*n 1            \En[#cc]u   0              \" red     -> yellow
-.ctab \n(*n 1-\En[#cc]u  1           0              \" yellow  -> green
-.ctab \n(*n 0            1           \En[#cc]u      \" green   -> cyan
-.ctab \n(*n 0            1-\En[#cc]u 1              \" cyan    -> blue
-.ctab \n(*n \En[#cc]u    0           1              \" blue    -> magenta
-.ctab \n(*n 1            0           1-\En[#cc]u    \" magenta -> red
-.PN 6*\n(*n .ETB
+.
+.ctab \n[*n] 1            \En[#cc]u   0               \" red     -> yellow
+.ctab \n[*n] 1-\En[#cc]u  1           0               \" yellow  -> green
+.ctab \n[*n] 0            1           \En[#cc]u       \" green   -> cyan
+.ctab \n[*n] 0            1-\En[#cc]u 1               \" cyan    -> blue
+.ctab \n[*n] \En[#cc]u    0           1               \" blue    -> magenta
+.ctab \n[*n] 1            0           1-\En[#cc]u     \" magenta -> red
+.
+.PN 6*\n[*n] .ETB
+.
 .time end
+.
 .\"    466MHz Celeron CPU, 384MB RAM 
 .\"    WindowsXP/cygwin groff18.1:     11/10s
 .\"    WindowsXP/cygwin groff19.2:     57/55s




reply via email to

[Prev in Thread] Current Thread [Next in Thread]