gbranden pushed a commit to branch master in repository groff. commit e958bb4fc65326dd9cd0d775e96aff15e944795e Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Wed Jan 17 13:49:40 2024 -0600
[troff]: Implement new `pcomposite` request. * src/roff/troff/input.cpp (report_composite_characters): Add. (init_input_requests): Wire up `pcomposite` request name to `report_composite_characters()`. * doc/groff.texi (Colors, Debugging): * man/groff.7.man (Request short reference, Debugging): * man/groff_diff.7.man (New requests, Debugging): * NEWS: Document it. --- ChangeLog | 13 +++++++++++++ NEWS | 3 +++ doc/groff.texi | 19 +++++++++++++++++-- man/groff.7.man | 11 +++++++++++ man/groff_diff.7.man | 12 ++++++++++++ src/roff/troff/input.cpp | 18 +++++++++++++++++- 6 files changed, 73 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 709b8ea38..dd2a20d21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2024-01-17 G. Branden Robinson <g.branden.robin...@gmail.com> + + [troff]: Implement new `pcomposite` request. + + * src/roff/troff/input.cpp (report_composite_characters): Add. + (init_input_requests): Wire up `pcomposite` request name to + `report_composite_characters()`. + + * 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-17 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/troff/input.cpp (report_color): Flush standard error diff --git a/NEWS b/NEWS index 94b8aa060..290cf8f73 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,9 @@ o A new request, `pcolor`, reports to the standard error stream the fill colors, "default", are not listed since they are immutable and their details unknown to the formatter.) +o A new request, `pcomposite`, reports to the standard error stream the + current list of defined composite characters. + o A new request, `phw`, reports to the standard error stream the current list of hyphenation exceptions. diff --git a/doc/groff.texi b/doc/groff.texi index 6b449b571..888043801 100644 --- a/doc/groff.texi +++ b/doc/groff.texi @@ -11073,6 +11073,10 @@ This is a strict rewriting of the special character name; no check is performed for the existence of a glyph for either. A set of default mappings for many accents can be found in the file @file{composite.tmac}, loaded by the default @file{troffrc} at startup. + +You can obtain a report of colors defined by @code{composite} on the +standard error stream with the @code{pcomposite} request. +@xref{Debugging}. @endDefreq @Defesc {\\N, @code{'}, n, @code{'}} @@ -16890,8 +16894,9 @@ or for instrumentation while troubleshooting. The @code{ex} and exit codes respectively, to halt further processing when continuing would be fruitless. Examine the state of the formatter with requests that write lists of defined names (macros, strings, and diversions), -defined colors, environments, hyphenation exceptions, registers, and -page location traps to the standard error stream. +defined colors, composite characters, environments, hyphenation +exceptions, registers, and page location traps to the standard error +stream. @c END Keep parallel with section "Debugging" of groff(7). @Defreq {lf, line [@Var{file}]} @@ -16977,6 +16982,16 @@ listed since they are immutable and their details unknown to the formatter. @endDefreq +@Defreq {pcomposite, } +@cindex dumping defined composite characters (@code{pcomposite}) +@cindex defined composite characters, dumping (@code{pcomposite}) +@cindex composite characters, defined, dumping (@code{pcomposite}) +@cindex characters, composite, dumping defined (@code{pcomposite}) +Report, to the standard error stream, the list of defined composite +characters. The ``from'' code point is listed first, followed by its +``to'' mapping. +@endDefreq + @Defreq {pev, } @cindex dumping environments (@code{pev}) @cindex environments, dumping (@code{pev}) diff --git a/man/groff.7.man b/man/groff.7.man index e22ad186f..7e2c977f3 100644 --- a/man/groff.7.man +++ b/man/groff.7.man @@ -3849,6 +3849,15 @@ are not listed since they are immutable and their details unknown to the formatter. . .TPx +.REQ .pcomposite +Report, +to the standard error stream, +the list of defined composite characters. +. +The \[lq]from\[rq] code point is listed first, +followed by its \[lq]to\[rq] mapping. +. +.TPx .REQ .pev Report the state of the current environment followed by that of all other environments to the standard error stream. @@ -8205,6 +8214,8 @@ and .RB diversions\[em]( .pm ); defined colors .RB ( .pcolor ); +composite characters +.RB ( .pcomposite ); environments .RB ( .pev ); hyphenation exceptions diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man index 4c91466c8..0c323ea5b 100644 --- a/man/groff_diff.7.man +++ b/man/groff_diff.7.man @@ -3113,6 +3113,16 @@ formatter. . . .TP +.B .pcomposite +Report, +to the standard error stream, +the list of defined composite characters. +. +The \[lq]from\[rq] code point is listed first, +followed by its \[lq]to\[rq] mapping. +. +. +.TP .B .phw Report, to the standard error stream, @@ -5226,6 +5236,8 @@ More aspects of formatter state can be examined with requests that write lists of defined colors .RB ( pcolor ), +composite characters +.RB ( pcomposite ), environments .RB ( pev ), hyphenation exceptions diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index 093770bd2..f30022831 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 1989-2023 Free Software Foundation, Inc. +/* Copyright (C) 1989-2024 Free Software Foundation, Inc. Written by James Clark (j...@jclark.com) This file is part of groff. @@ -4227,6 +4227,21 @@ static symbol composite_glyph_name(symbol nm) return symbol(gl.contents()); } +static void report_composite_characters() +{ + dictionary_iterator iter(composite_dictionary); + symbol key; + char *value; + while(iter.get(&key, reinterpret_cast<void **>(&value))) { + assert(!key.is_null()); + assert(value != 0 /* nullptr */); + const char *k = key.contents(); + errprint("%1\t%2\n", k, value); + } + fflush(stderr); + skip_line(); +} + int trap_sprung_flag = 0; int postpone_traps_flag = 0; symbol postponed_trap; @@ -8631,6 +8646,7 @@ void init_input_requests() init_request("output", output_request); init_request("pc", set_page_character); init_request("pcolor", report_color); + init_request("pcomposite", report_composite_characters); init_request("pi", pipe_output); init_request("pm", print_macros); init_request("psbb", ps_bbox_request); _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit