2024-01-13 G. Branden Robinson [troff]: Fix Savannah #64484. * src/roff/troff/input.cpp (encode_char_for_troff_output): Annotate the function's purpose. Initially assume the character to be encoded as valid. If the current token is a plain space, write a space (U+0020) to the output. (This is necessary because the `device` request no longer reads its arguments in copy mode; see below.) Move the `sc` local variable to a higher scope. Update the new `is_char_valid` Boolean instead of issuing an error diagnostic at each point of validation failure. When done processing the character, test `is_char_valid` and emit different diagnostics depending on whether the input was a special character escape sequence we can't handle, or something else. Emit a self-quoted escape character _as a backslash_, not as the current *roff escape character. (device_request): Rewrite to operate in interpretation mode, not copy mode. * doc/groff.texi (Postprocessor Access): * man/groff.7.man (Request short reference): * NEWS: Document it. Fixes . 2024-01-13 G. Branden Robinson * src/roff/groff/tests/\ device-control-special-character-handling.sh: Add unit test for this feature. We want to be able to consistently pass (some) special character escape sequences to device control commands, and we want the `device` request and `\X` escape sequences to behave consistently with each other. * src/roff/groff/groff.am (groff_TESTS): Run test. 2024-01-13 G. Branden Robinson * src/roff/troff/input.cpp (encode_char_for_troff_output): Qualify `c` argument as `const`. Reorder comparisons to avoid inadvertent lvalue assignment. (Yes--suspenders _and_ a belt.) 2024-01-10 G. Branden Robinson [troff]: Fix code style nits. * src/roff/troff/input.cpp (device_request) (device_macro_request, output_request): Declare functions `static` since they do not require external linkage. 2024-01-09 G. Branden Robinson [troff]: Add unit test for `\X` (device control) escape sequence. * src/roff/groff/tests/backslash-X-works.sh: Add test. * src/roff/groff/groff.am (groff_TESTS): Run test. 2024-01-08 G. Branden Robinson [troff]: Add unit test for `device` request. * src/roff/groff/tests/device-request-works.sh: Add test. * src/roff/groff/groff.am (groff_TESTS): Run test. Fixes . 2024-01-08 G. Branden Robinson * doc/groff.texi (Postprocessor Access): * man/groff_diff.7.man (New requests): Clarify a point of `device` request behavior; a partially collected line in the top-level diversion must exist at least once. Fixes . 2024-01-08 G. Branden Robinson * src/roff/troff/div.cpp (top_level_diversion::output) (top_level_diversion::transparent_output) (top_level_diversion::copy_file): Clarify diagnostic messages. 2024-01-08 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/div.cpp (top_level_diversion::begin_page): Demote return type from `int` to `bool`. Return Boolean instead of integer literals. * src/roff/troff/div.h (class top_level_diversion): Update declaration. 2024-01-08 G. Branden Robinson [troff]: Enhance new tests. * src/roff/groff/tests/\ backslash-exclamation-early-does-not-fail.sh: * src/roff/groff/tests/output-request-early-does-not-fail.sh: Check that escape/request parameters don't get emitted before the output leader, and that they do show up in the output. 2024-01-08 G. Branden Robinson [troff]: Add tests of early usage of formatter features that throw fatal errors when called "too early", but for which this error handling appears to be dead code. Further test the `output` request in furtherance of Savannah #64959. * src/roff/groff/tests/\ backslash-exclamation-early-does-not-fail.sh: * src/roff/groff/tests/cf-request-early-does-not-fail.sh: * src/roff/groff/tests/output-request-works.sh: Add tests. * src/roff/groff/groff.am (groff_TESTS): Run tests. 2024-01-08 G. Branden Robinson [troff]: Revise diagnostics. * src/roff/troff/div.cpp (top_level_diversion::output) (top_level_diversion::transparent_output) (top_level_diversion::copy_file): Recast diagnostic messages to be distinguishable and provide more information about what the problem is. Make the proffered advice agnostic with respect to choice of control character and request renaming. 2024-01-08 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/input.cpp (encode_char): Rename this... (encode_char_for_troff_output): ...to this. (do_special): Update call site. 2024-01-08 G. Branden Robinson [troff]: Restore diagnostic from groff 1.22.4. * src/roff/troff/input.cpp (encode_char): Add `else` to `if` statement checking the output device for the "use_charnames_in_special" directive (used only by grohtml(1)). This way we once again throw a diagnostic upon the following input, invalid with any other output device. printf '\\X@pdf: \\[u1234]@\n' | groff Problem introduced by me in commit eb695ab2b5, 30 October 2021. 2024-01-05 G. Branden Robinson * font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the file name pairs "URWBookmanL-LighItal" and "URWBookmanL-Ligh"; and "b018032l.pfb" and "018012l.pfb" as well. 2024-01-07 Deri James * src/devices/gropdf/gropdf.pl (do_x): Comment out line causing incorrect table of contents relocation. Thanks to Peter Schaffter for the report. 2024-01-07 Deri James [gropdf]: Fix inclusion of PDF v1.7 files. PDF 1.5 introduced the object type ObjStm, which can contain a bunch of objects in its own compressed stream, but there is a restriction that an object with its own stream cannot be included into the ObjStm (i.e., no streams within streams). Gropdf has supported this for some years, but it has come to light that some PDFs have a "skeleton" object that contains the stream, while the rest of the object is held in an ObjStm. * src/devices/gropdf/gropdf.pl (LoadPDF, ObjMerge): If a skeleton object exists at the top level and in an ObjStm stream, merge the two objects. 2024-01-07 Deri James * src/devices/gropdf/gropdf.pl (subs_call): Fix bad fix for Savannah #65112. {Problem introduced by me in commit 6e45bb0bc6, 4 January, when I manually merged Deri's patch that wouldn't merge automatically, and I misread the magic constant "16" as "6". My fault, but this is also one reason symbolic constants with human-readable names are usually preferred to numeric literals. -- GBR} 2024-01-05 G. Branden Robinson [troff]: Fix Savannah #64592 (default color name). * src/libs/libgroff/color.cpp: Explicitly name the default color "default", instead of permitting it to have a null name. * doc/groff.texi (Colors): * man/groff.7.man (Read-only registers): * NEWS: Document it. Fixes . Thanks to Deri James, Dave Kemper, and Peter Schaffter for the discussion. 2024-01-05 G. Branden Robinson [troff]: Implement new `pcolor` request. * src/roff/troff/input.cpp (report_color): Add. (init_input_requests): Wire up `pcolor` request name to `report_color()`. * doc/groff.texi (Colors, Debugging): * man/groff.7.man (Request short reference, Debugging): * man/groff_diff.7.man (New requests, Debugging): * NEWS: Document it. 2024-01-04 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/input.cpp (class non_interpreted_char_node) (class token_node) (class non_interpreted_node): Rename `same()` member function to `is_same_as()`. Demote `is_same_as()` and `is_tag()` member function from `int` to `bool`. (non_interpreted_char_node::same): (token_node::same): (non_interpreted_node::same): Rename these... (non_interpreted_char_node::is_same_as): (token_node::is_same_as): (non_interpreted_node::is_same_as): ...to these. Demote return type from `int` to `bool`. (non_interpreted_char_node::is_tag): (operator==): Demote return type from `int` to `bool`. (operator==): Return Boolean instead of integer literal. Rename local variable `are_same` to `same` for brevity and demote it from `int` to `bool`. * src/roff/troff/node.cpp (class glyph_node) (class ligature_node) (class kern_pair_node) (class dbreak_node) (class hyphen_inhibitor_node): (class italic_corrected_node): (class break_char_node): (class composite_node): Rename `same()` member function to `is_same_as()`. Demote `is_same_as()` and `is_tag()` member function from `int` to `bool`. (hyphen_inhibitor_node::same): (special_node::same): (suppress_node::same): (tag_node::same): (draw_node::same): (extra_size_node::same): (vertical_size_node::same): (hmotion_node::same): (space_char_hmotion_node::same): (vmotion_node::same): (hline_node::same): (vline_node::same): (dummy_node::same): (transparent_dummy_node::same): (zero_width_node::same): (italic_corrected_node::same): (left_italic_corrected_node::same): (overstrike_node::same): (bracket_node::same): (composite_node::same): (glyph_node::same): (ligature_node::same): (kern_pair_node::same): (dbreak_node::same): (break_char_node::same): (line_start_node::same): (space_node::same): (word_space_node::same): (unbreakable_space_node::same): (diverted_space_node::same): (diverted_copy_file_node::same): Rename these... (hyphen_inhibitor_node::is_same_as): (special_node::is_same_as): (suppress_node::is_same_as): (tag_node::is_same_as): (draw_node::is_same_as): (extra_size_node::is_same_as): (vertical_size_node::is_same_as): (hmotion_node::is_same_as): (space_char_hmotion_node::is_same_as): (vmotion_node::is_same_as): (hline_node::is_same_as): (vline_node::is_same_as): (dummy_node::is_same_as): (transparent_dummy_node::is_same_as): (zero_width_node::is_same_as): (italic_corrected_node::is_same_as): (left_italic_corrected_node::is_same_as): (overstrike_node::is_same_as): (bracket_node::is_same_as): (composite_node::is_same_as): (glyph_node::is_same_as): (ligature_node::is_same_as): (kern_pair_node::is_same_as): (dbreak_node::is_same_as): (break_char_node::is_same_as): (line_start_node::is_same_as): (space_node::is_same_as): (word_space_node::is_same_as): (unbreakable_space_node::is_same_as): (diverted_space_node::is_same_as): (diverted_copy_file_node::is_same_as): ...to these. Demote return type from `int` to `bool`. (hyphen_inhibitor_node::is_tag): (node::is_tag): (space_node::is_tag): (special_node::is_tag): (tag_node::is_tag): (suppress_node::is_tag): (unbreakable_space_node::is_tag): (draw_node::is_tag): (extra_size_node::is_tag): (hmotion_node::is_tag): (space_char_hmotion_node::is_tag): (vmotion_node::is_tag): (hline_node::is_tag): (vline_node::is_tag): (dummy_node::is_tag): (transparent_dummy_node::is_tag): (zero_width_node::is_tag): (italic_corrected_node::is_tag): (left_italic_corrected_node::is_tag): (overstrike_node::is_tag): (bracket_node::is_tag): (glyph_node::is_tag): (ligature_node::is_tag): (kern_pair_node::is_tag): (dbreak_node::is_tag): (break_char_node::is_tag): (line_start_node::is_tag): (word_space_node::is_tag): (diverted_space_node::is_tag): (diverted_copy_file_node::is_tag): Demote return type from `int` to `bool`. (hyphen_inhibitor_node::is_tag): (node::is_tag): (space_node::is_tag): (special_node::is_tag): (tag_node::is_tag): (unbreakable_space_node::is_tag): (draw_node::is_tag): (vertical_size_node::is_tag): (hmotion_node::is_tag): (space_char_hmotion_node::is_tag): (vmotion_node::is_tag): (hline_node::is_tag): (vline_node::is_tag): (dummy_node::is_same_as): (dummy_node::is_tag): (transparent_dummy_node::is_same_as): (zero_width_node::is_tag): (italic_corrected_node::is_tag): (left_italic_corrected_node::is_tag): (overstrike_node::is_tag): (bracket_node::is_tag): (glyph_node::is_tag): (ligature_node::is_tag): (kern_pair_node::is_tag): (dbreak_node::is_tag): (break_char_node::is_tag): (line_start_node::is_same_as): (line_start_node::is_tag): (word_space_node::is_tag): (diverted_space_node::is_tag): (diverted_copy_file_node::is_tag): (same_node, same_node_list): Return Boolean instead of integer literal. (make_glyph_node, same_node): Make explicit comparisons of pointer types to null pointer literals. * src/roff/troff/node.h (struct node): Demote member variable `is_special` from `int` to `bool`. Demote pure virtual member function `is_tag`'s return type from `int` to `bool`. Rename pure virtual member function from `same` to `is_same_as` and demote its return type from `int` to `bool`. (node::node): Use Boolean instead of integer literal in overloaded `is_special` initializers. (class line_start_node): (class space_node): (class word_space_node): (class unbreakable_space_node): (class diverted_space_node): (class diverted_copy_file_node): (class extra_size_node): (class vertical_size_node): (class hmotion_node): (class space_char_hmotion_node): (class vmotion_node): (class hline_node): (class vline_node): (class dummy_node): (class transparent_dummy_node): (class zero_width_node): (class left_italic_corrected_node): (class overstrike_node): (class bracket_node): (class special_node): (class suppress_node): (class tag_node): (class draw_node): Rename member function `same` to `is_same_as`. Demote member functions `is_same_as` and `is_tag` from `int` to `bool`. * src/roff/troff/request.h (class macro): Demote friend function `operator==` from `int` to `bool`. 2024-01-04 G. Branden Robinson * src/roff/troff/node.cpp (make_glyph_node): Trivially refactor; Boolify local variable. 2024-01-04 Deri James font/devpdf/Foundry.in: Fix Savannah #65115. * font/devpdf/Foundry.in: Fix BMI, BMR mapping swap. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2024-01-04 Deri James [gropdf]: Fix Savannah #65112. * src/devices/gropdf/gropdf.pl (subs_call): Type 1 fonts have a section of numbered subroutines which can be called from the actual glyph definition; I have seen over 1000 in some large fonts. So, when you are subsetting you need to subset (and renumber) any relevant subroutines used by the glyph you are subsetting. Fixes . 2024-01-04 G. Branden Robinson * src/utils/grog/grog.pl: Trivially refactor; simplify code. 2024-01-03 G. Branden Robinson * src/libs/libgroff/glyphuni.cpp: Slightly refactor. (glyph_to_unicode_init::glyph_to_unicode_init): Use `array_length()` (our std::size for C++98) and `size_t` as type for loop index. 2024-01-03 G. Branden Robinson * src/libs/libgroff/glyphuni.cpp: Trivially refactor. (struct glyph_to_unicode): Rename this... (struct glyph_to_unicode_map): ...to this. We already have a _function_ called `glyph_to_unicode` in the code base and apparently it's not a name space conflict (despite groff making little use of any but the default name space), but it's definitely confusing when searching the code. 2024-01-03 G. Branden Robinson [libgroff, troff]: Refactor. * src/include/unicode.h: Rename function `check_unicode_name` to `valid_unicode_code_sequence` and update comments to better explain what it actually does. The validity of "u1234_5678" in addition to "u1234" was undocumented and not even implied. * src/libs/libgroff/unicode.cpp (check_unicode_name): Rename this... (valid_unicode_code_sequence): ...to this. * src/libs/libgroff/font.cpp (glyph_to_unicode) * src/roff/troff/input.cpp (token::next) (map_composite_character, composite_glyph_name): Update call sites. Make comparisons to null pointers explicit. 2024-01-03 G. Branden Robinson [gropdf]: Fix Savannah #65111. Add "notice" diagnostic level for debugging. * src/devices/gropdf/gropdf.pl (Notice): Add new subroutine. It emits a diagnostic message only if debugging ("gropdf -d"). (Warn): Prefix diagnostic with severity level here... (Msg): ...instead of here. (LoadFont): Demote diagnostic about fonts lacking space glyphs from warning to notice. Fixes . 2024-01-03 G. Branden Robinson * src/devices/gropdf/gropdf.pl: Report only "basename" of program name in diagnostic messages. Fixes . Thanks to Dave Kemper for the code review. 2024-01-03 Deri James [gropdf]: Add `pdfpagenumbering` macro. * tmac/pdf.tmac: Do it. * src/devices/gropdf/gropdf.1.man: Document it. 2024-01-03 G. Branden Robinson Increment Perl dependency from 5.6.1. gropdf requires 5.8. * m4/groff.m4 (GROFF_PERL): Do it. * INSTALL.extra: * doc/webpage.ms: Document it. 2024-01-03 Deri James [gropdf]: Add font subsetting and Type 1 font parser. * src/devices/gropdf/gropdf.pl: There are two main areas of change. The first is rectifying my design mistake in the original gropdf. It used the "t" command from groff as the primary command as a series of input characters which would be converted to postscript glyphs, all other text commands (for example "c") were converted back to their input character and treated as a single character "t" command. I was focussed on the groff font rather than the postscript font. While thinking about font subsetting it became clear it made more sense to convert all input to postscript glyph names immediately, and use them as the "common currency" rather than focus on words. This particularly makes sense when dealing with non-latin input which has been processed with preconv. It is also makes it much more natural when dealing with font subsetting. Previously this was not necessary because the whole font was embedded by gropdf. The second major change is the addition of a type 1 font parser and code to generate a font which only contains the glyphs required by the document being processed. This is the area which needs the most testing. I have tested with dozens of fonts that this parser is robust enough, but there are thousands of fonts out there. It seems to be happy with fonts produced by fontforge, which is promising. 2024-01-02 G. Branden Robinson * src/preproc/tbl/tbl.1.man (roff interface): Fix incorrect claim regarding `#T` register. 2024-01-02 G. Branden Robinson [man,mdoc]: Increase default line length to 80n on terminals. The resolution of tbl(1) bugs such as Savannah #63749, #63640, and #62471 enables us to discard a decades-old convention of using 78n for the default line length when formatting for terminals; this was because tbl(1) would sometimes overset lines, with ugly consequences. (I _assume_ this was the reason; no one ever seems to have gone on record about it--it was seemingly yet another case of Unix folklore that "everybody knew".) Overset lines are still possible; tbl(1) will warn if so. They can also overset if the document disables filling; the author is expected to know what they are doing in that case. * tmac/an.tmac: * tmac/doc-old.tmac: * tmac/mdoc/doc-nroff: Do it. * tmac/groff_man.7.man.in: * tmac/groff_mdoc.7.man: Update documentation and annotations. * tmac/tests/an-ext_SY-and-YS-work.sh: * tmac/tests/an_HY-register-works.sh: * tmac/tests/an_LL-init-sanely.sh: * tmac/tests/an_UE-breaks-before-long-URIs.sh: * tmac/tests/an_adjust-link-text-correctly.sh: * tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh: * tmac/tests/an_title-abbreviation-works.sh: * tmac/tests/andoc_flush-between-packages.sh: * tmac/tests/doc_indents-correctly.sh: * tmac/tests/doc_smoke-test.sh: Update test output expectations. * NEWS: Document it. 2024-01-02 G. Branden Robinson * tmac/mdoc/doc-nroff (doc-setup-page-layout): Port nroff-mode horizontal rule width compensation from "an.tmac" (29 December) to mdoc. 2024-01-01 G. Branden Robinson [tmac]: Update tests to more recent script conventions, and to share more information. * tmac/tests/an_LL-init-sanely.sh: Rename variable from `EXAMPLE` to `input`. Write the test output to the standard output stream. Report the horizontal motion quantum (`.H` register) and the line length in ens (character cells) as well for comprehensibility by *roff non-experts. * tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh: Write the test output to the standard output stream. * tmac/tests/an_title-abbreviation-works.sh: Rename variables to use lowercase instead of uppercase. Define and use `wail()` function instead of repeating logic in failure cases. Write the test output to the standard output stream. Report test progress and outcomes to standard error stream. * tmac/tests/andoc_flush-between-packages.sh: Rename variable from `FAIL` to `fail`. Define and use `wail()` function instead of repeating logic in failure cases. * tmac/tests/doc_indents-correctly.sh: Define and use `wail()` function instead of repeating logic in failure cases. Report test progress to standard error stream. Drop redundant `exit`. * tmac/tests/doc_smoke-test.sh: Drop redundant variable initialization. 2023-12-29 G. Branden Robinson [tbl]: Fix Savannah #62471 (hrules in nroff mode). This fixes the last problem I know of that keeps man pages from freely using the full width of the terminal. (You can still cause lines to overrun manually, of course.) * src/preproc/tbl/table.h (class table): Define new enumeration constant, `HAS_DATA_HRULE`, to keep track of whether a table uses a horizontal rule as a data row. * src/preproc/tbl/main.cpp (process_data): Set it when encountering appropriate input. * src/preproc/tbl/table.cpp (table::compute_overall_width): Check for it if the table is not already boxed, and emit output to reduce the line length by one in nroff mode. Fixes . 2023-12-29 G. Branden Robinson [tbl]: Regression-test Savannah #62471. * src/preproc/tbl/tests/horizontal-rules-not-drawn-too-long.sh: Do it. * src/preproc/tbl/tbl.am (tbl_TESTS): Run test. 2023-12-29 G. Branden Robinson * src/preproc/tbl/table.cpp (table::compute_overall_width): Document the nroff-mode workarounds we do in *roff comments in the generated output. 2023-12-29 G. Branden Robinson * tmac/an.tmac (an-end): Horizontal rules in nroff mode _always_ overdraw by one character cell; this is how grotty detects intersections with vertical rules at boundaries (see Savannah #62471). Unfortunately it has unhappy consequences when drawing a rule that extends to the right margin. Compensate by drawing the rule between consecutively rendered man pages nominally one en shorter than the line length, which turns out to be exactly the line length. 2023-12-29 Deri James [gropdf]: Fix Savannah #65092 (rounded corners in hdtbl's "color_boxes.roff" example). The \X'ps: exec ...' for setlinejoin and setlinecap (which hdtbl.tmac emits as one command) is documented as separate commands in gropdf(1). * src/devices/gropdf/gropdf.pl (do_x): Allow both setlinecap and setlinejoin to be combined in one command. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-12-10 Deri James [gropdf]: Fix arc drawing when `-l` option used. * src/devices/gropdf/gropdf.pl (PlotArcSegement): When landscape flag `-l` is given, coordinates for arcs need rotation. 2023-11-24 Deri James [gropdf]: Fix processing of catenated dit files (-Z). Normally it is safe to pass concatenated dit files to gropdf, typically this would be a separate source file which produces a custom cover and a different source for the body (different macro set?). Problem occurs if one of the dits uses the same fontno for a different font. Normally troff allocates TR to #5, but if one of the dits has been run with the flag "U-T" then U-TR is allocated to #5. * src/devices/gropdf/gropdf.pl (LoadFont): Check if "x font # name" has the same number AND name as a previously registered font, otherwise reload the font. 2023-12-29 G. Branden Robinson * src/devices/grotty/tty.cpp (tty_printer::end_page): Add `assert()` to check invariant. 2023-12-29 G. Branden Robinson * src/preproc/tbl/tests/check-horizontal-line-length.sh: Tweak shell style and have test issue groff output to the standard output stream. 2023-12-29 G. Branden Robinson * src/roff/troff/input.cpp (charinfo::contains): Add sure-to-fail `assert()` to member function taking a `charinfo` pointer and a `bool`. It has been marked "TODO" and unconditionally returning false for 13 years. We should find out if it blows up in real-world use. 2023-12-29 G. Branden Robinson * src/preproc/tbl/table.cpp (table::add_entry): Recast diagnostic when user attempts to put a text block in a table cell classified as numeric, and demote it from error to warning since the program falls back to left alignment. 2023-12-27 G. Branden Robinson [troff]: Add another explicit mechanism for disabling automatic hyphenation; accept an `hla` request without arguments for this purpose. * src/roff/troff/env.cpp (select_hyphenation_language): Do it. * doc/groff.texi (Manipulating Hyphenation): * man/groff.7.man (Request short reference): * man/groff_diff.7.man (New requests): * NEWS: Document it. * src/roff/groff/tests/hla-request-works.sh: Test it. * src/roff/groff/groff.am (groff_TESTS): Run test. Fixes https://savannah.gnu.org/bugs/?64958>. 2023-12-27 G. Branden Robinson * src/roff/groff/tests/dot-trap_register_works.sh: Fix thinko. The test was spuriously always passing. Fortunately, the test continues to pass when corrected. Problem introduced by me with new `.trap` register feature in commit 4c2cd5e076, 26 July. 2023-12-27 G. Branden Robinson [troff]: Fix code style nits. * src/roff/troff/input.cpp (do_open, open_request) (opena_request, close_request): Demote `int` arguments to `bool`. Declare functions `static` since they do not require external linkage. 2023-12-27 G. Branden Robinson [troff]: Revise diagnostics when opening and closing streams. * src/roff/troff/input.cpp (do_open, close_request): Do it. Recast. Check `fclose()` for failure and report the system's error description upon failure. 2023-12-27 G. Branden Robinson [docs]: Revise explanation of `fl` request. This has been an annoying lacuna of groff documentation forever. * doc/groff.texi (Debugging): * man/groff.7.man (Request short reference): Do it. Fixes . 2023-12-27 G. Branden Robinson Support pic(1) pictures when formatting HTML and using "fallback" pic macros. * tmac/pic.tmac (PS): Call `HTML-IMAGE` at end of macro definition. * tmac/pic.tmac (PF): Call `HTML-IMAGE-END` at end of macro definition. (`PE` and `PY` call `PF`, and so are also handled.) Fixes https://savannah.gnu.org/bugs/?65047> (2/2). Thanks to Hans Bezemer and Dave Kemper for the report. 2023-12-23 G. Branden Robinson * tmac/an.tmac (EE): Fix latent logic error; use `if` for conditional without an "else". Since there was no subsequent `el` request, but the formatter was "primed" to expect one, this could conceal an `el` usage error in a man page document or otherwise behave strangely. 2023-12-18 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/env.cpp (environment::do_break) (do_break_request): Boolify parameter and rename it to `want_adjustment`. In the future, adjustment might not only "spread", but "squeeze" as well. (break_request): Rename this... (break_without_adjustment): ...to this, and declare it `static`. Pass Boolean literal to `do_break_request`. (break_spread_request): Rename this... (break_with_adjustment): ...to this, and declare it `static`. Pass Boolean literal to `do_break_request`. (init_env_requests): Update "call" sites of renamed functions. * src/roff/troff/env.cpp (class environment): Demote `do_break`'s parameter from `int` to `bool`, and drop parameter names from prototype, in keeping with the Stroustrup-style C++ used in most of groff. 2023-12-08 G. Branden Robinson * src/roff/troff/input.cpp (nop_request, do_if_request) (if_else_request, if_request, else_request, while_request) (while_break_request, while_continue_request): Define functions as `static`; they require no visibility outside this translation unit. 2023-12-08 G. Branden Robinson * src/roff/troff/input.cpp (if_else_request, if_request): Throw warning in category `missing` if given no arguments. 2023-12-08 G. Branden Robinson Manage config.h more consistently. * src/roff/troff/env.cpp: Ensure that we include config.h (if necessary) _before_ C standard library header math.h. * src/devices/xditview/Dvi.c: * src/devices/xditview/draw.c: * src/devices/xditview/font.c: * src/devices/xditview/lex.c: * src/devices/xditview/page.c: * src/devices/xditview/parse.c: * src/libs/libbib/map.c: * src/libs/libgroff/change_lf.cpp: * src/libs/libgroff/cmap.cpp: * src/libs/libgroff/cset.cpp: * src/libs/libgroff/fmod.c: * src/libs/libgroff/geometry.cpp: * src/libs/libgroff/getcwd.c: * src/libs/libgroff/localcharset.c: * src/libs/libgroff/prime.cpp: * src/libs/libgroff/ptable.cpp: * src/libs/libgroff/quotearg.c: * src/libs/libgroff/spawnvp.c: * src/libs/libxutil/DviChar.c: * src/libs/libxutil/XFontName.c: * src/libs/libxutil/xmalloc.c: * src/preproc/eqn/eqn.ypp: * src/preproc/grn/hdb.cpp: * src/preproc/grn/hpoint.cpp: * src/roff/troff/env.cpp: * src/utils/indxbib/signal.c: Bracket inclusion of config.h with preprocessor test of `HAVE_CONFIG_H` where absent. Use angle bracket rather than double-quote notation for the preprocessor file inclusion. See . 2023-12-07 G. Branden Robinson * src/roff/troff/env.cpp (do_hyphenation_patterns_file): Rename... (read_hyphenation_patterns_from_file): ...to this. (hyphenation_patterns_file, hyphenation_patterns_file_append): Update call sites. (hyphenation_patterns_file): Rename... (load_hyphenation_patterns_from_file): ...to this. (hyphenation_patterns_file_append): ...and this... (append_hyphenation_patterns_from_file): ... to this. (init_hyphen_requests): Update call sites. 2023-12-07 G. Branden Robinson * src/roff/troff/env.cpp (select_hyphenation_language): Demote missing argument diagnostic from error to warning. (add_hyphenation_exceptions, hyphenation_patterns_file) (hyphenation_patterns_file_append): Throw warning in category `missing` if given no arguments. 2023-12-02 G. Branden Robinson [libgroff]: Drop unused function parameter. * src/include/lib.h: Drop `want_unlink` parameter from `xtmpfile` declaration. * src/libs/libgroff/tmpfile.cpp (xtmpfile): Drop same from definition, along with useless (always true) conditional test. 2023-12-02 G. Branden Robinson * src/roff/troff/node.cpp (select_underline_font) (set_font_specific_special_fonts): Tweak diagnostic messages. 2023-12-02 G. Branden Robinson * src/roff/troff/node.cpp (set_special_fonts): Revert part of commit 44db6efc01, 3 November. Stop throwing diagnostic and ignoring request if given no arguments; that's how you clear the global list of fonts designated as special by request (contrast with those that declare themselves as special in their description files). 2023-12-01 G. Branden Robinson [troff]: Fix Savannah #64957 (`device`, `output` broken). The GNU troff(1) internal function `has_arg()` has a side effect of advancing the token pointer (a sort of cursor into the input stream). So when I changed `device_request()` and `output_request()` to use `has_arg()` in commit 429723c3ec (10 November), the first character of the argument got stripped, making it unintelligible to the output driver. * src/roff/troff/input.cpp (device_request, output_request): Drop call of `has_arg()` in favor of `input_stack::peek()`. Manually discard space characters until reaching something else; if that is a newline or EOF, throw warning diagnostic as before. Otherwise, proceed with request processing. Fixes . 2023-12-01 G. Branden Robinson * doc/groff.texi: Fix typos. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-11-29 G. Branden Robinson [troff]: Improve font-related diagnostics. * src/roff/troff/node.cpp (mount_font_at_position) (associate_style_with_font_position, select_underline_font) (define_font_specific_character, remove_font_specific_character) (configure_track_kerning, constantly_space_font): Throw warning in category `missing` if given no arguments. (set_font_specific_special_fonts, set_special_fonts): Demote diagnostic when given no arguments to warning in category `missing`. (mount_font_at_position, associate_style_with_font_position): Report invalid font mounting position in error diagostic. (associate_style_with_font_position): Throw warning in category `missing` if given only one argument. 2023-11-29 G. Branden Robinson [troff]: Improve `hcode` request validation. * src/roff/troff/input.cpp (set_hyphenation_codes): Throw warning diagnostic if no arguments supplied. Throw error diagnostic if there are an odd number of arguments. Check second arguments of pairs for nonsense. 2023-11-29 G. Branden Robinson * src/roff/troff/input.cpp (hyphenation_code): Rename to... (set_hyphenation_codes): ...this. (init_input_requests): Update call site. (set_hyphenation_codes): Declare as `static`; this function doesn't need external visibility. 2023-11-28 G. Branden Robinson * src/roff/troff/input.cpp (composite_request): Rename to... (map_composite_character): ...this. (init_input_requests): Update call site. (map_composite_character): Declare as `static`; this function doesn't need external visibility. 2023-11-28 G. Branden Robinson * src/roff/troff/input.cpp (composite_request): Throw warning diagnostic if either argument is absent; stop relying upon `get_name()` to do so, which is a slight abuse since we don't regard the arguments to this request as "identifiers" {how they're described in its diagnostic messages}. Instead test retrieved symbol for nullity and throw a more contextful message. 2023-11-28 G. Branden Robinson * src/roff/troff/input.cpp (char_flags): Rename to... (set_character_flags): ...this. (init_input_requests): Update call site. (set_character_flags): Declare as `static`; this function doesn't need external visibility. Throw warning diagnositc when no character arguments are present. 2023-11-27 G. Branden Robinson * doc/groff.texi (Miscellaneous): Clarify behavior of `mc`. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-11-27 G. Branden Robinson * src/preproc/html/pre-html.cpp (makeTempFiles): Stop explicitly specifying parameters redundantly with their default values. 2023-11-27 G. Branden Robinson [libgroff]: Trivially refactor `xtmpfile`. * src/include/lib.h: * src/libs/libgroff/tmpfile.cpp (xtmpfile): Boolify `int` parameter and rename it from `do_unlink` to `want_unlink`. * src/libs/libgroff/tmpfile.cpp (xtmpfile): Make null pointer comparison explicit. Recast diagnostic to identify what operation failed instead of cryptically uttering only the name of a standard C library function. 2023-11-20 G. Branden Robinson [man]: Don't enforce tag separation on `IP`. The marker argument to the `IP` macro is often very short, such as a bullet or list enumerator (and in fact we encourage this practice in our style advice, promoting `TP` instead for definition lists and similar). We therefore don't want to enforce the `TS` tag separation for them. `.IP \[bu] 2n` is a perfectly cromulent usage pattern. * tmac/an.tmac: Add new Boolean-valued register, `an*enforce-tag-separation`, to control this aspect of state. Initialize it true. (an-write-paragraph-tag): Multiply `TS` by this register to apply enforcement (or not). (IP): Temporarily clear register while setting paragraph tag. * tmac/groff_man.7.man.in (Paragraphing macros, Options): * NEWS: Update documentation. 2023-11-19 G. Branden Robinson [build]: In source files that #include , ensure that we #include first (with a `HAVE_CONFIG_H` inclusion guard). This should prevent build failures on AIX with Clang++. * src/devices/grodvi/dvi.cpp: * src/devices/grolbp/lbp.cpp: * src/devices/grolj4/lj4.cpp: * src/include/itable.h: * src/include/ptable.h: * src/include/stringclass.h: * src/libs/libbib/linear.cpp: * src/libs/libbib/search.cpp: * src/libs/libdriver/printer.cpp: * src/libs/libgroff/color.cpp: * src/libs/libgroff/font.cpp: * src/libs/libgroff/fontfile.cpp: * src/libs/libgroff/nametoindex.cpp: * src/libs/libgroff/relocate.cpp: * src/libs/libgroff/searchpath.cpp: * src/preproc/eqn/box.cpp: * src/preproc/eqn/delim.cpp: * src/preproc/eqn/pile.cpp: * src/preproc/eqn/script.cpp: * src/preproc/html/pre-html.cpp: * src/preproc/pic/pic.h: * src/preproc/preconv/preconv.cpp: * src/preproc/soelim/soelim.cpp: * src/roff/groff/groff.cpp: * src/roff/troff/troff.h: * src/utils/hpftodit/hpftodit.cpp: * src/utils/indxbib/indxbib.cpp: * src/utils/lkbib/lkbib.cpp: * src/utils/lookbib/lookbib.cpp: * src/utils/tfmtodit/tfmtodit.cpp: Do it. Fixes . Also see . Thanks to Mike Fulton for the report. 2023-11-14 G. Branden Robinson * src/roff/troff/number.cpp: Rename some enumeration constants. - `BAD` -> `INVALID` - `ABSOLUTE` -> `ASSIGN` 2023-11-13 G. Branden Robinson [troff]: Boolify numeric expression-reading functions. * src/roff/troff/hvunits.h (get_vunits, get_hunits): * src/roff/troff/token.h (get_number_rigidly, get_number) (get_integer): * src/roff/troff/number.cpp (get_vunits, get_hunits) (get_number_rigidly, get_number, get_integer): Do it. 2023-11-13 G. Branden Robinson * src/roff/troff/number.cpp (is_valid_expression): Boolify and rename local variable from `overflow` to `had_overflow`. 2023-11-09 Paul Eggert [libbib]: Fix bogus size diagnostic. * src/libs/libbib/index.cpp (index_search_item::check_header): Fix size calculation typo that generated bogus diagnostic "lookbib: error: corrupt header in index file". {Fixes . Problem introduced by me in commit 4fad0459bb, 2022-01-05. -- GBR, 2023-11-10} 2023-11-10 G. Branden Robinson * src/roff/troff/input.cpp (device_request, output_request): Throw warning diagnostic if no arguments given. 2023-11-06 Pim * src/preproc/eqn/lex.cpp: Update internal macro definitions used to construct tilde and under-tilde ("utilde") accents to set them in the roman face, like other accent marks in eqn. * src/preproc/eqn/eqn.1.man (New primitives): Update example. Fixes . Thanks to Damian McGuckin for reporting this problem on the groff mailing list. 2023-11-06 G. Branden Robinson * src/roff/troff/node.cpp (embolden_font): Do nothing if in nroff mode. Fixes . 2023-11-06 G. Branden Robinson * src/roff/troff/input.cpp: Mark `suppression_level`, `have_formattable_input`, `old_have_formattable_input`, and `want_unsafe_requests` as `static` to give them internal visibility only. 2023-11-06 G. Branden Robinson [troff]: Make `in_nroff_mode` visible to other translation units, in preparation for Savannah #64866 fix. Boolify it and rename it from `nroff_mode`. Relocate definition alongside other externally visible symbols. * src/roff/troff/troff.h: Declare it. * src/roff/troff/input.cpp: Do it. (nroff_request, troff_request, do_if_request, do_error): Update references. 2023-11-04 G. Branden Robinson * src/roff/troff/node.cpp (set_font_specific_special_fonts): Declare automatic variable closer to its first point of use. 2023-11-04 G. Branden Robinson [troff]: Trivially refactor dictionary implementation. * src/roff/troff/dictionary.h (class dictionary_iterator): (class object_dictionary_iterator): (object_dictionary_iterator::get): Demote return type of `get()` from `int` to `bool`. (class object_dictionary): Demote return type of `alias()` from `int` to `bool`. (class object): Rename member variable `rcount` to `refcount`. * src/roff/troff/dictionary.cpp (is_good_size): (dictionary_iterator::get): (object_dictionary::alias): Demote return type from `int` to `bool`. Update return value literals. (object::object): (object::add_reference): (object::remove_reference): Rename member variable `rcount` to `refcount`. 2023-11-03 G. Branden Robinson [troff]: Implement new `phw` request. * src/roff/troff/env.cpp (print_hyphenation_exceptions): Add. (init_hyphen_requests): Wire up `phw` request name to `print_hyphenation_exceptions()`. * doc/groff.texi (Manipulating Hyphenation, Debugging): * man/groff.7.man (Request short reference): * man/groff_diff.7.man (New requests): * NEWS: Document it. Inspired by a debugging process (that ultimately involved input character encoding confusion) on the groff mailing list, raised by Walter Alejandro Iglesias. See and and follow-ups. It my opinion it should have been easier to ask the formatter where it thought a hyphenation exception's hyphenation points were. 2023-11-03 G. Branden Robinson * src/roff/troff/reg.cpp (alter_format): Slightly refactor. Push more diagnostic work to `tok.description()`, since it is capable of describing any token. 2023-11-03 G. Branden Robinson * doc/groff.texi (Setting Registers, Strings): * man/groff.7.man (Request short reference): Fix errors; the `rm` and `rr` requests take an arbitrary number of arguments. Ossanna nroff and DWB nroff both behave this way. Nor did CSTR #54, in its 1976 or 1992 revisions, document this. Problem appears to date back "forever", to the oldest revisions of these files in our Git repository. 2023-11-03 G. Branden Robinson * src/roff/troff/env.cpp: Drop parameter names from prototypes, in keeping with the Stroustrup-style C++ used in most of groff. 2023-11-03 G. Branden Robinson * src/roff/troff/env.cpp: Clarify diagnostic and trivially refactor. (hyphen_word): Rename this... (add_hyphenation_exceptions): ...to this. (init_hyphen_requests): Update call site. (add_hyphenation_exceptions): Make error diagnostic more helpful. 2023-11-03 G. Branden Robinson * src/roff/troff/env.cpp: Add diagnostic and trivially refactor. (set_hyphenation_language): Rename this... (select_hyphenation_language): ...to this. (init_hyphen_requests): Update call site. (select_hyphenation_language): Throw more helpful diagnostic when not given an argument; promote "missing identifier" warning to a context-rich error. 2023-11-03 G. Branden Robinson * doc/groff.texi (Line Continuation): Drop concept index entry regarding use of `\R` escape sequence after `\c` on an input line. There is no longer anything special to say; `\R` works as otherwise documented. Formerly (pre-1.23.0), our Texinfo manual suggested that nothing on an input line after `\c` was interpreted, which was false. Nothing after it is _formatted_. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-11-03 G. Branden Robinson * src/roff/troff/node.cpp (set_font_specific_special_fonts) (set_special_fonts): Throw error when invoked with insufficient arguments. 2023-11-02 G. Branden Robinson * doc/groff.texi: Add numerous @anchor commands to aid resolution of hyperlinks into this manual based on the node names used in groff 1.22.4 (and for several years previous, as the document saw little change for a while). Some node names, I did not add anchors for; they correspond either to material that we've dropped altogether from our Texinfo manual (mainly a somewhat stale duplicate of groff_man(7), which no GNU Info partisan would read anyway) or were empty stubs anyway. An HTTP 404 response is therefore honest in such cases. Fixes . Thanks to Ingo Schwarze for the report, Gavin Smith for proposing a resolution technique, and Thérèse Godefroy for assistance cleaning up our Texinfo manual's hyperlinks on the GNU web site. 2023-10-21 G. Branden Robinson * tmac/an.tmac (TH): * tmac/mdoc/doc-common (doc-set-up-titles): Update default footer trap location to leave a half-inch margin below the footer, not 1/2 inch minus one vee. * tmac/an.tmac (PT): * tmac/mdoc/doc-common (doc-header): Adjust vertical spacing at page top to leave a half-inch above the header, and 1 inch distance from the page top to the top of the running text. * tmac/groff_man.7.man.in (Options) <-rFT>: * tmac/groff_mdoc.7.man (Options) <-rFT>: Document new default. * tmac/tests/an_P-register-works.sh: * tmac/tests/andoc_P-register-works.sh: * tmac/tests/doc_P-register-works.sh: Update test expectations. * NEWS: Add item. 2023-10-16 G. Branden Robinson * tmac/refer.tmac (ref*add-J, ref*add-D, ref*add-E, ref*add-G) (ref*add-B, ref*add-O, ref*add-A, ref*add-V, ref*add-N) (ref*add-dflt): Fix thinko in `ie` predicates. The true branches of the conditionals were never taken because the condition was consistently misspelled, testing for the existence of, for example, a register named "ef*spec!J:\\$1" (where `\\$1` _would_ be interpolated, but not improve chances of success). Fix by using the `d` conditional operator as obviously intended. This enables some refer(1) formatting customization that was unfortunately inoperative. Problem appears to date back to commit 3bab8e6fe5, 2011-01-28. Fixes . Thanks to an anonymous bug submitter for the report and the patch. 2023-10-13 G. Branden Robinson * tmac/mdoc/doc-ditroff (doc-Ev-font): * tmac/mdoc/doc-nroff (doc-Ev-font): Change typeface for environment variable identifiers from (Courier) roman to italic, for consistency with man(7). 2023-10-11 G. Branden Robinson * font/devps/generate/Makefile (zapfdr.afm): Fix typo in dependency name. Problem introduced by me in commit 2566b64e0b, 13 March 2022, which claimed "[s]hould not cause regressions because the Make targets invoked are never called during a build {they are isolates that you have to manually name on the command line}." Thus was fortune's hostage seized. Apparently OpenSUSE uses this Makefile as part of its "ghostscript-fonts- grops" package build. (Fair enough--we _do_ install it.) 2023-10-07 G. Branden Robinson * src/roff/troff/input.cpp (while_break_request) (while_continue_request): Clarify diagnostic messages. 2023-10-07 G. Branden Robinson [troff]: Trivially refactor. Rename and boolify some file-local functions. * src/roff/troff/input.cpp (get_delim_number): Rename this... (read_delimited_number): ...to this, and boolify it. The idea behind "read" instead of "get" is that the latter more strongly implies (to me) that the value being "got" is returned by the function. But for `read_delimited_number`, the number is stored {after possible unit conversion} in one of the function parameters. (get_delim_name): Rename this... (get_delimited_name): ...to this. (token::next): Update call sites. 2023-10-07 G. Branden Robinson [troff]: Trivially refactor. Rename local `start` variables to `start_token` for better code readability. * src/roff/troff/input.cpp (do_overstrike, do_bracket) (do_name_test, do_expr_test, do_zero_width, get_delim_number) (get_line_arg, get_delim_name, do_register, do_width) (do_special, read_draw_node): * src/roff/troff/reg.cpp (inline_define_register): Do it. 2023-10-07 G. Branden Robinson [troff]: Trivially refactor. Rename Boolean-valued member function to read like a logical predicate. * src/roff/troff/token.h (token::usable_as_delimiter): Rename... (token::is_usable_as_delimiter): ...declaration to this. * src/roff/troff/input.cpp (token::usable_as_delimiter): (token::is_usable_as_delimiter): ...same for implementation. * src/roff/troff/env.cpp (number_lines): * src/roff/troff/input.cpp (do_expr_test, get_delim_number) (get_line_arg, read_size, do_register, do_if_request) (read_draw_node): * src/roff/troff/node.cpp (has_font, embolden_font): Update call sites. 2023-10-07 G. Branden Robinson * src/roff/troff/input.cpp (token::next, device_macro_request): Recast language of one of groff's more notorious diagnostics, eliminating the much-abused word "transparently". Also name the offending token. It is difficult to overstate how unhelpful diagnostic messages are when they know precisely what is wrong but refuse to tell the user. 2023-10-07 G. Branden Robinson * src/roff/troff/input.cpp (token::next): Tweak language of diagnostic message when encountering unsupported escape sequence. * doc/groff.texi (Using Escape Sequences): Update example accordingly. 2023-10-07 G. Branden Robinson * src/roff/troff/env.cpp (font_change): Trivially refactor, renaming this function... (select_font): ...to this. Doing so aligns with other use of the term "select" in groff font documentation. Further, when formatting for typesetters, fonts can be "changed" in a different sense by altering height, slant, (constancy of) spacing, and magnification. Also mark function as "static"; it needs no visibility outside this translation unit. 2023-10-07 G. Branden Robinson [troff]: Throw error diagnostic on attempt to select a font named "DESC". That will never work. * src/roff/troff/env.cpp (font_change): * src/roff/troff/input.cpp (token::next): Do it. 2023-09-25 G. Branden Robinson [man]: Add bespoke handling of `lbp` device. * tmac/an.tmac (EX): Refactor, using new register `an*unmap-fonts` to keep track of whether we're remapping fonts instead of switching families. Like TeX DVI, the LBP output device lacks a (complete) monospaced font family. In EX/EE examples on that device, remap the bold-italic face to italics. (EE): Revert remappings and remove `an*unmap-fonts` register. Prompted by discussion with pandoc developers at . 2023-09-25 G. Branden Robinson [eqn]: Make synopsis, usage message more helpful. * src/preproc/eqn/eqn.1.man (Synopsis): Use descriptive phrases as metasyntactic variables. * src/preproc/eqn/main.cpp (usage): Sync with the foregoing. 2023-09-25 G. Branden Robinson * src/preproc/pic/troff.cpp (strsame): Add utility function for comparing two C strings for identical content, handling null pointer arguments as `strcmp()` does not. (troff_output::set_location): Refactor; write the two-argument form of the `lf` request if the current and last seen file names _don't_ match. Problem introduced by me in commit 705be31107, 29 July. Also fix heap memory leak when repeatedly updating `troff_output::last_filename` member variable. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-09-25 G. Branden Robinson [pic]: Save and restore stroke and fill colors when entering and leaving, respectively, preprocessed regions. * src/preproc/pic/troff.cpp: Define C/C++ preprocessor macros to house names of *roff strings storing this information. (troff_output::start_picture): Save stroke and fill colors. (troff_output::finish_picture): Restore stroke and fill colors. Fixes . Thanks to Dave Kemper for the report and testing this code change. 2023-09-22 G. Branden Robinson * doc/doc.am (doc/meintro_fr.ps): Depend on tbl, resolving race in sufficiently parallelized builds. Overlooked in commit 92349ae223, 2022-05-30. Fixes . Thanks to Alexander Kanavin for the report. 2023-09-16 G. Branden Robinson * doc/groff.texi (I/O) : Fix error. These requests do _not_ alter the argument in an attempt to locate a file corresponding to it. (That is, one says "groff -m trace" but ".mso trace.tmac".) 2023-09-16 G. Branden Robinson * doc/doc.am (doc/webpage.ps, doc/webpage.html): Update and parallelize target dependencies. Resolve race by requiring "grn" and "soelim" to be built first. Also add dependency on `$(TMAC_PACKAGE_MS)`. Fixes . Thanks to Alexander Kanavin for the report. 2023-09-15 G. Branden Robinson * src/roff/troff/input.cpp (charinfo_to_node_list): Trivially refactor. Rename `old_escape_char` to `previous_escape_char`. 2023-09-14 G. Branden Robinson [troff]: Trivially refactor. Rename `ascii_output_flag` to `want_abstract_output`. * src/roff/troff/input.cpp (main, init_registers): * src/roff/troff/node.cpp (init_output): * src/roff/troff/troff.h: Do it. 2023-09-14 G. Branden Robinson * src/roff/troff/input.cpp: Trivially refactor. Rename `unsafe_flag` to `want_unsafe_requests`. (pipe_source, open_request, opena_request, pipe_output): (system_request, main, init_input_requests): Do it. (init_input_requests): Migrate from `readonly_register` to `readonly_boolean_register`. 2023-09-14 G. Branden Robinson [troff]: Add class for Boolean-valued read-only registers. Their values have been stored variously in `readonly_register`, which has full `int` range, and in normal string registers, as with `.A`. * src/roff/troff/reg.h (class readonly_boolean_register): Add. * src/roff/troff/input.cpp (readonly_boolean_register::readonly_boolean_register) (readonly_boolean_register::get_string): Define. 2023-09-14 G. Branden Robinson * src/roff/troff/input.cpp: Trivially refactor. Rename some functions and recast diagnostic messages. (open_mac_file): (process_macro_file): Rename these... (open_macro_package): (process_macro_package_argument): ...to these. As our documentation now makes more clear, "macro packages" are a subset of "macro files", and have additional rules regarding their handling (where they are sought and how their names are rewritten). 2023-09-14 G. Branden Robinson * src/roff/troff/input.cpp: Trivially refactor. Rename `begin_level` to `suppression_level`. (do_suppress, init_input_requests): Do it. 2023-09-14 G. Branden Robinson * src/roff/troff/input.cpp (input_stack::get, token::next) (process_input_stack, do_width, do_suppress, do_if_request) (charinfo_to_node_list, read_color_draw_node): Trivially refactor. Rename symbols and demote their types from `int` to `bool`. - `have_input` -> `have_formattable_input` - `old_have_input` -> `old_have_formattable_input` 2023-09-14 G. Branden Robinson [troff]: Trivially refactor. Rename `debug_state` symbol to `want_html_debugging` and demote its type from `int` to `bool`. * src/roff/troff/input.cpp: * src/roff/troff/mtsm.cpp: Do it (declarations). * src/roff/troff/input.cpp (input_stack::finish_get) (input_stack::push, process_input_stack, main) (charinfo::get_flags, charinfo::contains): Do it. * src/roff/troff/node.cpp: Drop unused declaration. 2023-09-14 G. Branden Robinson [troff]: Trivially refactor. Rename `break_flag` symbol to `want_break` and demote its type from `int` to `bool`. * src/roff/troff/env.h: * src/roff/troff/input.cpp: Do it (declarations). * src/roff/troff/div.cpp (begin_page, space_request) (flush_output): * src/roff/troff/env.cpp (fill, no_fill, center, right_justify) (indent, temporary_indent, do_break_request): * src/roff/troff/input.cpp (process_input_stack) (macro_iterator::macro_iterator, copy_file, transparent_file): Do it. 2023-09-12 G. Branden Robinson * tmac/doc.tmac (doc-str-Ar-default): Use unbreakable space between "file" and ellipsis. 2023-09-06 G. Branden Robinson * tmac/groff_me.7.man: Fix error in summary of "safe" groff requests; `ce`, `rj`, and `ul` count (productive) _input_ lines, not output lines. 2023-09-05 G. Branden Robinson [libgroff]: Explicitly construct `default_color`. Without explicit construction, link-time optimization feels free to send this object into the twilight zone, subtly changing the semantics of the current and previous stroke and fill colors, making their registers interpolate "default" instead of empty strings. * src/libs/libgroff/color.cpp: Construct `default_color` with empty string instead of leaving uninitalized. Problem appears to date back to commit ea5a42d080, 2002-01-24. Fixes . Thanks to Günther Noack for the report, a good reproducer, identification of `-flto=auto` as the free variable in our experiments, and artifact production beyond the call of duty; Peter Schaffter for ruling out macro programming goofs; and Deri James for shrewd pointers in the right direction (twice!). 2023-09-05 G. Branden Robinson [troff]: Regression-test Savannah #64421. * src/roff/groff/tests/detect-evil-link-time-optimizer.sh: Do it. * src/roff/groff/groff.am (groff_TESTS): Run test. 2023-09-05 G. Branden Robinson * tmac/e.tmac (np, bu): Throw diagnostic if given arguments; we document these as being "like" `ip`, but they aren't with respect to argument handling. (sk): Genericize existing diagnostic to use `\$0` to report its own name. 2023-09-04 G. Branden Robinson [ms]: Doug McIlroy pointed out a hazard of the Berkeley DD display distance feature when footnotes end with displays; offer advice. * doc/ms.ms: Document caveat with display usage in footnotes. Fixes . 2023-09-03 G. Branden Robinson * tmac/doc.tmac (doc-str-Ar-default, Ar): Stop setting ellipsis in italics. * tmac/groff_mdoc.7.man (Arguments): De-document apology for former behavior. 2023-09-01 G. Branden Robinson * src/devices/grotty/tests/osc8_works.sh: Port test to newer conventions. 2023-09-01 G. Branden Robinson [grog]: Drop `--ligatures`, `--run` support. Simulate the former (which was specific to the "pdf" output device) with the option sequence "-P -U -P y", and the latter by using the command substitution feature of your shell; see section "Examples" of groff(1). * src/utils/grog/grog.pl: Do it. * src/utils/grog/grog.1.man: De-document them. * NEWS: Add item. 2023-09-01 G. Branden Robinson [tmac]: Drop AT&T troff font aliases/remappings. Now that we have working diagnostics for font selection problems, users will be made aware of portability issues and can address them where they feel appropriate; in a document, in the "troffrc" file, or by modifying these files. * tmac/X.tmac: * tmac/dvi.tmac: * tmac/html.tmac: * tmac/lbp.tmac: * tmac/lj4.tmac: * tmac/ps.tmac: Do it. * NEWS: Add item. 2023-08-31 G. Branden Robinson * tmac/tests/localization-works.sh: Test hyphenation modes for Spanish and Russian. 2023-08-31 G. Branden Robinson * tmac/es.tmac: Correct hyphenation mode used when suppressing hyphenation before traps. A "base" mode of 1 should map to 2, not to 6, as (possibly) copied-and-pasted from "fr.tmac". 2023-08-29 G. Branden Robinson [tmac]: Improve robustness of mm translations. * tmac/cs.tmac (\*[locale]-qrf): * tmac/de.tmac (\*[locale]-qrf): * tmac/es.tmac (\*[locale]-qrf): * tmac/fr.tmac (\*[locale]-qrf): * tmac/it.tmac (\*[locale]-qrf): * tmac/ru.tmac (\*[locale]-qrf): * tmac/sv.tmac (\*[locale]-qrf): Define string contents using `\E` instead of `\\`, for better robustness. See our Texinfo manual, node/section "Copy mode". 2023-08-29 G. Branden Robinson [tmac]: Rename test file for consistency. * tmac/tests/doc_synopsis_is_not_adjusted.sh: Rename this... * tmac/tests/doc_synopsis-is-not-adjusted.sh: ...to this. * tmac/tmac.am (tmac_TESTS): Reflect rename. 2023-08-29 G. Branden Robinson [libdriver, grohtml]: Revise diagnostics. * src/devices/grohtml/post-html.cpp (html_printer::set_number_reg): * src/libs/libdriver/printer.cpp (printer::set_numbered_char): Use wording consistent with our documentation if \N'xxx' fails. 2023-08-28 G. Branden Robinson * src/include/lib.h (array_size): Rename to... (array_length): ...this. * src/preproc/eqn/box.cpp (set_param, reset_param, get_param) (init_param_table, free_param_table): Migrate call sites. Thanks to Alex Colomar for the discussion. 2023-08-28 G. Branden Robinson * Makefile.am (EXTRA_DIST): Ship ancient groff ChangeLog files split off from ChangeLog.115 (.old, .111, .112, .113, .114). 2023-08-27 G. Branden Robinson * src/roff/troff/node.cpp (translate_font): Validate arguments. 2023-08-27 G. Branden Robinson [troff]: Trivially refactor; add utility function. * src/roff/troff/node.cpp (is_nonnegative_integer): New function tests C-style string for validity as such; promoted from open code because I just spotted a second place we can use it. 2023-08-27 G. Branden Robinson [troff]: Trivially refactor; demote `int`-returning functions to Boolean-returning ones and rename. - check_font -> is_font_name - check_style -> is_abstract_style * src/roff/troff/node.h: * src/roff/troff/node.cpp: Do it. * src/roff/troff/env.cpp (is_family_valid): * src/roff/troff/input.cpp (do_if_request): Update call sites. 2023-08-27 G. Branden Robinson * src/preproc/eqn/main.cpp (main): Trivially refactor; demote `int` `load_startup_file` to Boolean `want_startup_file`. 2023-08-25 G. Branden Robinson [eqn]: Implement "reset" keyword. * src/preproc/eqn/box.cpp: Use `static` storage class for parametric defaults, moving them to file scope from global. Rename `param_table` array of structs to `default_param_table`. Use the length of this array for iteration since it is known at compile time. Convert `param_table` to a null pointer. (set_param): Update diagnostic message text. (reset_param): New function restores a rendering parameter in `param_table` to its corresponding value in `default_param_table`. (get_param): New function accesses `param_table` entries via a C string rather than integer lvalues. Use `assert()` to dump core if the parameter name is not recognized; this function is never called by the parser, but only by static logic. Add `fatal()` under this same circumstance, in case anyone `#define`s `NDEBUG`. (init_param_table): New function populates the (mutable) `param_table` from the (immutable) `default_param_table` using heap storage. (free_param_table): New function avoids memory leak by freeing the heap storage allocated for `param_table`. * src/preproc/eqn/eqn.h: Drop external declaration of `nroff`. * src/preproc/eqn/eqn.ypp: Add new token `RESET`. * src/preproc/eqn/lex.cpp: Map C string "reset" to token `RESET` in untagged struct `token_table`. (do_reset): Handle new keyword; if argument valid, call `reset_param()` with it. (yylex): Hook up token `RESET` to `do_reset()`. * src/preproc/eqn/box.h: Declare `reset_param()`, `get_param()`, `init_param_table()`, and `free_param_table()`. * src/preproc/eqn/main.cpp (main): Call `init_param_table()` when starting up. Register `free_param_table()` with `std::atexit()`. * src/preproc/eqn/pbox.h: Drop external declarations of rendering parameters. * src/preproc/eqn/delim.cpp (build_extensible) (define_extensible_string, delim_box::compute_metrics): * src/preproc/eqn/lex.cpp (yylex): * src/preproc/eqn/limit.cpp (limit_box::compute_metrics): * src/preproc/eqn/list.cpp (compute_spacing): * src/preproc/eqn/other.cpp (accent_box::compute_metrics) (overline_char_box::overline_char_box): (overline_box::compute_metrics, overline_box::output): (underline_char_box::underline_char_box): (underline_box::compute_metrics, underline_box::output): (fat_box::compute_metrics, fat_box::output): (vcenter_box::compute_metrics): * src/preproc/eqn/over.cpp (over_box::compute_metrics): (over_box::output): * src/preproc/eqn/pile.cpp (pile_box::compute_metrics): (matrix_box::compute_metrics, matrix_box::output): * src/preproc/eqn/script.cpp (script_box::compute_metrics): * src/preproc/eqn/sqrt.cpp (sqrt_box::compute_metrics): Migrate from lvalue access to `get_param()` for parameter retrieval. * src/preproc/eqn/eqn.1.man (Customization): Document it. * src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh: Test it. * src/preproc/eqn/eqn.am (eqn_TESTS): Run test. * NEWS: Add item. Fixes . 2023-08-24 G. Branden Robinson * src/preproc/eqn/box.cpp (set_param): Migrate iteration style to use new `array_size()` instead of null pointer guards at the end of an array of structs. 2023-08-24 G. Branden Robinson [src]: Add template function for obtaining the length of an array. * src/include/lib.h (array_size) [__cplusplus]: Do it. 2023-08-22 Dave Kemper * doc/pic.ms: Document `PY` macro, new to groff 1.23.0. Fixes . 2023-08-22 Dave Kemper * tmac/pic.tmac (PY): Call `PF` rather than duplicating its {three bytes of} code. This is almost too trivial to DRY, but {1} the new form is a cue to the human reader that .PY is meant to be an alias of .PF; and {2} .PE was already defined as a variant of .PF with an explicit call to it, so this makes the .PY definition conform to that precedent. 2023-08-22 G. Branden Robinson * tmac/an.tmac: Stop setting `an*can-hyperlink` if formatting for PDF; we don't yet have support for this implemented, leading to vanishing text when the `U` register is true and, for instance, `UR`/`UE` are called with no link text. Fixes . 2023-08-21 G. Branden Robinson * doc/doc.am (PROCESSEDFILES_DEPS_HTML): Depend on tmac/html{,-end}.tmac. (PROCESSEDFILES_DEPS_PDF): Depend on tmac/pdf.tmac. (PROCESSEDFILES_DEPS_PS): Depend on tmac/ps.tmac. (PROCESSEDFILES_DEPS_TXT): Depend on tmac/tty.tmac. 2023-08-21 G. Branden Robinson * src/devices/grops/ps.cpp (ps_printer::define_encoding): * src/devices/grops/psrm.cpp (resource_manager::output_prolog) (resource_manager::supply_resource): Report more intelligible diagnostics when libgroff's `font::open_file()` returns a null pointer without setting `errno`. The only way this can happen is if it rejected the file name for containing a slash, thus attempting directory traversal (recall Savannah #61424). Also fix code style nits: explicitly `#include` errno.h C standard library header, align style of null pointer checks, and stop explicitly setting `errno` to zero before (indirectly) calling `fopen()`; we inspect `errno`'s value only under a documented error condition (a null stream pointer). See errno(3). * NEWS: Add item; we should have mentioned this (and produced these better diagnostics) when 1.23.0 was released. Distributors may find this change desirable to backport. Fixes . Thanks to Phil Chadwick for the report and Deri James for swiftly finding a correct workaround that suited the reporter. 2023-08-19 G. Branden Robinson * src/roff/troff/node.cpp (class tfont_spec): Stop declaring copy constructor. The implicitly defined one suffices. Resolves "-Wdeprecated-copy" warning from GCC. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-08-16 G. Branden Robinson * configure.ac: Include paper format in configuration report. * m4/groff.m4 (GROFF_PAGE): Slightly refactor, and help users to figure out how the "configure" script decided upon the paper format it did by supplementing the `AC_MSG_RESULT` message. If not falling back to the "letter" default or honoring a command-line setting (e.g., "./configure PAGE=a4"), report which file or command was used to infer the paper locale. Apply DRY principle by using shell variables more. Prompted by discussion with Damian McGuckin on the groff list. 2023-08-12 G. Branden Robinson Our "Makefile.am" defines an `RM` macro if make(1) itself does not, and our Automake files employ it extensively; sweep up the stragglers. * font/devpdf/devpdf.am (mostlyclean_devpdf_extra) (uninstall_devpdf): * src/devices/xditview/xditview.am (uninstall_xditview): * src/libs/libgroff/libgroff.am (install_charset_data): * src/roff/nroff/nroff.am (nroff): * src/utils/indxbib/indxbib.am (install_indxbib): (uninstall_indxbib): Do it. 2023-08-12 G. Branden Robinson * src/utils/indxbib/indxbib.am (install_indxbib): Use `$(LN_S)`, not `ln -s`. 2023-08-11 G. Branden Robinson [eqn]: Trivially refactor. * src/preproc/eqn/main.cpp (input_char_description): Migrate to `const`-qualified object to size an array of length computed at compile time and avoid repeating lengthy expression. 2023-08-10 G. Branden Robinson [man]: Add new `TS` register to configure required separation between a (`IP`, `TP`) paragraph's tag and its body, and change the default amount used for this purpose from 1n to 2n. Retire private register `an-tag-separation` in favor of `TS`. * tmac/an.tmac: Assign `TS` value of 2n if not already defined. (TH): Stop setting the default here. (an-write-paragraph-tag): Use it. Fixes . Thanks to Alex Colomar for the report. 2023-08-09 G. Branden Robinson [man,mdoc]: Change base paragraph indentation to 5n. This corresponds to the amount used by historical man(7) and mdoc(7) implementations going back to Unix Version 7 and 4.3BSD-Reno, respectively. * tmac/an.tmac: Introduce new interface register, `BP`, to control the base paragraph indentation amount. Formerly, `IN` determined it, the default relative inset amount, and the default amount of additional indentation used by `IP`, `TP`, and the deprecated `HP`. (an-reset-margin-and-inset-level, SH, SS): Use it. * tmac/doc.tmac: Introduce `BP` register, replacing `IN`. * tmac/mdoc/doc-common (Sh): Use it. * src/preproc/tbl/tests/save-and-restore-tab-stops.sh: * tmac/tests/an-ext_SY-and-YS-work.sh: * tmac/tests/an_TH-repairs-hy-damage.sh: * tmac/tests/an_UE-breaks-before-long-URIs.sh: * tmac/tests/an_adjust-link-text-correctly.sh: * tmac/tests/an_link-macros-work-in-paragraph-tags.sh: * tmac/tests/an_use-input-traps-correctly.sh: * tmac/tests/andoc_flush-between-packages.sh: * tmac/tests/doc_Mt-works.sh: * tmac/tests/doc_indents-correctly.sh: * tmac/tests/doc_synopsis_is_not_adjusted.sh: Update amount of indentation expected in output. * tmac/groff_man.7.man.in: * tmac/groff_mdoc.7.man: Document it. Fixes . Thanks to Thorsten Glaser and Ingo Schwarze for the discussion. 2023-08-05 G. Branden Robinson [troff]: Add paranoia to `token::description()`. * src/roff/troff/input.cpp (token::description): Clear static buffer on entry to function to avoid another problem like Savannah #62813. 2023-08-05 G. Branden Robinson [troff]: Trivially refactor (`define_color`). * src/roff/troff/input.cpp (define_color): Throw more helpful diagnostics when this 3-5-argument-taking request is not given enough of them. Rename internal variable `style` to `color_space` to make it less opaque. 2023-08-05 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/input.cpp (input_char_description): Migrate to `const`-qualified object to size an array of length computed at compile time and avoid repeating lengthy expression. 2023-08-04 G. Branden Robinson * man/groff_diff.7.man: Drop displayed examples. Man pages' honor as references, not tutorials, has been vigorously championed on the groff mailing list. Accordingly, drop displayed examples from this page; all are available in groff's Texinfo manual. * NEWS: Add item in case people wonder where they've gone. 2023-08-04 G. Branden Robinson [tbl]: Fix staggering of text block entries. * src/preproc/tbl/table.cpp: Add C preprocessor macro storing a "text block staggering macro" name. (block_entry::position_vertically): Call it in generated output with a negative half-vee motion. (block_entry::position_vertically, left_block_entry::print) (right_block_entry::print, center_block_entry::print) (alphabetic_block_entry::print): Call it in generated output with a positive half-vee motion. (table::init_output): Write out its definition in generated output. It wraps the `sp` request. If we're in a diversion, use the `\!` technique to recursively call ourselves and bubble up the spacing request a diversion level (spacing requests of anything other than 1v are ignored in diversions). Otherwise, invoke the request. Fixes a.k.a. Debian #1038391. Thanks to наб for the report and a good test case. 2023-08-04 G. Branden Robinson [tbl]: Regression-test Debian #1038391. * src/preproc/tbl/tests/\ align-staggered-text-blocks-correctly.sh: Do it. * src/preproc/tbl/tbl.am (tbl_TESTS): Run test. 2023-08-04 G. Branden Robinson [man]: Deprecate `SB` macro. It is a SunOS 4.0 (1988) extension that in most contexts, does nothing you can't achieve with `SM` and `B` together (in either order). Study of the SunOS 4 man page corpus suggests a reason for its introduction of this macro: use of `SB` immediately after `TP` was common (610 out of 2,111 occurrences). The problem with `TP` and the mechanism suggested above is that input traps in troff normally ignore the `\c` escape sequence, the use of which would be necessary to get the desired effect. In groff since 1.22.4, the man(7) `TP` macro uses GNU troff's `itc` request, which _does_ respect `\c`. (mandoc(1) 1.14.2 and later behave compatibly with groff man >= 1.22.4.) Solaris 11 switched to groff as its troff implementation, so there is no reason for newly written or currently maintained man pages to employ `SB`. * tmac/an.tmac (SB): Throw deprecation warning. * tmac/groff_man.7.man.in (Description): Move macro from table to deprecation list. (Font style macros): Move description from here... (Deprecated features): ...to here. (Portability): Drop mention, since we don't encourage people to use it at all. Fixes . 2023-08-03 G. Branden Robinson * src/roff/troff/node.cpp (zoom_font): Validate arguments more. Invalid inputs could have bizarre consequences. Fixes . 2023-08-02 G. Branden Robinson Drop tmac/fixmacros.sed. We hadn't ever actually installed it; it was provided only in our distribution archives, as far back as our history indicates. * tmac/fixmacros.sed: Delete. * tmac/tmac.am (EXTRA_DIST): Stop shipping it. * PROBLEMS: Recast and update relevant item description. This is the only place the file was documented. 2023-07-31 G. Branden Robinson * tmac/doc.tmac (doc-parse-args): Set ellipses in roman. Thanks to Lennart Jablonka for reminding me of this issue on the linux-man mailing list. 2023-07-29 G. Branden Robinson * src/libs/libgroff/fontfile.cpp: Update `#include`s. (font::open_file): Do more parameter validation. Don't construct a file name for opening from components that are null pointers. Also `assert()` this since it should be an invariant. Migrate from `sprintf()` to `snprintf()`; we have the size of the destination buffer handy. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-07-29 G. Branden Robinson * src/preproc/pic/troff.cpp (troff_output::set_location): Do more parameter validation. Generate the two-argument form of the `lf` request only if the C string holding the new file name to write isn't a null pointer. Also `assert()` this since it should be an invariant. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-07-28 G. Branden Robinson [gxditview]: Add accelerators for "Print" action. An apparent bug in a support library affects some users; it disables gxditview's pop-up menu. (The menu pops up, but no item can be selected.) Also, "Print" was the only action for which no keyboard accelerator was defined. "p" (unmodified) is already bound to `PreviousPage()`; bind "p" with any of the modifiers Shift, Ctrl, Alt, or Meta to `Print()`. * src/devices/xditview/GXditview.ad: Do it. * src/devices/xditview/gxditview.1.man: Document it. 2023-07-28 G. Branden Robinson * tmac/es.tmac: Scream the entire word "BIBLIOGRAPHÍA", instead of dying off to a murmur at the last two letters. 2023-07-26 G. Branden Robinson [troff]: Add new `.trap` built-in register. * src/roff/troff/div.h (class diversion, class macro_diversion, class top_level_diversion): Declare new member function `get_next_trap_name`. * src/roff/troff/div.cpp (macro_diversion::get_next_trap_name): New member function returns name of diversion trap if any, and if its position is greater than the vertical drawing position, otherwise an empty string. (top_level_diversion::get_next_trap_name): New member function returns the name of the next vertical position trap, if any, otherwise an empty string. (class next_trap_name_reg): New class has one member, a `get_string()` function. (next_trap_name_reg::get_string): New function. (init_div_requests): Add `.trap` to the register dictionary and wire it up to `next_trap_name_reg`. * doc/groff.texi (Page Location Traps): * man/groff.7.man (Read-only registers): * man/groff_diff.7.man (New registers): Document it. * src/roff/groff/tests/dot-trap_register_works.sh: Test it. * src/roff/groff/groff.am (groff_TESTS): Run test. * NEWS: Add item. Fixes . Thanks to Dave Kemper for feedback. 2023-07-21 G. Branden Robinson * src/roff/troff/node.cpp (unbreakable_space_node::tprint): Write word marker ('w' command) to output. * NEWS: Add item. Fixes . 2023-07-21 G. Branden Robinson * tmac/papersize.tmac: Set register `#R_MARGIN` for mom(7)'s benefit, not `R_MARGIN`, which it neither tests nor interpolates as a register. Continues commit bed42a77cb, 2022-11-16. 2023-07-21 G. Branden Robinson * tmac/papersize.tmac: If the `paper` string is defined when this macro file is loaded, set the `O` (mm page offset register) independently of the `W` (mm line length ["width"] register). 2023-07-21 G. Branden Robinson [docs]: Revise material in our Texinfo manual. * doc/groff.texi (Manipulating Filling and Adjustment): Document a CSTR #54 erratum; the arguments to the `ss` request are in 12ths of the selected font's `spacewidth` parameter, not 36ths of an em. Drop false claim of rounding of `.ss` and `.sss` register values on terminal devices. (Rounding of any resulting adjustment quantities might still occur, but this is part of the usual application of motion quanta and not particular to the `ss` request.) Characterize "undiscardable space" as "horizontal motion" to help the reader acquire this essential distinction between horizontal spaces and motions. (Manipulating Spacing): Clarify behavior. Distinguish `sp` request from `\v` escape sequence and cross reference the latter. Recast to squeeze presentation of `ss` request onto one U.S. letter page when typeset. Drop (commented-out) trivial example of `ls` usage in favor of new example illustrating some macros using `vs` instead, for pedagogical purposes and to eat up a lot of dead space on the page caused by a later lengthy example. (Knuth-Plass for the...uh...win.) (Page Control): Stop (arguably) mis-applying the term "widow", in favor of less metaphorical language. Extend Woolf example to narrow the seas of vertical space produced by TeX's formatting of the page it occupies. (Our blanched discourse can use the purple prose.) (Page Motion): Fix straggling use of "escape" as a noun; we prefer "escape sequence". * man/groff.7.man (Request short reference) : Sync. Fixes . Thanks to Dave Kemper for the report and review. 2023-07-25 G. Branden Robinson * src/roff/troff/env.cpp (environment::print_env): Fix error in report. The units of {minimum inter-word, additional inter-sentence} space size are 12ths of the font's "spacewidth" parameter, not 36ths of an em. Consider the following input. .\" groff -T ps -Z .nf foo bar1 .ss 12 foo bar2 \" cases 1 and 2 are the same foo\h'1m/3u'bar3 \" wider than 1 & 2 foo\h'1m/36u*12u'bar4 \" slightly narrower than case 3 .ss 11 foo bar5 \" narrower than case 1 (as expected) foo\h'1m/36u*11u'bar6 \" between cases (1,2) and 4 2023-07-19 G. Branden Robinson * tmac/papersize.tmac: If not already defined, set `PO` register to one inch to integrate with ms(7), man(7), and mdoc(7). 2023-07-18 G. Branden Robinson [ms]: Improve documentation of pic(1) usage. * tmac/groff_ms.7.man (Tables, figures, equations, and references): Document the mandatory arguments to `PS`. Explain that pic(1) will supply them. (This is documentation of the _package's_ interface.) * doc/groff.texi: As above, and add example of pic(1) input. Also tighten wording. * doc/ms.ms: As above, and supply pic output corresponding to example (if typesetting). Add a keep. * doc/doc.am (doc/ms.ps): Preprocess with pic; call groff with `-p` option when generating document. * src/utils/grog/tests/smoke-test.sh: Drop a test case; we no longer have an ms(7) document in the tree that uses tbl and eqn but not pic. 2023-07-17 G. Branden Robinson [tbl]: Fix post-1.23.0 regression. * src/preproc/tbl/main.cpp (process_format): Fix thinkos introduced in commit ba420961c3, 19 May, which caused the first character after [PpVv] column modifiers to be ignored. Problem visible in typeset renderings of our "ms.ms" document, where some table entries were getting rendered at a type size of 1p. 2023-07-17 G. Branden Robinson [ms]: Fix Savannah #64438. * tmac/s.tmac (@PS): Stop treating excess arguments as erroneous, foregoing preparation for pic(1) output. Fixes regression from groff 1.22.4. Fixes . Thanks to Doug McIlroy for the report, Dave Kemper for root-cause analysis, and Deri James for usability feedback. 2023-07-17 G. Branden Robinson * arch/djgpp/config.site: * arch/misc/shdeps.sh: * bootstrap: * font/devdvi/generate/CompileFonts: * font/devps/generate/afmname: * font/devps/generate/make-zapfdr: * font/util/make-Rproto: * gendef.sh: * m4/groff.m4: * mdate.pl: * src/devices/grops/grops.1.man: * src/devices/xditview/ad2c: * src/libs/libgroff/config.charset: * src/libs/libgroff/make-uniuni: * src/preproc/eqn/neqn.sh: * src/roff/nroff/nroff.sh: * src/utils/afmtodit/make-afmtodit-tables: * test-groff.in: * tmac/hyphenex.pl: Stop endorsing shebang line space myth. Fixes . 2023-07-16 G. Branden Robinson * m4/groff.m4 (GROFF_PROG_YACC): Behave more like `AC_PROG_YACC` where useful, seeking "bison" first. Drop comment claiming that "Bison-generated parsers have problems with C++ compilers other than g++", which dates back to groff 1.10, 26 November 1995. Let us optimistically assume that GNU Bison (and C++ compilers) have improved since then. 2023-07-16 G. Branden Robinson * src/roff/groff/groff.cpp (main): Update copyright notice and warranty disclaimer. Bump year. Lead with declaration as free software (join us now); specify GPL version and user's option to upgrade to later version. Use a warranty disclaimer inspired by GNU Bison. Drop mention of "COPYING" file, which is not installed by groff's "install" make(1) target and not sufficient information to aid users of groff packages prepared by distributors (which neverless are legally bound to provide licensing information via some means, and do so with high reliability). After almost 35 years, we can have some hope that people have heard of the GNU GPL and can locate a copy of it without great difficulty. Also drop use of term "subprogram". 2023-07-16 G. Branden Robinson * tmac/man.local: Stop disabling hyperlinks on non-HTML output devices. less(1) version 566 and later are in wide distribution now and will be more so by the time of the next groff release. * tmac/tests/an_UE-breaks-before-long-URIs.sh: Force hyperlinks off with `-rU0` to preserve test validity. * NEWS: Add item. Thanks to Colin Watson for pioneering these changes in Debian's groff 1.23.0-1 package. 2023-07-12 G. Branden Robinson * src/preproc/html/pushback.cpp (pushBackBuffer::isString): Partially revert commit 411b42f4ec, 2 June. This member function needs a signed type to iterate backwards for internal validation purposes, so use `ptrdiff_t` instead of `size_t`. Fixes post-1.23.0 problem with pre-grohtml infinitely looping on complex documents like groff_char(7). Mea culpa. 2023-06-26 G. Branden Robinson [eqn]: Clarify diagnostic message. * src/preproc/eqn/lex.cpp (do_delim): Do it. Thanks to Doug McIlroy for the report . 2023-06-23 G. Branden Robinson [troff]: Add unit tests for drawing commands. * src/roff/groff/tests/draw-arc.sh: * src/roff/groff/tests/draw-circle.sh: * src/roff/groff/tests/draw-ellipse.sh: * src/roff/groff/tests/draw-filled-circle.sh: * src/roff/groff/tests/draw-filled-ellipse.sh: * src/roff/groff/tests/draw-filled-polygon.sh: * src/roff/groff/tests/draw-line.sh: * src/roff/groff/tests/draw-polygon.sh: * src/roff/groff/tests/draw-spline.sh: * src/roff/groff/tests/set-stroke-thickness.sh: Do it. * src/roff/groff/groff.am (groff_TESTS): Run tests. 2023-06-08 G. Branden Robinson [man, mdoc]: Parameterize page offset. * tmac/mdoc/doc-ditroff (doc-setup-page-layout): * tmac/mdoc/doc-nroff (doc-setup-page-layout): Stop forcing the page offset to the device defaults, redundantly. * tmac/an.tmac: * tmac/mdoc/doc-ditroff (doc-setup-page-layout): * tmac/mdoc/doc-nroff (doc-setup-page-layout): Honor `PO` register if set at startup. * tmac/groff_man.7.man.in (Options): * tmac/groff_mdoc.7.man (Options): Document it. * NEWS: Add item. 2023-06-02 G. Branden Robinson Slightly refactor. [grodvi, grops, xditview, libbib, libgroff, eqn, pre-grohtml, preconv, refer, troff, tfmtodit]: Store return value of `strlen()` in a `size_t` (or `ptrdiff_t` if we're performing subtraction on it) instead of an `int`. Change temporaries {loop indices and similar} to use the same types. * src/devices/grodvi/dvi.cpp (dvi_printer::do_special): * src/devices/grops/ps.cpp (ps_output::comment_arg): (ps_output::put_string, ps_output::put_number): (ps_output::put_float, ps_output::put_color): * src/devices/grops/ps.cpp (class ps_output) : : * src/devices/xditview/Dvi.c (ClassInitialize): * src/include/symbol.h (class symbol) : * src/libs/libbib/index.cpp (index_search_item::munge_filename): (index_search_item::search_item): * src/libs/libgroff/fontfile.cpp (font::open_file): * src/libs/libgroff/string.cpp (string::operator=): (string::operator+): * src/libs/libgroff/symbol.cpp (symbol::symbol): (symbol::block_size): * src/preproc/eqn/delim.cpp (define_extensible_string): * src/preproc/html/pre-html.cpp (char_buffer::can_see): * src/preproc/html/pushback.cpp (pushBackBuffer::isString): * src/preproc/preconv/preconv.cpp (emacs2mine): * src/preproc/refer/label.ypp (format_expr::evaluate): * src/roff/troff/input.cpp (make_temp_iterator, pipe_source): * src/utils/tfmtodit/tfmtodit.cpp (main): Do it. * src/preproc/html/pushback.cpp (pushBackBuffer::isString): Drop `while` loop that is now tautologically true due to comparison of unsigned types. 2023-05-30 G. Branden Robinson * src/roff/troff/env.cpp (font_change): Trivially refactor. Simplify conditionals. 2023-05-30 G. Branden Robinson [eqn]: Trivially refactor. Rename `check_tabs` member functions to `diagnose_tab_stop_usage`, to be more expressive and to prepare for the diagnosis of leaders in the input as well. * src/preproc/eqn/box.cpp (box::check_tabs): (box_list::list_check_tabs): (pointer_box::check_tabs): (tab_box::check_tabs): * src/preproc/eqn/box.h (box::check_tabs): (box_list::list_check_tabs): (list_box::check_tabs): (pile_box::check_tabs): (matrix_box::check_tabs): (pointer_box::check_tabs): (tab_box::check_tabs): * src/preproc/eqn/delim.cpp (delim_box::check_tabs): * src/preproc/eqn/limit.cpp (limit_box::check_tabs): * src/preproc/eqn/list.cpp (list_box::check_tabs): * src/preproc/eqn/other.cpp (accent_box::check_tabs): (uaccent_box::check_tabs): * src/preproc/eqn/over.cpp (over_box::check_tabs): * src/preproc/eqn/pile.cpp (pile_box::check_tabs): (matrix_box::check_tabs): * src/preproc/eqn/script.cpp (script_box::check_tabs): * src/preproc/eqn/sqrt.cpp (sqrt_box::check_tabs): Rename these... * src/preproc/eqn/box.cpp (box::check_tabs): (box::diagnose_tab_stop_usage): (box_list::list_diagnose_tab_stop_usage): (pointer_box::list_diagnose_tab_stop_usage): (tab_box::diagnose_tab_stop_usage): * src/preproc/eqn/box.h (box::diagnose_tab_stop_usage): (box_list::list_diagnose_tab_stop_usage): (list_box::diagnose_tab_stop_usage): (pile_box::diagnose_tab_stop_usage): (matrix_box::diagnose_tab_stop_usage): (pointer_box::diagnose_tab_stop_usage): (tab_box::diagnose_tab_stop_usage): * src/preproc/eqn/delim.cpp (delim_box::diagnose_tab_stop_usage): * src/preproc/eqn/limit.cpp (limit_box::diagnose_tab_stop_usage): * src/preproc/eqn/list.cpp (list_box::diagnose_tab_stop_usage): * src/preproc/eqn/other.cpp (accent_box::diagnose_tab_stop_usage): (uaccent_box::diagnose_tab_stop_usage): * src/preproc/eqn/over.cpp (over_box::diagnose_tab_stop_usage): * src/preproc/eqn/pile.cpp (pile_box::diagnose_tab_stop_usage): (matrix_box::diagnose_tab_stop_usage): * src/preproc/eqn/script.cpp (script_box::diagnose_tab_stop_usage): * src/preproc/eqn/sqrt.cpp (sqrt_box::diagnose_tab_stop_usage): ...to these. * src/preproc/eqn/box.cpp (box::top_level) (box_list::list_diagnose_tab_stop_usage): (pointer_box::diagnose_tab_stop_usage): * src/preproc/eqn/delim.cpp (delim_box::diagnose_tab_stop_usage): * src/preproc/eqn/limit.cpp (limit_box::diagnose_tab_stop_usage): * src/preproc/eqn/list.cpp (list_box::diagnose_tab_stop_usage): * src/preproc/eqn/other.cpp (accent_box::diagnose_tab_stop_usage): (uaccent_box::diagnose_tab_stop_usage): * src/preproc/eqn/over.cpp (over_box::diagnose_tab_stop_usage): * src/preproc/eqn/pile.cpp (pile_box::diagnose_tab_stop_usage): (matrix_box::diagnose_tab_stop_usage): * src/preproc/eqn/script.cpp (script_box::diagnose_tab_stop_usage): * src/preproc/eqn/sqrt.cpp (sqrt_box::diagnose_tab_stop_usage): Update call sites. 2023-05-25 G. Branden Robinson [eqn]: Trivially refactor. Boolify `tab_box` member variable `disabled`. * src/preproc/eqn/box.cpp (tab_box::tab_box) (tab_box::check_tabs): * src/preproc/eqn/box.h (class tab_box): Do it. * src/preproc/eqn/box.cpp (tab_box::check_tabs): Also recast diagnostic message to clarify what "level" we're talking about: it's lexical. Which, sadly, probably won't help any but CS/SWeng people... 2023-05-25 G. Branden Robinson [troff]: Validate a font family before trying to use it. * src/roff/troff/env.cpp (is_family_valid): New function checks for all text styles (R, I, B, BI) and returns true only if the given family supports them all. (family_change): Call `is_family_valid()` on given argument. If invalid, throw diagnostic and ignore `fam` request. * src/roff/troff/env.h (is_family_valid): Declare; make visible. * src/roff/troff/input.cpp (main): Call `is_family_valid()` on `-f` option argument. Its invalidity is a fatal error. Fixes . Thanks to Dave Kemper for the report. 2023-05-25 G. Branden Robinson * src/roff/troff/env.h (read_hyphen_file): Drop relic prototype for undeclared function. Should have been disposed of on 1992-09-21, per ChangeLog.old (né ChangeLog.115). 2023-05-23 G. Branden Robinson * src/roff/troff/input.cpp (do_error): Describe vertical page locations in output warning diagnostics in terms of lines on nroff devices. * doc/groff.texi (Debugging) : * man/groff.7.man (Request short reference) : Document this change. * NEWS: Add item. 2023-05-19 G. Branden Robinson [tbl]: Refactor handling of type size and vertical spacing. * src/preproc/tbl/table.h (struct inc_number): Rename this... (struct size_expression): ...to this, and change its member types. The `inc` `short` becomes a `relativity` enum because it only ever takes 3 values. The `val` short becomes an `int`, undoing what I suspect to be premature optimization. * src/preproc/tbl/main.cpp (entry_modifier::entry_modifier) (entry_format::debug_print, process_format): * src/preproc/tbl/table.cpp (set_modifier, set_inline_modifier) (restore_inline_modifier): Update to reflect new types and enum literals. 2023-05-19 G. Branden Robinson * src/preproc/tbl/main.cpp (process_format): Check for EOF after eating spaces and tabs when processing [pPvVwW] column modifiers, and emit an appropriate error diagnostic. This was already being done for [fFmM]. 2023-05-19 G. Branden Robinson * src/preproc/tbl/main.cpp (process_format): Accept (and discard) space and tab characters after [pPvV] in a column descriptor, as is already done for [fFmMwW]. Modify [wW] to use the same loop style as the others, for consistency. 2023-05-19 G. Branden Robinson * src/preproc/eqn/box.cpp (half_space_box::output) (full_space_box::output, thick_space_box::output) (half_space_box::output): Add assertions to catch unexpected flow of control. 2023-05-19 G. Branden Robinson [eqn]: Implement tunable "half_space" and "full_space" parameters. They default to the same widths as "thin_space" and "thick_space", respectively, but control the widths of the '^' and '~' input tokens. * src/preproc/eqn/box.cpp: Add globals `half_space`, `full_space`. (struct S): Recognize "half_space" and "full_space" as parameters to the "set" primitive, and map them to the globals. (half_space_box::output): Format the half space width. (full_space_box::output): Format the full space width. (full_space_box::output, thick_space_box::output): Drop workaround for Firefox 1.5 MathML bug (November 2005). Emit "  " entity instead of " ". * src/preproc/eqn/eqn.1.man (Customization): Document feature. * NEWS: Add item. Fixes . Thanks to Doug McIlroy for the report and Damian McGuckin for the discussion. 2023-05-19 G. Branden Robinson [eqn]: Add `thick_space` and `thin_space` classes. * src/preproc/eqn/box.cpp: * src/preproc/eqn/box.h: Do it. 2023-05-18 G. Branden Robinson [eqn]: Trivially refactor. Rename "space_box" class to "full_space_box" for clarity and to prepare for adding distinct thin and thick space box classes. * src/preproc/eqn/box.cpp (space_box::space_box) (space_box::output, space_box::debug_print): * src/preproc/eqn/box.h (class space_box): Rename these... * src/preproc/eqn/box.cpp (full_space_box::full_space_box) (full_space_box::output, full_space_box::debug_print): * src/preproc/eqn/box.h (class full_space_box): ...to these. * src/preproc/eqn/eqn.ypp (simple): Construct item using new type name. 2023-05-18 G. Branden Robinson * src/roff/troff/hvunits.h: Boolify. (class vunits, class hunits, vunits::is_zero, hunits::is_zero): Do it. 2023-05-13 G. Branden Robinson * src/roff/troff/node.cpp: Rename request-handling functions to better describe their operation. (font_translate, font_position, style, underline_font) (define_font_special_character, remove_font_special_character) (font_special_request, special_request, font_zoom_request) (bold_font, track_kern, constant_space, ligature, kern_request) (set_soft_hyphen_char): Rename these... (translate_font, mount_font_at_position) (associate_style_with_font_position, select_underline_font) (define_font_specific_character, remove_font_specific_character) (set_font_specific_special_fonts, set_special_fonts, zoom_font) (embolden_font, configure_track_kerning, constantly_space_font) (set_ligature_mode, set_kerning_mode) (set_soft_hyphen_character): ...to these. 2023-05-13 G. Branden Robinson * src/roff/troff/node.cpp (font_translate, font_position, style) (underline_font, define_font_special_character) (remove_font_special_character, font_special_request) (special_request, font_zoom_request, bold_font, track_kern) (constant_space, ligature, kern_request, set_soft_hyphen_char): Declare functions as `static`. 2023-05-13 G. Branden Robinson [troff]: Fix Savannah #64166. * src/roff/troff/node.cpp (bold_font): Add `WARN_MISSING` diagnostic if request given no arguments; it does nothing, and the behavior of this request is sufficiently complex that it's worth saying so. Stop throwing font lookup error if second argument cannot be resolved as a font name; it might be an emboldening amount instead. 2023-05-10 G. Branden Robinson * tmac/s.tmac (PE): Turn on no-space mode after a pic(1) display, when not flying back with `PF`. Continues fix for Savannah #62688. 2023-05-08 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/input.cpp (token::~token, token::operator=): Drop workaround for bug in compiler (SGI C++) that dates back to groff 1.07 (March 1993). But don't go back to using the ternary operator. 2023-05-07 G. Branden Robinson [troff]: Fix Savannah #64104. * src/roff/troff/input.cpp (set_escape_char): Rename this... (assign_escape_character): ...to this. Don't permit the escape character to be set to the same thing as the control or no-break control characters. * doc/groff.texi (Using Escape Sequences): Document restrictions. * src/roff/troff/env.h (class environment): Slightly refactor. Rename fields `control_char` and `no_break_control_char` to `control_character` and `no_break_control_character`, respectively, and make them private. Add public getters and setters for them. (get_control_character): New public member function returns `unsigned char`. (set_control_character): New public member function takes an `unsigned char` and returns a `bool`. (get_no_break_control_character): (set_no_break_control_character): Similar. * src/roff/troff/env.cpp (environment::environment): Update constructors to use new field names and initialize them in their new order of declaration. (environment::copy): Similar. (Not to be confused with a copy constructor, this member function implements the operation of a valid `evc` GNU troff request.) (environment::get_control_character): (environment::set_control_character): (environment::get_no_break_control_character): (environment::set_no_break_control_character): Implement. * src/roff/troff/env.cpp: Drop handling of `cc` and `c2` requests. (control_char, no_break_control_char): Drop implementations. (init_env_requests): Drop `init_request` calls for them. * src/roff/troff/input.cpp: Resurrect handling of `cc` and `c2` requests here, with more error handling. (assign_escape_character, process_input_stack): Use the new getters defined above in environment object since the relevant fields are now private. (assign_control_character): New function assumes the former responsibilities of `env.cpp::control_char()` and rejects the request if the desired character is already the escape or no-break control character. (assign_no_break_control_character): New function assumes the former responsibilities of `env.cpp::no_break_control_char()` and rejects the request if the desired character is already the escape or control character. (process_input_stack): Reorder comparisons to avoid inadvertent lvalue assignment. Add parentheses to assignment with complex RHS. (init_input_requests): Attach `cc` and `c2` requests to new functions above. * doc/groff.texi (Control Characters): Document restrictions. 2023-05-07 G. Branden Robinson [troff]: Don't quote a character with itself in diagnostics. * src/roff/troff/input.cpp (token::description) (input_char_description): When quoting the ' character in diagnostics, use double-quotes, not apostrophes. 2023-05-06 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/input.cpp (top level, warnscale_request, main, do_error): Rename global `warn_scaling_indicator` to `warn_scaling_unit`, to align with our documentation. 2023-05-06 G. Branden Robinson [troff]: Revise output warning diagnostic format. * src/roff/troff/input.cpp (do_error): For the `OUTPUT_WARNING` value of the `error_type` enum, spell out the words "page" and "diversion" instead of abbreviating them, and place the diversion information (if present) in parentheses. 2023-05-02 G. Branden Robinson [troff]: Trivially refactor. * src/roff/troff/reg.cpp (set_number_reg): Rename to... (set_register): ...this. * src/roff/troff/reg.h: Update extern reference. * src/roff/troff/div.cpp (mark): * src/roff/troff/input.cpp (length_request, do_register) (token::add_to_zero_width_node_list, do_register_assignment) (init_registers): Update call sites. * src/roff/troff/div.cpp (interpolate_number_reg): Rename to... (interpolate_register): ...this. (get_copy, token::next, length_request, read_title_parts): Update call sites. * src/roff/troff/token.h: Update extern reference. Explicitly declare as `extern`. * src/roff/troff/reg.cpp (define_number_reg): Rename to... (define_register): ...this. (init_reg_requests): Update call site. (set_number_reg): Rename to... (set_register): ...this. (print_number_regs): Rename to... (print_registers): ...this. * src/roff/troff/reg.cpp (lookup_number_reg): Rename to... (look_up_register): ...this. * src/roff/troff/input.cpp (interpolate_register): Update call site. * src/roff/troff/reg.h: Update extern reference. Explicitly declare as `extern`. 2023-04-30 G. Branden Robinson [eqn]: Improve tests of line number accuracy. * src/preproc/eqn/tests/\ diagnostics-report-correct-line-numbers.sh: Add cases to check behavior of valid input, not just error cases. Also add some unexecuted test cases for future use. 2023-04-29 G. Branden Robinson * src/include/lf.h (interpret_lf_args): * src/libs/libgroff/lf.cpp (interpret_lf_args): Boolify. 2023-04-28 G. Branden Robinson [tbl]: Fix Savannah #64122. * src/preproc/tbl/table.cpp (table::init_output): Specify scaling unit when using `hym` and `hys` requests. Continues commit cee547e883, 30 January 2021. Thanks to Frederic Chartier and Peter Schaffter for the report. 2023-04-28 G. Branden Robinson [tbl]: Regression-test Savannah #64122. * src/preproc/tbl/tests/\ save-and-restore-hyphenation-parameters.sh: Update input and add check. 2023-04-25 G. Branden Robinson [troff]: Drop `POPEN_MISSING` preprocessor macro. 3 source files test this macro but nothing appears to define it. It dates back to (at least) 1994. I suspect this of being bitrot. Reasons include: (1) We test for a declaration of `popen` in our "configure.ac" file; (2) our gxditview command uses `popen` _without_ #ifdef-guarding it (perhaps the assumption was that any system that supported X11 also had a working `popen`); (3) our "nonposix.h" header file defines a macro aliasing `popen` to `_popen`, which is its typical name on Windows systems, and is the most likely build host candidate for which support might have been missing as late as 1994. Microsoft end-of-lifed MS-DOS in 2000. If someone wants to start up a FreeDOS port, talk to us. Maybe even that has a functional `popen()`. Here's hopin'. * src/roff/troff/input.cpp ([global], file_iterator::close) (pipe_source, pipe_output, init_input_requests): * src/roff/troff/node.cpp (class real_output_file) (output_file::real_output_file, output_file::~real_output_file): * src/roff/troff/node.h: Do it. 2023-04-14 G. Branden Robinson [eqn]: Implement new "gifont" primitive. * src/preproc/eqn/eqn.ypp: Add token "GFONT" (to supplement "GIFONT", already renamed from "GFONT". * src/preproc/eqn/lex.cpp (struct token_table): Map "gifont" and "gfont" inputs to "GIFONT" and "GFONT" tokens. (do_gfont, do_gifont): Employ parallel implementations, differing only in diagnostic message text. (yylex): Handle token "GFONT" by calling `do_gfont()`. * src/preproc/eqn/eqn.1.man (New primitives, Fonts, Options) (Bugs): Document it. * NEWS: Add item. Fixes . Thanks to Damian McGuckin, Doug McIlroy, and Ralph Corderoy for support and suggestions. 2023-04-07 G. Branden Robinson * src/preproc/eqn/lex.cpp (do_include, do_undef, do_gsize) (do_gifont, do_grfont, do_gbfont, do_space, do_chartype) (do_set): Recast diagnostic messages to use terminology established in man page, and use more idiomatic English in phrasing. Distinguish which argument has the problem when lexical analysis of "chartype" and "set" commands fails. 2023-04-07 G. Branden Robinson * src/preproc/eqn/lex.cpp (do_include, ignore_definition) (do_definition, do_undef, do_gsize, do_gifont, do_grfont) (do_gbfont, do_sprintf, do_ifdef, do_chartype, do_set): Recast diagnostic messages to characterize input as "invalid" rather than "bad". 2023-04-07 G. Branden Robinson [eqn]: Trivially refactor, renaming various globals from containing "gfont" to "gifont", to make it clearer that they deal with the italic font used by equations. * src/preproc/eqn/box.cpp (gfont): Rename global char pointer from this... (gifont): ...to this. * src/preproc/eqn/box.cpp (get_gfont, set_gfont): * src/preproc/eqn/box.h (get_gfont, set_gfont): * src/preproc/eqn/lex.cpp (do_gfont): Rename functions from these... * src/preproc/eqn/box.cpp (get_gifont, set_gifont): * src/preproc/eqn/box.h (gifont, get_gifont, set_gifont): * src/preproc/eqn/lex.cpp (do_gifont): ...to these. * src/preproc/eqn/box.cpp (get_gifont, set_gifont): Update global `gfont` access sites. * src/preproc/eqn/box.cpp (box::top_level): * src/preproc/eqn/eqn.ypp (simple): * src/preproc/eqn/lex.cpp (do_gifont, yylex): * src/preproc/eqn/main.cpp (main): Update call sites. * src/preproc/eqn/eqn.ypp: * src/preproc/eqn/lex.cpp (token_table, yylex): Rename "GFONT" token type to "GIFONT". 2023-04-07 G. Branden Robinson * src/preproc/eqn/main.cpp (main): Prefix generated *roff diagnostics with name of input file (the document). Use `tmc`/`tm1` to coalesce multi-line diagnostic onto one line of output to stderr. Tighten wording. Continues the long process of fixing Savannah #52463. 2023-04-03 G. Branden Robinson * src/roff/troff/input.cpp (temp_iterator::temp_iterator): Skip allocation of zero-length arrays. Resolves "-Walloc-zero" warning from GCC. Fixes . Thanks to Bjarni Ingi Gislason for the report. 2023-04-02 G. Branden Robinson * src/roff/troff/input.cpp (token::description): Revise construction of description of printable ordinary input characters (U+0021 through U+007E). This is to facilitate better diagnostics from the `rchar` request in the future. See Savannah #63985. 2023-04-01 G. Branden Robinson * src/roff/troff/input.cpp (chop_macro) (do_string_case_transform, substring_request, asciify_macro): (unformat_macro, write_macro_request): When diagnosing impossible operations on request names, report the name of the request they were attempted upon. * src/roff/groff/tests/string_case_xform_errors.sh: Update test expectations. 2023-04-01 G. Branden Robinson [troff]: Make futile aliasing an error. * src/roff/troff/input.cpp (alias_macro): Promote diagnostic when attempting to alias a nonexistent macro/string/diversion from warning to error; this aligns with the handling of the requests `chop`, `stringup`, `stringdown`, `substring`, `asciify`, `unformat`, and `writem` when they are regarded as impossible. Further, attempting to alias a nonexistent object does not create an empty one, unlike interpolating it; try ".als baz qux", then ".pm". * src/roff/troff/reg.cpp (alias_reg): Promote diagnostic when attempting to alias a nonexistent register from warning to error. Attempting to alias a nonexistent register does not create an empty one, unlike interpolating it; try ".aln q r", then ".pnr". 2023-03-07 G. Branden Robinson [tbl]: Trivially refactor. Rename variables and functions to use the term "rule" rather than "line". The value of the term "rule" is that it is not confusable with "lines" of (text) input or output. * src/preproc/tbl/main.cpp (struct format) : (format::format) : (format::add_rows) : (format::~format) : (struct input_entry_format) : (input_entry_format::input_entry_format) : (input_entry_format::debug_print) : (process_format) : (process_data) ([anonymous] enum) : * src/preproc/tbl/table.cpp: * src/preproc/tbl/table.h (enum format_type) (class table) , add_single_hline, add_double_hline, add_vlines, print_single_hline, print_double_hline: Rename these... * src/preproc/tbl/main.cpp (struct format) : (format::format) : (format::add_rows) : (format::~format) : (struct input_entry_format) : (input_entry_format::input_entry_format) : (input_entry_format::debug_print) : (process_format) : (process_data) ([anonymous] enum) : * src/preproc/tbl/table.cpp: * src/preproc/tbl/table.h (enum format_type) (class table) , add_single_hrule, add_double_hrule, add_vrules, print_single_hrule, print_double_hrule: ...to these. 2023-02-25 G. Branden Robinson [tbl]: Fix Savannah #63838. * src/preproc/tbl/table.cpp (table::add_entry): Throw error diagnostic if table entry ends in the zero-motion escape sequence `\z`. This is nonsense and provokes baffling diagnostics from the formatter. Stick user's nose directly into the problem. Fixes . Thanks to the mandoc(1) project for documenting the issue in a regression test. 2023-04-16 G. Branden Robinson [build]: Improve portability to non-GNU, non-LLVM compilers. * bootstrap.conf (gnulib_modules): Add "attribute". * src/libs/libgroff/getopt.c: * src/libs/libgroff/new.cpp: Include gnulib's "attribute.h" header file. * src/libs/libgroff/getopt.c (_getopt_initialize): * src/libs/libgroff/new.cpp (operator delete): Replace GNU C unused attribute syntax with gnulib's "MAYBE_UNUSED". Thanks to Bruno Haible for the report and suggested remedy. 2023-03-16 G. Branden Robinson * src/libs/libxutil/XFontName.c (utoa): Rename function from this... (xu_utoa): ...to this, to avoid name collision when using "newlib" portability library. (XFormatFontName): Update call site. * PROBLEMS: Drop item. Fixes . Thanks to Brian Inglis for the report. 2023-05-13 G. Branden Robinson [man]: Preserve user-selected font family. * tmac/an.tmac: When initializing, save the currently selected font family as `an*body-family` instead of forcing 'T' (Times, which is the formatter's default, even on nroff-mode devices that can't switch families). This change makes the formatter's `-f` option work on man(7) documents again (important for Japanese man pages, but there is now once again nothing stopping you from viewing man pages in Palatino or Helvetica on the 'ps' and 'pdf' devices where these families are available). It also reopens an avenue for rogue pages to affect the rendering of unrelated documents later in batch rendering, but there are many other, and worse, ways for rogue pages to do damage. Problem introduced by me in commit e0e16d8e65, 15 March 2022. Fixes . Thanks to Deri James for the report. 2023-05-01 G. Branden Robinson [man]: Stop `HP` producing excess vertical space. * tmac/an.tmac (HP): Fix thinko/typo when expanding macro as string to call `an-deprecation-warn`. * tmac/an-ext.tmac (SY): Put 1v of vertical space on the output if we are starting a (non-nested) synopsis. Thanks to Alex Colomar for the report. Problem introduced by me in commit aea1dfb11b, 6 March 2022. 2023-04-28 G. Branden Robinson [ms]: Default vertical spacing to 120% of type size, not 2 points larger. * tmac/s.tmac (par@load-init, par@init): Do it. * NEWS: Add item. 2023-04-26 G. Branden Robinson [pdfpic]: Refactor. * tmac/pdfpic.tmac: Migrate gathering of image dimensions from `sy` and a temporary file to `pso`. (pdfpic@cleanup): Drop `pdfpic*temporary-file` string. (pdfpic@get-image-dimensions): Remove redirection. Invoke `pso`, not `sy`. (PDFPIC): Stop constructing `pdfpic*temporary-file` string. Stop testing `systat` register. Stop sourcing and deleting temporary file. 2023-04-21 G. Branden Robinson * tmac/pdfpic.tmac: Refactor to make comprehensible some woefully undocumented cleverness and improve efficiency. (PDFPIC): Break out flaming-hoop-leaping "clever" bit of `sy` usage into its own macro, calling from here and relocating its requests from here... (pdfpic@get-image-dimensions): ...to here. When using `sy` request to collect and munge output of pdfinfo(1), (a) disable the escape character while defining the macro; (b) construct the command in a roff string, appending to it in discrete, hopefully comprehensible chunks; (c) disable the escape character during macro interpretation wherever possible (most of it); (d) retain doubled backslashes so that they survive subsequent string interpolation; (e) stop using grep(1) in the pipeline when sed(1) is perfectly capable of performing its own input filtering; (f) invoke sed with '-n' option and emit output only upon a successful substitution; (g) replace unportable(!) POSIX BRE character class '[:digit:]' in substitution match text with '[0-9]'; and most importantly (h) replace multi-line sed 's' replacement text (see below for the reason we can't use it) with single roff control line employing the groff extension escape sequence `\R` to assign multiple registers. Annotate portability and escaping challenges. Tested on GNU/Linux, macOS 12, and (with simulated pdfinfo(1) output) Solaris 11. There is a problem with trying to embed true newlines into the arguments of a `sy` request. The C++ function that GNU troff uses to assemble the command string (character by character) _does not recognize C/C++ string literal escape sequences_. This means that you _cannot_ embed "\n" in `sy`'s arguments and have it survive, as a newline character, into the command string passed to the standard C library's system(3) function. ("A\nB" gets encoded as 'A', '\\', 'n', 'B', not 'A', '\n', 'B'.) Unfortunately, this appears to be AT&T troff-compatible behavior. But it means that you _cannot_ portably construct multi-line replacement text for sed's 's' command. (Other sed commands like 'a', 'c', and 'i' will be similarly affected.) See Savannah #64071. * PROBLEMS: Drop item. Fixes . Thanks to Bruno Haible for the report, and to him and Ralph Corderoy for the discussion of portable and efficient sed constructs. 2023-04-27 G. Branden Robinson [pdfpic]: Clean up better. * tmac/pdfpic.tmac (PDFPIC): Call `pdfpic@cleanup` before returning when falling back to `PSPIC` for non-PDF documents. 2023-04-05 G. Branden Robinson * tmac/tty.tmac: Add angle bracket fallbacks. Thanks to Mike Fulton for the report, and to Ralph Corderoy and Dave Kemper for the discussion. 2023-03-13 G. Branden Robinson [tests]: Add Spanish language support (5/5). * src/roff/groff/tests/localization_works.sh: * tmac/tests/e_ld-works.sh: Test it. Fixes . Thanks to Eloi Montañés. 2023-03-13 G. Branden Robinson [docs]: Add Spanish language support (4/5). * doc/groff.texi (Manipulating Hyphenation): * doc/ms.ms (Language and localization): * man/groff_tmac.5.man (Localization files): Document it. * NEWS: Add item. 2023-03-13 G. Branden Robinson [tmac]: Add Spanish language support (3/5). * tmac/hyphen.es: * tmac/es.tmac: Update editor aids. 2023-03-13 G. Branden Robinson [tmac]: Add Spanish language support (2/5). * tmac/es.tmac: Spell weekday and month names in lowercase; every style authority I could find online mandates this, and it meshes with my half-remembered formal instruction in the language. Fix groff composite special character escape sequences to place the base character first. Replace one Unicode special character escape sequence with a composite special character escape sequence, for consistency. 2023-03-13 Eloi Montañés [tmac]: Add Spanish language support (1/5). * tmac/hyphen.es: Add hyphenation patterns (encoded in Latin-9). * tmac/es.tmac: Add groff locale for Spanish. * tmac/tmac.am (TMACNORMALFILES): Ship new files. * doc/groff.texi (Manipulating Hyphenation): Add file/package index entry for "es.tmac". * LICENSES: Update for CTAN Spanish hyphenation patterns. 2023-03-09 G. Branden Robinson [tests]: Add Russian language support (7/7). * src/roff/groff/tests/localization_works.sh: * tmac/tests/e_ld-works.sh: Test it. Fixes . Thanks to Nikita Ivanov. 2023-03-08 G. Branden Robinson [docs]: Add Russian language support (6/7). * doc/groff.texi (Input Encodings, Manipulating Hyphenation): * doc/ms.ms (Language and localization): * man/groff_tmac.5.man (Localization packages, Input encodings): Document support for KOI8-R encoding and Russian language. 2023-03-08 G. Branden Robinson [tmac]: Add Russian language support (5/7). * tmac/tmac.am (TMACNORMALFILES): Ship new Russian language support files. 2023-03-08 G. Branden Robinson [tmac]: Add Russian language support (4/7). * tmac/koi8-ru.tmac: Rename this file... * tmac/koi8-r.tmac: ...to this. There _is_ a "KOI8-RU" encoding, which appears to subsume KOI8-B and KOI8-U (by replacing more box drawing characters), but this file does not remap their values to applicable Unicode code points. * tmac/ru.tmac: Load the encoding file under its new name. 2023-03-08 G. Branden Robinson [tmac]: Add Russian language support (3/7). * tmac/hyphen.ru: * tmac/ru.tmac: Update editor aids so these files can be edited more intelligibly using GNU Emacs. Annotate apparent problem with Vim's KOI8-R support. 2023-03-08 G. Branden Robinson Add Russian language support (2/7). LICENSES: Update for CTAN Russian hyphenation patterns. 2023-03-08 Nikita Ivanov [tmac]: Add Russian language support (1/7). * tmac/hyphen.ru: Add hyphenation patterns (encoded in KOI8-R). * tmac/koi8-ru.tmac: Add character encoding support. * tmac/ru.tmac: Add groff locale for Russian. 2023-04-07 G. Branden Robinson * tmac/s.tmac (@EQ): Trivially refactor. Shift valid pseudo-enumeration type values from 0..2 to 1..3 so that they more idiomatically test for truth values in roff (where zero and negative values are false). Simplify a conditional accordingly. 2023-04-07 G. Branden Robinson [ms]: Fix Savannah #64013. * tmac/s.tmac (@EQ): Revise argument handling. If there is only one argument and it is not a recognized alignment, warn and treat it as an equation label. If there are two arguments but the first is not a recognized alignment, throw a warning diagnostic (but still use default alignment with the second argument as label). An explicitly empty first argument is synonymous with "C". Fixes . 2023-04-07 G. Branden Robinson [ms]: Regression-test Savannah #64013. * tmac/tests/s_EQ-handles-empty-first-arg.sh: Do it. * tmac/tmac.am (tmac_TESTS): Run test. 2023-04-05 G. Branden Robinson [ms]: Fix Savannah #64005. * tmac/s.tmac (@break-page, bp): Define alias for `bp` request and wrapper for `bp` to (if needed) temporarily disable no-space mode, so that a document's `bp` requests are honored even if no-space mode is on, as can happen after displays. Fixes a regression from groff 1.22.4 and historical ms implementations introduced by me on 6 July when resolving Savannah #62688. Fixes . Thanks to Michał Kruszewski for reporting the problem and Dave Kemper for identifying the cause. 2023-04-05 G. Branden Robinson [ms]: Regression-test Savannah #64005. * tmac/tests/s_honor-page-break-after-display.sh: Do it. * tmac/tmac.am (tmac_TESTS): Run test. 2023-03-24 G. Branden Robinson * tmac/mdoc/doc-common (Sh): Restore hyphenation configured with `HY` register upon entry to any new section. Disable adjustment and hyphenation when in the "Synopsis" section. Fixes . Thanks to Alex Colomar for reporting an issue that brought this one to light. 2023-03-24 G. Branden Robinson [mdoc]: Regression-test Savannah #63957. * tmac/tests/doc_synopsis_is_not_adjusted.sh: Do it. * tmac/tmac.am (tmac_TESTS): Run test. 2023-03-14 G. Branden Robinson * tmac/tmac.am (tmac/stamp-wrap): Stop prepending groff's man(7) package wrapper ("-man") on hosts with a system man package with a request to source itself; this was search-and-replace damage from resolving Savannah #60789. The wrapper still worked, but reported any errors inside the wrapped macro package many times until the process ran out of file descriptors. Problem introduced by me in commit fdac25937f, 2021-07-05. Fixes . 2023-05-13 G. Branden Robinson * tmac/tests/an-ext_SY-and-YS-work.sh: Add test. * tmac/tmac.am (tmac_TESTS): Run test. 2023-04-28 G. Branden Robinson [build]: Skip an Autoconf check if not necessary. * m4/groff.m4 (GROFF_PNMTOPS_NOSETPAGE): Skip check if no "pnmtops" command was found. 2023-04-06 G. Branden Robinson [doc]: Abstract document dependencies on the mom package. * doc/doc.am (doc/automake.pdf): Replace dependency with new macro `TMAC_PACKAGE_MOM`. Aligns with (4/4). 2023-04-03 G. Branden Robinson [doc]: Add document dependencies on the ms package. * tmac/tmac.am (TMAC_PACKAGE_MS): Define new macro comprising the files of the ms package. * doc/doc.am (doc/ms.ps, doc/webpage.ps, doc/pic.html) (doc/pic.ps): Add dependency on new macro. Fixes (2/4). 2023-04-03 G. Branden Robinson [doc]: Add document dependencies on the "me" package. * tmac/tmac.am (TMAC_PACKAGE_ME): Define new macro comprising the files of the "me" package. * doc/doc.am (doc/grnexmpl.ps, doc/meintro.ps) (doc/meintro_fr.ps, doc/meref.ps): Add dependency on new macro. Fixes (1/4). 2023-04-03 G. Branden Robinson [build]: Install PDF documents better. Ship only one copy of "automake.pdf", and install it and the new "groff-man-pages.pdf" in the "pdf/" subdirectory of the destination "doc" directory. * doc/doc.am (PROCESSEDDOCFILES): Drop "$(PROCESSEDDOCFILES_PDF)" from macro definition. (nodist_docpdfdoc_DATA) [USE_GROPDF]: Use it here instead, replacing a literal "doc/automake.pdf". (mostlyclean-doc) [USE_GROPDF]: Clean these same files. 2023-04-03 G. Branden Robinson [build]: Ship groff.dvi (our Texinfo manual in DVI format). * doc/doc.am (install-dvi-local, uninstall-dvi): Add targets. (uninstall-local): Depend on "uninstall-dvi". 2023-04-03 G. Branden Robinson [build]: Resume shipping pic.html. * m4/groff.m4 (GROFF_CHECK_GROHTML_PROGRAMS) (GROFF_GROHTML_PROGRAM_NOTICE, GROFF_PNMTOOLS_CAN_BE_QUIET): Rename "make_htmldoc" to "use_grohtml" as expected by "configure.ac". Also stop `AC_SUBST`ing it; we don't need "@use_grohtml@" in our Makefiles since an `AM_CONDITIONAL` in configure.ac already does an equivalent thing. Continues commit aa5787c1eb by me from 20 May. (PROCESSEDDOCFILES): Drop "$(PROCESSEDDOCFILES_HTML)" from macro definition; annotate why. 2023-03-13 G. Branden Robinson m4/groff.m4 (GROFF_TMAC): Eliminate garbage leading space from contents of `tmac_wrap` shell variable. 2023-03-13 G. Branden Robinson [build]: Clarify output of `GROFF_TMAC` Autoconf test. * configure.ac: Correct characterization of the list of macro packages reported. It is not the list of macro packages receiving a "g" prefix, but the list of macro packages reciving a wrapper macro file in groff's macro directory, each of which sources the corresponding system (likely AT&T-descended troff) macro package. Fixes wording I introduced in commit 4d30dd7424, 31 May. * m4/groff.m4 (GROFF_TMAC): Clarify first "checking" message: we are looking for a file name prefix on existing system macro packages (like "tmac."). This has nothing to do with the prefix applied to groff commands, or the "g" prefixed to groff implementations of the man, mm, and ms packages. Tighten wording of second "checking" message. Consistently say "(none)" instead of "none" or "none found". Fixes . 2023-03-11 G. Branden Robinson * doc/doc.am (install-txt): Look for "groff.txt" in the source and build directories in sequence; it could be in either place depending on whether the build is from the Git repository or from a distribution archive. Annotate this. Fixes "install-doc" target when building from Git repository. Problem introduced by me in commit 691fc70108, 22 February. Thanks to Nikita Ivanov for the report. (install-pdf-local, install-html-local): Similar. Also fixes , later reported anonymously. 2023-03-10 G. Branden Robinson * doc/doc.am (maintainer-clean-local): Remove temporary "*.t2d" and "*.t2p" directories created by texi2dvi. 2023-04-20 Bruno Haible [build]: Fix gxditview linking on AIX. * m4/groff.m4 (GROFF_X11): Add macro dependency on `AC_CANONICAL_HOST`. Introduce new variable `X_AW_DEPS`, empty on most hosts. If we otherwise have Athena widget library support, and the host is AIX, force linkage against Xpm and Xext libraries to reflect modern Athena dependencies, which AIX's linker doesn't figure out on its own. `AC_SUBST` this variable, exposing it to Automake files. * src/devices/xditview/xditview.am (gxditview_LDADD): Use it. {A similar change might also be useful for HP-UX, another Unix System V descendant; see . --GBR, 2023-07-10} 2023-04-20 G. Branden Robinson * bootstrap.conf (gnulib_modules): Add "sys_wait" module. MinGW does not provide "sys/wait.h", which we require in src/preproc/html/pre-html.cpp since commit 11137209ed, 27 June. 2023-04-20 G. Branden Robinson * Makefile.am: Initialize (as empty) Automake variables that we don't use but which gnulib modules expect to be defined. (AUTOMAKE_OPTIONS, SUBDIRS, noinst_HEADERS, noinst_LTLIBRARIES) (pkgdata_DATA, MOSTLYCLEANDIRS, AM_CFLAGS): Do it. Thanks to Bruno Haible for the advice. 2023-04-22 G. Branden Robinson [mdoc]: Regression-test Savannah #57665, but for mdoc. * tmac/tests/doc_TS-do-not-keep-tables-when-cR-set.sh: Do it. * tmac/tmac.am (tmac_TESTS): Run test. Fixes . ________________________________________________________________________ ##### License Copyright 2023-2024 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. ##### Editor settings Local Variables: fill-column: 72 mode: change-log version-control: never End: vim:set autoindent textwidth=72: