From ed9502220fca75eec0254f1c26c7258400ce25b5 Mon Sep 17 00:00:00 2001 From: wlemb Date: Sun, 7 Jul 2002 08:10:56 +0000 Subject: 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. --- tmac/doc-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmac/doc-common') diff --git a/tmac/doc-common b/tmac/doc-common index 2496cf6a..439b3a36 100644 --- a/tmac/doc-common +++ b/tmac/doc-common @@ -535,7 +535,7 @@ . nr doc-reg-dh1 \w'\*[doc-caption-font2]\*[doc-volume]\f[]' . if (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\ . while (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\ -. substring doc-header-string 1 -1 +. substring doc-header-string 0 -2 . nr doc-reg-dh \w'\*[doc-caption-font]\*[doc-header-string]\|.\|.\|.\f[]' . \} . as doc-header-string "\|.\|.\|. -- cgit v1.2.1