Various fixes for 1.0 branch#9
Open
g-branden-robinson wants to merge 15 commits into
Open
Conversation
Fixes problem with chapter headings being set in 1-point type.
groff 1.23.0 NEWS:
* Type size escape sequences of the form "\sNN", where NN is in the
range 10-39, are now recognized only in compatibility mode ("groff
-C"); when encountered, an error diagnostic is emitted. Otherwise,
"\sN" is interpreted as setting the type size to the single-digit
value N (in scaled points), which ends the escape sequence. This
change eliminates a quirk in the language grammar that dates back to
the mid-1970s (AT&T troff by Ossanna) but was not documented in the
Troff User's Manual until 1992 when Kernighan updated CSTR #54 for
device-independent AT&T troff.
The form "\s(NN" is accepted for two-digit sizes in all known troffs.
The form "\s[NNN]" accepts a numeric expression of variable length;
it has been supported by groff since version 1.01 (March 1991) or
earlier, by Heirloom Doctools troff since its 2005-08-16 release, and
by neatroff, but not by Plan 9 troff. The form "\s'NNN'" is also
widely supported.
[...]
Fixes numerous (1,000+) warnings of the following form: troff:./utp_ix.t:4034: warning: cannot select font 'CW'
...and annotate apparently incorrect claims in document. This prompts new diagnostics, this time from the formatter, but I'm breaking this up to illuminate matters. Fixes: s.tmac:./ch12.t:3165: warning: excess arguments to .BX ignored s.tmac:./ch12.t:3168: warning: excess arguments to .BX ignored s.tmac:./ch12.t:3171: warning: excess arguments to .BX ignored s.tmac:./ch12.t:3174: warning: excess arguments to .BX ignored
Fixes: troff:./ch12.t:3165: error: an escaped 'c' is not allowed in a zero-width output escape sequence argument troff:./ch12.t:3168: error: an escaped 'c' is not allowed in a zero-width output escape sequence argument troff:./ch12.t:3171: error: an escaped 'c' is not allowed in a zero-width output escape sequence argument troff:./ch12.t:3174: error: an escaped 'c' is not allowed in a zero-width output escape sequence argument
The text blocks set wider than the author(s) expected. Let their column expand instead of presuming an explicit width. Fixes: ./ch15.t:1932: warning: table wider than line length minus indentation
Fixes: troff:./ch15.t:2728: error: character ':' is not allowed as a delimiter ...and indeed it is not. ':' is a valid operator in a numeric expression (it's a Boolean "or" operator), and those are not permitted to be delimiters in escape sequences parameterized thus (as we see with the bracket-building escape sequence here).
...instead of `expand` region option. Fixes: ./appa.t:529: warning: table column separation reduced to fit line length
Fixes: ./appa.t:1131: warning: table column separation reduced to zero
No troff allows you to assign values expressed in roman numerals to registers. Further, as of groff 1.23.0, `PN` is an alias of the formatter's `%` register, so this assignment is unnecessary. Fixes: troff:./toc.t:69: warning: expected numeric expression, got character 'v' troff:./toc.t:131: warning: expected numeric expression, got character 'v' troff:./toc.t:195: warning: expected numeric expression, got character 'i' troff:./toc.t:255: warning: expected numeric expression, got character 'x' troff:./toc.t:323: warning: expected numeric expression, got character 'x' troff:./preface.t:150: warning: expected numeric expression, got character 'x' troff:./preface.t:372: warning: expected numeric expression, got character 'x' troff:./preface.t:531: warning: expected numeric expression, got character 'x' troff:./utp_book.t:20: warning: expected numeric expression, got character 'i' troff:./ch01.t:9: warning: expected numeric expression, got character 'i'
AWK has different escaping rules for regex patterns `/xxx/` and strings
`"xxx"`.
Fixes:
awk: toc.awk:17: warning: escape sequence `\(' treated as plain `('
awk: toc.awk:18: warning: escape sequence `\[' treated as plain `['
awk: toc.awk:18: warning: escape sequence `\]' treated as plain `]'
Since the document's own macro definitions can impact formatting, make rules whose recipes run groff depend on the macro file.
Don't start an output line before breaking the page when the page number is even. This, combined with spurious blank lines at the boundaries of chapter files, could lead to excess blank pages in the document.
Because a blank input line puts 1v of space on the output, these could interfere with placement of page breaks.
Because a blank input line puts 1v of space on the output, these could interfere with placement of page breaks.
The file "src/utp_book.t" handles page breaks (and page renumbering) between "sections" (chapter-like divisions of the text).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found and fixed several issues when Deri James drew my attention to the UTP document a while back.