diff options
author | wlemb <wlemb> | 2002-07-07 08:10:56 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2002-07-07 08:10:56 +0000 |
commit | ed9502220fca75eec0254f1c26c7258400ce25b5 (patch) | |
tree | 9e5bf7682f706b0f4ccff16204acabf5e9e72b6d /tmac/doc.tmac | |
parent | b1e38e988e773d47711d8cea364bec4c50bf6a12 (diff) | |
download | groff-ed9502220fca75eec0254f1c26c7258400ce25b5.tar.gz |
Changing the substring request to make it fit better with other
string manipulation functions in other programming languages:
Index 0 is now the first character in the string, and index -1
indicates the last character. Since this request didn't work
properly anyway in the last release, it doesn't harm too much to
change the syntax.
* src/roff/troff/input.cc (substring_macro): Use loops to get
the real string length (ignoring COMPATIBLE_SAVE and
COMPATIBLE_RESTORE) and offsets.
Implement change described above.
* man/groff_char.man, tmac/doc-common (doc-header), tmac/doc.tmac
(doc-do-Bd-args, doc-do-Bl-args: Changed accordingly.
* NEWS, doc/groff.texinfo, man/groff_diff.man: Updated.
Make .chop work with .de1 and friends. COMPATIBLE_SAVE and
COMPATIBLE_RESTORE are completely ignored.
* src/roff/troff/input.cc (char_list::set, char_list::get): New
functions.
(macro): `length' field renamed to `len'.
Added new field `empty_macro' (1 if macro is empty), to be used
instead of checking `len'.
Updated all callers.
(macro::empty): Updated.
(macro::length, macro::set, macro::get): New functions.
(macro::append): Ignore COMPATIBLE_SAVE and COMPATIBLE_RESTORE.
Set `empty_macro'.
(chop_macro): Check and remove trailing COMPATIBLE_SAVE/
COMPATIBLE_RESTORE pairs.
(asciify): Ignore COMPATIBLE_SAVE and COMPATIBLE_RESTORE.
* src/roff/troff/request.h: Updated.
* doc/groff.texinfo: Document .chop's behaviour better.
* doc/pic.ms: Fix documentation for the addition of positions.
* tmac/doc.tmac, tmac/an-old.tmac: Need groff version 1.18.
Diffstat (limited to 'tmac/doc.tmac')
-rw-r--r-- | tmac/doc.tmac | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tmac/doc.tmac b/tmac/doc.tmac index 334102ac..36676432 100644 --- a/tmac/doc.tmac +++ b/tmac/doc.tmac @@ -57,8 +57,8 @@ .cp 0 . . -.if (\n[.x]\n[.y] < 117) \ -. ab You need GNU troff version 1.17 or higher to run this version of mdoc! +.if (\n[.x]\n[.y] < 118) \ +. ab You need GNU troff version 1.18 or higher to run this version of mdoc! . . .\" Load start-up files @@ -2767,7 +2767,7 @@ . \" character yields identical numerical results (ignoring the . \" scaling indicator) . ds doc-str-ddBa "\$2 -. substring doc-str-ddBa 1 -1 +. substring doc-str-ddBa 0 -2 . if \B(\*[doc-str-ddBa]) \{\ . nr doc-reg-ddBa3 (;(\$2)) . nr doc-reg-ddBa4 (\*[doc-str-ddBa]) @@ -3082,10 +3082,10 @@ . ds doc-tag-width-stack\n[doc-list-depth] TagwidtH . . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]] -. substring doc-str-dBla 1 1 +. substring doc-str-dBla 0 0 . ie .\*[doc-str-dBla] \{\ . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]] -. substring doc-str-dBla 2 +. substring doc-str-dBla 1 . doc-first-parameter \*[doc-str-dBla] . doc-get-width "\*[doc-str-dfp] . doc-get-arg-type "\*[doc-str-dfp] @@ -3129,7 +3129,7 @@ . \" character yields identical numerical results (ignoring the . \" scaling indicator) . ds doc-str-dBla1 "\*[doc-str-dBla] -. substring doc-str-dBla1 1 -1 +. substring doc-str-dBla1 0 -2 . if \B(\*[doc-str-dBla1]) \{\ . nr doc-reg-dBla3 (;(\*[doc-str-dBla])) . nr doc-reg-dBla4 (\*[doc-str-dBla1]) @@ -3171,7 +3171,7 @@ . warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32)) . . ds doc-str-dBla1 "\*[doc-str-dBla] -. substring doc-str-dBla1 1 -1 +. substring doc-str-dBla1 0 -2 . if \B(\*[doc-str-dBla1]) \{\ . nr doc-reg-dBla3 (;(\*[doc-str-dBla])) . nr doc-reg-dBla4 (\*[doc-str-dBla1]) @@ -3208,10 +3208,10 @@ . ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\ . nr doc-num-columns +1 . ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]] -. substring doc-str-dBla 1 1 +. substring doc-str-dBla 0 0 . ie .\*[doc-str-dBla] \{\ . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]] -. substring doc-str-dBla 2 +. substring doc-str-dBla 1 . doc-first-parameter \*[doc-str-dBla] . doc-get-width "\*[doc-str-dfp] . doc-get-arg-type "\*[doc-str-dfp] |