summaryrefslogtreecommitdiff
path: root/tmac/doc.tmac
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-07-12 22:11:00 +0000
committerwlemb <wlemb>2001-07-12 22:11:00 +0000
commit555085ba5f32dffa70f3a1b1b899f2f48482b3b6 (patch)
treeb7b237ac8433fc7fda641fe7e40beda55ad18ad6 /tmac/doc.tmac
parent51efe4969e9cd59f8fa3ebdc9f79049c302c538b (diff)
downloadgroff-555085ba5f32dffa70f3a1b1b899f2f48482b3b6.tar.gz
2001-07-12 Ruslan Ermilov <ru@FreeBSD.org>
Merge -xwidth into -width. Add -xwidth functionality to -column also. * tmac/doc.tmac (Bl): Add dummy doc-typeXXX and doc-spaceXXX to avoid warning. (doc-do-Bl-args): Merge -xwidth code with -width. Test whether string immediately following a leading dot starts with a valid mdoc argument. Add similar code to the -column branch. (doc-Bl-usage): Updated. * groff_mdoc.man: s/-xwidth/-width/. 2001-07-12 Gaius Mulley <gaius@glam.ac.uk> * src/devices/grohtml/post-html.cc (text_glob::is_br): Stop titles running into centered or non-formatted text. 2001-07-11 Werner LEMBERG <wl@gnu.org> Introduce short and long prefixes to have the selection at run-time whether there is a 8+3 limit for names of temporary files. * src/libs/libgroff/tmpfile.cc (TMPFILE_PREFIX): Replaced with... (TMPFILE_PREFIX_SHORT, TMPFILE_PREFIX_LONG): This. (tmpfile_prefix, tmpfile_prefix_len, use_short_prefix): New variables. (temp_init): New global structure to initialize above three variables. (xtmptemplate): Use two parameters for long and short prefix. Simplify code use above three variables. (xtmpfile): Use long and short prefixes as parameters. * src/include/lib.h: Updated. * src/preproc/html/pre-html.cc ({PAGE,PS,REGION}_TEMPLATE): Replace with ... ({PAGE,PS,REGION}_TEMPLATE_{SHORT,LONG}): This. (createAllPages, makeTempFiles): Updated. 2001-07-09 Werner LEMBERG <wl@gnu.org> * REVISION: Increased to 3.
Diffstat (limited to 'tmac/doc.tmac')
-rw-r--r--tmac/doc.tmac151
1 files changed, 99 insertions, 52 deletions
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 38698644..5b8ec418 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -2980,6 +2980,9 @@
. nr doc-reg-Bl 1
. while (\n[doc-reg-Bl] <= \n[.$]) \{\
. ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
+. \" dummy type and space so that doc-save-global-vars() doesn't warn
+. nr doc-type\n[doc-reg-Bl] 0
+. ds doc-space\n[doc-reg-Bl]
. nr doc-reg-Bl +1
. \}
.
@@ -3011,7 +3014,7 @@
.
.de doc-Bl-usage
. tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
-. tm1 " [-width <string>] [-xwidth <command>]
+. tm1 " [-width <string>]
. tm1 " [-offset <string>] [-compact]
. tm1 " .Bl -column [-offset <string>] <string1> <string2> ...
. tm1 " .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
@@ -3074,56 +3077,25 @@
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
. nr doc-arg-ptr +1
. ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
-. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
.
-. \" test whether argument is a valid numeric expression
-. nr doc-reg-dBla1 0
-. if \B(\*[doc-str-dBla]) \{\
-. \" disable warnings related to scaling indicators (32)
-. nr doc-reg-dBla2 \n[.warn]
-. warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
-.
-. \" values without a scaling indicator are taken as strings;
-. \" we test whether the parameter string with and without the last
-. \" character yields identical numerical results (ignoring the
-. \" scaling indicator)
-. ds doc-str-dBla1 "\*[doc-str-dBla]
-. substring doc-str-dBla1 1 -1
-. if \B(\*[doc-str-dBla1]) \{\
-. nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
-. nr doc-reg-dBla4 (\*[doc-str-dBla1])
-. if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
-. nr doc-reg-dBla1 1
-. \}
-.
-. \" enable all warnings again
-. warn \n[doc-reg-dBla2]
-. \}
-.
-. ie \n[doc-reg-dBla1] \
-. nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
-. el \{\
-. doc-get-arg-width \n[doc-arg-ptr]
-. ie (\n[doc-width] == 2) \{\
-. \" if the width parameter is a macro, use the macro's
-. \" width as specified in doc-common
-. doc-get-arg-type \*[doc-str-dBla]
-. ie (\n[doc-arg-type] == 1) \
-. nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
-. el \
-. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
-. \}
+. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
+. substring doc-str-dBla 1 2
+. ie .\*[doc-str-dBla] \{\
+. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
+. substring doc-str-dBla 2
+. doc-first-parameter \*[doc-str-dBla]
+. doc-get-width "\*[doc-str-dfp]
+. doc-get-arg-type "\*[doc-str-dfp]
+. ie (\n[doc-arg-type] == 1) \
+. nr doc-reg-dBla1 1
. el \
-. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
-. \}\}
-.
-. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
-. nr doc-arg-ptr +1
-. ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
+. nr doc-reg-dBla1 0
+. \}
+. el \
+. nr doc-reg-dBla1 0
+. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
.
-. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
-. substring doc-str-dBla 1 2
-. if .\*[doc-str-dBla] \{\
+. ie \n[doc-reg-dBla1] \{\
. \" execute string in a box to get the width of the diversion
. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
. doc-save-global-vars
@@ -3139,9 +3111,49 @@
. box
. doc-restore-global-vars
. doc-get-width \h'\n[dl]u'
+. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
. \}
-. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
-. \}
+. el \{\
+. \" test whether argument is a valid numeric expression
+. nr doc-reg-dBla1 0
+. if \B(\*[doc-str-dBla]) \{\
+. \" disable warnings related to scaling indicators (32)
+. nr doc-reg-dBla2 \n[.warn]
+. warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
+.
+. \" values without a scaling indicator are taken as strings;
+. \" we test whether the parameter string with and without the last
+. \" character yields identical numerical results (ignoring the
+. \" scaling indicator)
+. ds doc-str-dBla1 "\*[doc-str-dBla]
+. substring doc-str-dBla1 1 -1
+. if \B(\*[doc-str-dBla1]) \{\
+. nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
+. nr doc-reg-dBla4 (\*[doc-str-dBla1])
+. if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
+. nr doc-reg-dBla1 1
+. \}
+.
+. \" enable all warnings again
+. warn \n[doc-reg-dBla2]
+. \}
+.
+. ie \n[doc-reg-dBla1] \
+. nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
+. el \{\
+. doc-get-arg-width \n[doc-arg-ptr]
+. ie (\n[doc-width] == 2) \{\
+. \" if the width parameter is a macro, use the macro's
+. \" width as specified in doc-common
+. doc-get-arg-type \*[doc-str-dBla]
+. ie (\n[doc-arg-type] == 1) \
+. nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
+. el \
+. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
+. \}
+. el \
+. nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
+. \}\}\}
.
. el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
. nr doc-arg-ptr +1
@@ -3185,14 +3197,49 @@
. \}\}\}
. el \
. nr doc-reg-dBla 0
-. \}\}\}\}
+. \}\}\}
.
. \" not a known keyword, so it specifies the width of the next column
. \" (if it is a column list)
. if !\n[doc-reg-dBla] \{\
. ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
. nr doc-num-columns +1
-. ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
+. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
+. substring doc-str-dBla 1 2
+. ie .\*[doc-str-dBla] \{\
+. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
+. substring doc-str-dBla 2
+. doc-first-parameter \*[doc-str-dBla]
+. doc-get-width "\*[doc-str-dfp]
+. doc-get-arg-type "\*[doc-str-dfp]
+. ie (\n[doc-arg-type] == 1) \
+. nr doc-reg-dBla1 1
+. el \
+. nr doc-reg-dBla1 0
+. \}
+. el \
+. nr doc-reg-dBla1 0
+. ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
+.
+. ie \n[doc-reg-dBla1] \{\
+. \" execute string in a box to get the width of the diversion
+. ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
+. doc-save-global-vars
+. doc-reset-args
+. box doc-box-dBla
+. ev doc-env-dBla
+. evc 0
+. in 0
+. nf
+. nop \*[doc-str-dBla]
+. br
+. ev
+. box
+. doc-restore-global-vars
+. ds doc-arg\n[doc-num-columns] "\h'\n[dl]u'
+. \}
+. el \
+. ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
. \}
. el \{\
. tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'