diff options
author | wl <wl> | 2008-10-18 05:56:19 +0000 |
---|---|---|
committer | wl <wl> | 2008-10-18 05:56:19 +0000 |
commit | e8ab1287a86c0d63bf89cbf0942343edfbe3fa6b (patch) | |
tree | f0a30f1f3f5bda2204620dd6f25799eb94327048 /src | |
parent | ebdc085f5c04d8b1fe9b29e8e6ee85711dda19d7 (diff) | |
download | groff-e8ab1287a86c0d63bf89cbf0942343edfbe3fa6b.tar.gz |
* src/preproc/tbl/main.cpp (process_format): Rename `x' and `X' to
`m' and `M', respectively.
Sort entries in `switch' block.
* src/preproc/tbl/tbl.man: Updated.
Sort key entries; other minor improvements.
Diffstat (limited to 'src')
-rw-r--r-- | src/preproc/tbl/main.cpp | 126 | ||||
-rw-r--r-- | src/preproc/tbl/tbl.man | 225 | ||||
-rw-r--r-- | src/roff/groff/groff.man | 6 | ||||
-rw-r--r-- | src/roff/grog/grog.man | 4 | ||||
-rw-r--r-- | src/roff/nroff/nroff.man | 2 | ||||
-rw-r--r-- | src/roff/troff/troff.man | 2 |
6 files changed, 184 insertions, 181 deletions
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp index cb9c3eba..5a8f08ce 100644 --- a/src/preproc/tbl/main.cpp +++ b/src/preproc/tbl/main.cpp @@ -1,6 +1,6 @@ // -*- C++ -*- /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005, - 2007 + 2007, 2008 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -841,26 +841,6 @@ format *process_format(table_input &in, options *opt, int success = 1; do { switch (c) { - case 't': - case 'T': - c = in.get(); - list->vertical_alignment = entry_modifier::TOP; - break; - case 'd': - case 'D': - c = in.get(); - list->vertical_alignment = entry_modifier::BOTTOM; - break; - case 'u': - case 'U': - c = in.get(); - list->stagger = 1; - break; - case 'z': - case 'Z': - c = in.get(); - list->zero_width = 1; - break; case '0': case '1': case '2': @@ -880,6 +860,21 @@ format *process_format(table_input &in, options *opt, list->separation = w; } break; + case 'B': + case 'b': + c = in.get(); + list->font = "B"; + break; + case 'd': + case 'D': + c = in.get(); + list->vertical_alignment = entry_modifier::BOTTOM; + break; + case 'e': + case 'E': + c = in.get(); + list->equal++; + break; case 'f': case 'F': do { @@ -914,8 +909,13 @@ format *process_format(table_input &in, options *opt, } } break; - case 'x': - case 'X': + case 'I': + case 'i': + c = in.get(); + list->font = "I"; + break; + case 'm': + case 'M': do { c = in.get(); } while (c == ' ' || c == '\t'); @@ -948,33 +948,6 @@ format *process_format(table_input &in, options *opt, } } break; - case 'v': - case 'V': - c = in.get(); - list->vertical_spacing.val = 0; - list->vertical_spacing.inc = 0; - if (c == '+' || c == '-') { - list->vertical_spacing.inc = (c == '+' ? 1 : -1); - c = in.get(); - } - if (c == EOF || !csdigit(c)) { - error("`v' modifier must be followed by number"); - list->vertical_spacing.inc = 0; - } - else { - do { - list->vertical_spacing.val *= 10; - list->vertical_spacing.val += c - '0'; - c = in.get(); - } while (c != EOF && csdigit(c)); - } - if (list->vertical_spacing.val > MAX_VERTICAL_SPACING - || list->vertical_spacing.val < -MAX_VERTICAL_SPACING) { - error("unreasonable vertical spacing"); - list->vertical_spacing.val = 0; - list->vertical_spacing.inc = 0; - } - break; case 'p': case 'P': c = in.get(); @@ -1002,6 +975,43 @@ format *process_format(table_input &in, options *opt, list->point_size.inc = 0; } break; + case 't': + case 'T': + c = in.get(); + list->vertical_alignment = entry_modifier::TOP; + break; + case 'u': + case 'U': + c = in.get(); + list->stagger = 1; + break; + case 'v': + case 'V': + c = in.get(); + list->vertical_spacing.val = 0; + list->vertical_spacing.inc = 0; + if (c == '+' || c == '-') { + list->vertical_spacing.inc = (c == '+' ? 1 : -1); + c = in.get(); + } + if (c == EOF || !csdigit(c)) { + error("`v' modifier must be followed by number"); + list->vertical_spacing.inc = 0; + } + else { + do { + list->vertical_spacing.val *= 10; + list->vertical_spacing.val += c - '0'; + c = in.get(); + } while (c != EOF && csdigit(c)); + } + if (list->vertical_spacing.val > MAX_VERTICAL_SPACING + || list->vertical_spacing.val < -MAX_VERTICAL_SPACING) { + error("unreasonable vertical spacing"); + list->vertical_spacing.val = 0; + list->vertical_spacing.inc = 0; + } + break; case 'w': case 'W': c = in.get(); @@ -1038,25 +1048,15 @@ format *process_format(table_input &in, options *opt, } } break; - case 'e': - case 'E': + case 'z': + case 'Z': c = in.get(); - list->equal++; + list->zero_width = 1; break; case '|': c = in.get(); list->vline++; break; - case 'B': - case 'b': - c = in.get(); - list->font = "B"; - break; - case 'I': - case 'i': - c = in.get(); - list->font = "I"; - break; case ' ': case '\t': c = in.get(); diff --git a/src/preproc/tbl/tbl.man b/src/preproc/tbl/tbl.man index bd904a66..04ab3309 100644 --- a/src/preproc/tbl/tbl.man +++ b/src/preproc/tbl/tbl.man @@ -27,13 +27,10 @@ the original English. . . .SH SYNOPSIS -.B @g@tbl -[ -.B \-Cv -] -[ -.IR files \|.\|.\|.\& -] +.SY @g@tbl +.OP \-Cv +.RI [ files\~ .\|.\|.] +.YS . . .SH DESCRIPTION @@ -57,11 +54,9 @@ cannot be processed with Unix .BR troff ; it must be processed with GNU .BR troff . -If no files are given on the command line, the standard input -will be read. -A filename of +If no files are given on the command line or a filename of .B \- -will cause the standard input to be read. +is given, the standard input is read. . . .SH OPTIONS @@ -94,58 +89,57 @@ characters \[en] Unix tbl only accepts options with all characters lowercase or all characters uppercase), separated by spaces, tabs, or commas: . .TP +.B allbox +Enclose each item of the table in a box. +. +.TP +.B box +Enclose the table in a box. +. +.TP .B center -Centers the table (default is left-justified). +Center the table (default is left-justified). The alternative keyword name .B centre is also recognized (this is a GNU tbl extension). . .TP +.BI decimalpoint( c ) +Set the character to be recognized as the decimal point in numeric +columns (GNU tbl only). +. +.TP .BI delim( xy ) Use .I x -and +and\~\c .I y as start and end delimiters for .BR @g@eqn (@MAN1EXT@). . .TP +.B doublebox +Enclose the table in a double box. +. +.TP +.B doubleframe +Same as doublebox (GNU tbl only). +. +.TP .B expand -Makes the table as wide as the current line length (providing a column +Make the table as wide as the current line length (providing a column separation factor). In case the sum of the column widths is larger than the current line length, the column separation factor is set to zero; such tables extend into the right margin, and there is no column separation at all. . .TP -.B box -Encloses the table in a box. -. -.TP -.B doublebox -Encloses the table in a double box. -. -.TP -.B allbox -Encloses each item of the table in a box. -. -.TP .B frame Same as box (GNU tbl only). . .TP -.B doubleframe -Same as doublebox (GNU tbl only). -. -.TP -.BI tab( x ) -Uses the character -.I x -instead of a tab to separate items in a line of input data. -. -.TP .BI linesize( n ) -Sets lines or rules (e.g. from +Set lines or rules (e.g. from .BR box ) in .IR n -point @@ -161,14 +155,15 @@ This can sometimes interact badly with macro packages' own use of diversions, when footnotes, for example, are used. . .TP -.BI decimalpoint( c ) -Set the character to be recognized as the decimal point in numeric -columns (GNU tbl only). -. -.TP .B nospaces Ignore leading and trailing spaces in data items (GNU tbl only). . +.TP +.BI tab( x ) +Use the character +.I x +instead of a tab to separate items in a line of input data. +. .LP The global options must end with a semicolon. There might be whitespace between an option and its argument in parentheses. @@ -191,7 +186,8 @@ inter-column spacing, etc. . .LP The longest format line defines the number of columns in the table; missing -format descriptors at the end of format lines are assumed to be `L'. +format descriptors at the end of format lines are assumed to be\~\c +.BR L . Extra columns in the data (which have no corresponding format entry) are ignored. . @@ -199,46 +195,46 @@ ignored. The available key characters are: . .TP -c,C -Centers item within the column. +.BR a , A +Center longest line in this column and then left-justifies all other lines +in this column with respect to that centered line. . .TP -r,R -Right-justifies item within the column. +.BR c , C +Center item within the column. . .TP -l,L -Left-justifies item within the column. +.BR l , L +Left-justify item within the column. . .TP -n,N -Numerically justifies item in the column: Units positions of numbers are +.BR n , N +Numerically justify item in the column: Units positions of numbers are aligned vertically. . .TP -s,S -Spans previous item on the left into this column. +.BR r , R +Right-justify item within the column. . .TP -a,A -Centers longest line in this column and then left-justifies all other lines -in this column with respect to that centered line. +.BR s , S +Span previous item on the left into this column. . .TP -^ -Spans down entry from previous row in this column. +.B ^ +Span down entry from previous row in this column. . .TP -_,- -Replaces this entry with a horizontal line. +.BR _ , - +Replace this entry with a horizontal line. . .TP -= +.B = . -Replaces this entry with a double horizontal line. +Replace this entry with a double horizontal line. . .TP -| +.B | The corresponding column becomes a vertical rule (if two of these are adjacent, a double vertical rule). . @@ -250,35 +246,22 @@ last one produces a line at the edge of the table. Here are the specifiers that can appear in suffixes to column key letters: . .TP -b,B -Short form of fB (make affected entries bold). -. -.TP -i,I -Short form of fI (make affected entries italic). -. -.TP -t,T -Start an item vertically spanning rows at the top of its range rather than -vertically centering it. +.BR b , B +Short form of +.B fB +(make affected entries bold). . .TP -d,D +.BR d , D Start an item vertically spanning rows at the bottom of its range rather than vertically centering it (GNU tbl only). . .TP -v,V -Followed by a number, this indicates the vertical line spacing to be used in -a multi-line table entry. -If signed, the current vertical line spacing is incremented or decremented -(using a signed number instead of a signed digit is a GNU tbl extension). -A vertical line spacing specifier followed by a column separation number -must be separated by one or more blanks. -No effect if the corresponding table entry isn't a text block. +.BR e , E +Make equally-spaced columns. . .TP -f,F +.BR f , F Either of these specifiers may be followed by a font name (either one or two characters long), font number (a single digit), or long name in parentheses (the last form is a GNU tbl extension). @@ -286,26 +269,13 @@ A one-letter font name must be separated by one or more blanks from whatever follows. . .TP -p,P -Followed by a number, this does a point size change for the affected fields. -If signed, the current point size is incremented or decremented (using a -signed number instead of a signed digit is a GNU tbl extension). -A point size specifier followed by a column separation number must be -separated by one or more blanks. -. -.TP -w,W -Minimal column width value. -Must be followed either by a -.BR @g@troff (@MAN1EXT@) -width expression in parentheses or a unitless integer. -If no unit is given, en units are used. -Also used as the default line length for included text blocks. -If used multiple times to specify the width for a particular column, -the last entry takes effect. +.BR i , I +Short form of +.B fI +(make affected entries italic). . .TP -x,X +.BR m , M This is a GNU tbl extension. Either of these specifiers may be followed by a macro name (either one or two characters long), @@ -332,15 +302,45 @@ are output. Thus the macro can overwrite other modification specifiers. . .TP -e,E -Make equally-spaced columns. +.BR p , P +Followed by a number, this does a point size change for the affected fields. +If signed, the current point size is incremented or decremented (using a +signed number instead of a signed digit is a GNU tbl extension). +A point size specifier followed by a column separation number must be +separated by one or more blanks. . .TP -u,U +.BR t , T +Start an item vertically spanning rows at the top of its range rather than +vertically centering it. +. +.TP +.BR u , U Move the corresponding column up one half-line. . .TP -z,Z +.BR v , V +Followed by a number, this indicates the vertical line spacing to be used in +a multi-line table entry. +If signed, the current vertical line spacing is incremented or decremented +(using a signed number instead of a signed digit is a GNU tbl extension). +A vertical line spacing specifier followed by a column separation number +must be separated by one or more blanks. +No effect if the corresponding table entry isn't a text block. +. +.TP +.BR w , W +Minimal column width value. +Must be followed either by a +.BR @g@troff (@MAN1EXT@) +width expression in parentheses or a unitless integer. +If no unit is given, en units are used. +Also used as the default line length for included text blocks. +If used multiple times to specify the width for a particular column, +the last entry takes effect. +. +.TP +.BR z , Z Ignore the corresponding column for width-calculation purposes. . .LP @@ -364,7 +364,8 @@ on the line is `\[rs]' (which vanishes after concatenation). .LP Note that .B @g@tbl -computes the column widths line by line, applying \[rs]w on each entry. +computes the column widths line by line, applying \[rs]w on each entry +which isn't a text block. As a consequence, constructions like .IP .B .TS @@ -434,10 +435,14 @@ A text block can be used to enter data as a single entry which would be too long as a simple string between tabs. It is started with `T{' and closed with `T}'. The former must end a line, and the latter must start a line, probably -followed by other data columns (separated with tabs). +followed by other data columns (separated with tabs or the character given +with the +.B tab +global option). By default, the text block is formatted with the settings which were active before entering the table, possibly overridden by the -.B v +.BR m , +.BR v , and .B w tbl specifiers. @@ -607,7 +612,7 @@ instead of .BR bp . . .LP -Using \[rs]a directly in a table to get leaders will not work (except in +Using \[rs]a directly in a table to get leaders does not work (except in compatibility mode). This is correct behaviour: \[rs]a is an .B uninterpreted diff --git a/src/roff/groff/groff.man b/src/roff/groff/groff.man index 22b15acb..be1e78b6 100644 --- a/src/roff/groff/groff.man +++ b/src/roff/groff/groff.man @@ -61,8 +61,7 @@ groff \- front-end for the groff document formatting system .OP \-T dev .OP \-w name .OP \-W name -.RI [ file -.IR .\|.\|. ] +.RI [ file\~ .\|.\|.] . .SY groff .B \-h @@ -73,8 +72,7 @@ groff \- front-end for the groff document formatting system .B \-v | .B \-\-version -.RI [ option -.IR .\|.\|. ] +.RI [ option\~ .\|.\|.] .YS . . diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man index 26264d10..9af130e6 100644 --- a/src/roff/grog/grog.man +++ b/src/roff/grog/grog.man @@ -78,9 +78,9 @@ grog \- guess options for groff command . .SY grog .OP \-C -.RI [ \%groff\-option\ .\|.\|.\&] +.RI [ \%groff\-option\~ .\|.\|.\&] .OP \-\- -.RI [ \%filespec\ .\|.\|.] +.RI [ \%filespec\~ .\|.\|.] . .SY grog .B \-h diff --git a/src/roff/nroff/nroff.man b/src/roff/nroff/nroff.man index df57a023..4f2fba2e 100644 --- a/src/roff/nroff/nroff.man +++ b/src/roff/nroff/nroff.man @@ -42,7 +42,7 @@ the original English. .OP \-o list .OP \-r cn .OP \-T name -.RI [ file .\|.\|.] +.RI [ file\~ .\|.\|.] . .SY @g@nroff .B \-\-help diff --git a/src/roff/troff/troff.man b/src/roff/troff/troff.man index f8819e93..8ef8ceeb 100644 --- a/src/roff/troff/troff.man +++ b/src/roff/troff/troff.man @@ -49,7 +49,7 @@ FDL in the main directory of the groff source package. .OP \-T name .OP \-w name .OP \-W name -.RI "[\ " files\|.\|.\|. "\ ]" +.RI [ file\~ .\|.\|.] .YS . . |