gbranden pushed a commit to branch master
in repository groff.

commit 10f0654fd3c6dc7671d85061be9b7e23ab852122
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Sep 17 07:58:32 2024 -0500

    [troff]: Improve `pcolor` report.
    
    * src/roff/troff/input.cpp (report_color): Report color space and
      channel assignments.
    
    * doc/groff.texi.in (Debugging):
    * man/groff.7.man (Request short reference):
    * man/groff_diff.7.man (New requests):
    * NEWS: Update documentation.
---
 ChangeLog                | 10 ++++++++++
 NEWS                     |  9 +++++----
 doc/groff.texi.in        |  8 ++++----
 man/groff.7.man          |  7 ++++---
 man/groff_diff.7.man     |  7 ++++---
 src/roff/troff/input.cpp |  2 +-
 6 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e5f95890d..d860c7860 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-09-17  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (report_color): Report color space
+       and channel assignments.
+
+       * doc/groff.texi.in (Debugging):
+       * man/groff.7.man (Request short reference):
+       * man/groff_diff.7.man (New requests):
+       * NEWS: Update documentation.
+
 2024-09-17  G. Branden Robinson <[email protected]>
 
        * src/include/color.h: Fix code style nit: drop unnecessary
diff --git a/NEWS b/NEWS
index f2ca8dbe0..c4c945192 100644
--- a/NEWS
+++ b/NEWS
@@ -101,10 +101,11 @@ o New registers `.it`, `.itc`, and `.itm` are available.  
These
   continuation (cf. the `it` and `itc` requests), and the name of the
   macro associated with the pending input trap, respectively.
 
-o A new request, `pcolor`, reports to the standard error stream the
-  current list of defined colors.  (A device's default stroke and/or
-  fill colors, "default", are not listed since they are immutable and
-  their details unknown to the formatter.)
+o A new request, `pcolor`, reports to the standard error stream each
+  defined color name, its color space identifier, and channel value
+  assignments.  (A device's default stroke and/or 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.
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index f809fd9d1..092052382 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17160,10 +17160,10 @@ or are interested @emph{only} in diagnostic output, 
you can suppress GNU
 @cindex dumping defined colors (@code{pcolor})
 @cindex defined colors, dumping (@code{pcolor})
 @cindex colors, defined, dumping (@code{pcolor})
-Report, to the standard error stream, the list of defined color names.
-A device's default stroke and/or fill colors, ``default'', are not
-listed since they are immutable and their details unknown to the
-formatter.
+Report, to the standard error stream, each defined color name, its color
+space identifier, and channel value assignments.  A device's default
+stroke and/or fill colors, ``default'', are not listed since they are
+immutable and their details unknown to the formatter.
 @endDefreq
 
 @Defreq {pcomposite, }
diff --git a/man/groff.7.man b/man/groff.7.man
index 1ae2b485b..02917ed08 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -3971,9 +3971,10 @@ Change the page number character used in titles
 .
 .TPx
 .REQ .pcolor
-Report,
-to the standard error stream,
-the list of defined color names.
+Report, to the standard error stream,
+each defined color name,
+its color space identifier,
+and channel value assignments.
 .
 A device's default stroke and/or fill colors,
 \[lq]default\[rq],
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 25aeba8a8..7b27028b8 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -3254,9 +3254,10 @@ which is read in copy mode and continues to the end of 
the input line.
 .
 .TP
 .B .pcolor
-Report,
-to the standard error stream,
-the list of defined color names.
+Report, to the standard error stream,
+each defined color name,
+its color space identifier,
+and channel value assignments.
 .
 A device's default stroke and/or fill colors,
 \[lq]default\[rq],
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6c30f5c67..3a2f713f4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1565,7 +1565,7 @@ static void report_color()
   while (iter.get(&key, reinterpret_cast<void **>(&value))) {
     assert(!key.is_null());
     assert(value != 0 /* nullptr */);
-    errprint("%1\n", key.contents());
+    errprint("%1\t%2\n", key.contents(), value->print_color());
   }
   fflush(stderr);
   skip_line();

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to