[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff/contrib/hdtbl ChangeLog hdmisc.tmac hdtbl...
From: |
Werner LEMBERG |
Subject: |
[Groff-commit] groff/contrib/hdtbl ChangeLog hdmisc.tmac hdtbl... |
Date: |
Sat, 28 Oct 2006 16:57:09 +0000 |
CVSROOT: /cvsroot/groff
Module name: groff
Changes by: Werner LEMBERG <wl> 06/10/28 16:57:09
Modified files:
contrib/hdtbl : ChangeLog hdmisc.tmac hdtbl.tmac
Log message:
* hdmisc.tmac (EM): Improve warning messages.
* hdtbl.tmac (TD): Move constant comparison out of while loop.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/ChangeLog?cvsroot=groff&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/hdmisc.tmac?cvsroot=groff&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/hdtbl/hdtbl.tmac?cvsroot=groff&r1=1.6&r2=1.7
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/ChangeLog,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- ChangeLog 26 Oct 2006 19:38:23 -0000 1.18
+++ ChangeLog 28 Oct 2006 16:57:08 -0000 1.19
@@ -1,3 +1,9 @@
+2006-10-27 Werner LEMBERG <address@hidden>
+
+ * hdmisc.tmac (EM): Improve warning messages.
+
+ * hdtbl.tmac (TD): Move constant comparison out of while loop.
+
2006-10-26 Werner LEMBERG <address@hidden>
* hdmisc.tmac: Add `\"' at various places to protect against
Index: hdmisc.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/hdmisc.tmac,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- hdmisc.tmac 26 Oct 2006 19:38:23 -0000 1.4
+++ hdmisc.tmac 28 Oct 2006 16:57:08 -0000 1.5
@@ -89,48 +89,50 @@
. length ** \\*[**]
. shift
. if (\\n[*] > \\n[**]) \{\
-. as args " "\\*[**]"\" argument too short, repeat
+. as args " "\\*[**]"\" value too short, repeat
. continue
. \}
. substring * 0 (\\n[*] - 1)
-. \" string comparison
+. \" The surrounding \? escapes emulate string comparison.
. ie !"\?\\*[$1]\?"\?\\*[*]\?" \{\
-. as args " "\\*[**]"\" argument not found, repeat
+. as args " "\\*[**]"\" key not found, repeat
. continue
. \}
. el \{\
. ie "\?\\*[**]\?"\?\\*[$1]\?" \
-. ds \\*[$1] \\*[$1]\" return bare arg name as string
+. ds \\*[$1] \\*[$1]\" return key as string
. el \{\
. ie "\?\\*[**]\?"\?\\*[$1]=\?" \
-. ds \\*[$1] =\" return value `=' as string
+. ds \\*[$1] =\" return `='
. el \{\
. substring ** (\\n[*] + 1) -1
. ds * \\*[**]\"
. substring * 0 0
.
+. \" check whether value starts with quote
. if "\?\\*[*]\?"\?'\?" \{\
-. substring ** 1 -1 \" remove 1st char from arg (')
+. substring ** 1 -1
. ds * \\*[**]\"
-. substring * -1 -1 \" remove 2nd char also ('\)
+. substring * -1 -1
.
+. \" search final quote
. ie "\?\\*[*]\?"\?'\?" \
-. substring ** 0 -2 \" yes, skip next clause
+. substring ** 0 -2
. el \{\
-. as \\*[$1] \\*[**] \" no, append this arg
+. as \\*[$1] \\*[**] \" not found, append argument
.
. while 1 \{\
-. ds ** \\$1\" get next arg
+. ds ** \\$1\" get next argument
. ds * \\$1\"
. shift
. substring * -1 -1
.
. if "\?\\*[*]\?"\?'\?" \{\
. substring ** 0 -2
-. break \" leave loop if last char isn't '
+. break \" break if no final quote
. \}
.
-. as \\*[$1] \\*[**] \" otherwise append arg and
repeat
+. as \\*[$1] \\*[**] \" otherwise append and repeat
. \}
. \}\}
.
@@ -141,17 +143,16 @@
. \}\}
.
. return
-. \} \" end of while
+. \}
..
.
.
+.\" Utility macro: .index <string1> <string2>
.\"
-.\" ******************************************************************
-.\" ** .index string1 string2 **
-.\" ** returns in reg `index' the index **
-.\" ** of string2 in string1 or 0 **
-.\" ** without string2 reg `index' is -999 **
-.\" ******************************************************************
+.\" Check whether <string2> is a substring of <string2> and
+.\" return its position in number register `index', starting
+.\" with 1. If not found, return 0. If <string2> is empty,
+.\" set `index' to -999.
.de index
. if "\\$2"" \{\
. nr index -999
@@ -499,17 +500,18 @@
.\" ******************************************************************
.\" ** minimal Page setup **
.\" ******************************************************************
+.
.nr s \n[.ps]
.nr v \n[.v]
.pv 1.2 1.2 "" X
-.nr l 6.6i
+.nr l 6.6i \" set text width
.ll \n[l]u
-.nr o 2c
+.nr o 2c \" set offset
.po \n[o]u
-.nr p 29.7c \" pagelength A4
+.nr p 29.7c \" set paper length (A4)
.pl \n[p]u
-.nr tH 1i
-.sp |\n[tH]u \" text start on the first page
+.nr tH 1i \" set top margin
+.sp |\n[tH]u
.
.ev 99
.lt \n[l]u
@@ -517,7 +519,7 @@
.
.
.de HM
-. sp |.5i
+. sp |.5i \" print header in top margin
. tl \\*[t*HM]
. sp |\\n[tH]u
. ev
@@ -526,7 +528,7 @@
.
.de BM
. ev 99
-. sp |(\\n[p]u - .5i)
+. sp |(\\n[p]u - .5i) \" print footer in bottom margin
. tl \\*[t*BM]
. bp
..
@@ -535,12 +537,16 @@
.de EM
. rm BM \" no page number at bottom of last page
.
-. if !""\\*[t*kept]" \
-. tm HDroff: kept table left over; add `.bp' at the end of your document.
-. if !""\\*[t*held]" \
-. tm HDroff: held table left over; add `.t*free' at the end of your
document.
+. if !"\\*[t*kept]"" \{\
+. tm1 "hdtbl: Not all tables have been printed.
+. tm1 " Add `.bp' at the end of your document.
+. \}
+. if !"\\*[t*held]"" \{\
+. tm1 "hdtbl: There are held tables which haven't been printed.
+. tm1 " Add `.t*free' at the end of your document.
+. \}
. if \\n[t*#] \
-. tm HDrofff: unclosed table (TBL).
+. tm hdtbl: Missing `.ETB' macro at end of document.
..
.
.
Index: hdtbl.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/hdtbl/hdtbl.tmac,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- hdtbl.tmac 26 Oct 2006 19:38:23 -0000 1.6
+++ hdtbl.tmac 28 Oct 2006 16:57:08 -0000 1.7
@@ -289,7 +289,7 @@
. if \\n[t*r#\\n[t*#]] \
. t*dntr 1 \\n[c#\\*[#t#r]] \\n[t*cols\\n[t*#]] \\*[*#trc*]
.
-. nr t*r#\\n[t*#] +1 \" row number of this table
+. nr t*r#\\n[t*#] +1 \" row number in this table
. ds #t#r \\n[t*#]*\\n[t*r#\\n[t*#]]\" table row identifier
. \" (<level>*<row>)
. nr c#\\*[#t#r] 0 1 \" clear cell counter
@@ -361,7 +361,8 @@
. nr * 0 1
. nr *r \\n[t*r#\\n[t*#]]
.
-. while ((\\n[rowspan] - 1) & (\\n+[*] <= \\n[rowspan])) \{\
+. if (\\n[rowspan] - 1) \
+. while (\\n+[*] <= \\n[rowspan]) \{\
. nr rsp\\n[t*#]*\\n[*r]*\\n[c#\\*[#t#r]] \\n[colspan]
. if (\\n[*] > 1) \
. nr csp\\n[t*#]*\\n[*r]*\\n[c#\\*[#t#r]] \\n[colspan]
@@ -792,8 +793,8 @@
.\" Utility macro: .t*dntr <origin> <cell position> ? <cell ID>
.\"
.\" Close TD diversion, make some calculations, and set
-.\" some help strings and registers. Argument 1 is 0,
-.\" 1, or 2 if the call of .t*dntr occurs in .TD, .TR, or
+.\" some help strings and registers. <origin> is 0, 1,
+.\" or 2 if the call of .t*dntr occurs in .TD, .TR, or
.\" .ETB, respectively.
.de t*dntr
. nr dn 0 \" reset diversion height