gbranden pushed a commit to branch master
in repository groff.

commit 5190ee10df6cdd0f1ded7423487528670056e23e
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Sep 9 16:00:33 2024 -0500

    [troff]: Improve `pev` request output.
    
    * src/roff/troff/env.cpp (print_env): Improve environment report.  Don't
      report two items of stale data about a completed line, and describe
      them more intelligibly.  Say "text length" rather than "total width";
      the former is what is compared to the already reported "target text
      length".  Clarify "total number of spaces" as "number of adjustable
      spaces"; that's what's really counted.  Relocate report of "target
      text length" to more follow "text length" and "number of adjustable
      spaces" to make their relationship more obvious.
---
 ChangeLog              | 12 ++++++++++++
 src/roff/troff/env.cpp | 10 ++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2b5d80a3f..834b65d18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-09-08  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/env.cpp (print_env): Improve environment
+       report.  Don't report two items of stale data about a completed
+       line, and describe them more intelligibly.  Say "text length"
+       rather than "total width"; the former is what is compared to the
+       already reported "target text length".  Clarify "total number of
+       spaces" as "number of adjustable spaces"; that's what's really
+       counted.  Relocate report of "target text length" to more
+       follow "text length" and "number of adjustable spaces" to make
+       their relationship more obvious.
+
 2024-09-08  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (environment_copy, space_size):
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index b2564ab07..60df14ed0 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3525,8 +3525,6 @@ void environment::print_env()
   errprint("  temporary indentation pending: %1\n",
           have_temporary_indent ? "yes" : "no");
   errprint("  total indentation: %1u\n", saved_indent.to_units());
-  errprint("  target text length: %1u\n",
-          target_text_length.to_units());
   if (underlined_line_count > 0) {
     errprint("  lines remaining to underline: %1\n",
             underlined_line_count);
@@ -3544,8 +3542,12 @@ void environment::print_env()
   }
   errprint("  previous text length: %1u\n",
           prev_text_length.to_units());
-  errprint("  total width: %1u\n", width_total.to_units());
-  errprint("  total number of spaces: %1\n", space_total);
+  if (line != 0 /* nullptr */) {
+    errprint("  text length: %1u\n", width_total.to_units());
+    errprint("  number of adjustable spaces: %1\n", space_total);
+  }
+  errprint("  target text length: %1u\n",
+          target_text_length.to_units());
   errprint("  input line start: %1u\n", input_line_start.to_units());
   errprint("  computing tab stops from: %1\n",
           using_line_tabs ? "output line start (\"line tabs\")"

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

Reply via email to