groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 95/127: [troff]: Revise output warning diagnostic format.


From: G. Branden Robinson
Subject: [groff] 95/127: [troff]: Revise output warning diagnostic format.
Date: Mon, 10 Jul 2023 04:31:01 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8d450c650bf4b77fd6b0db97f78c5764c54b9300
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 6 20:37:58 2023 -0500

    [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.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 10 ++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6bd54a82b..29a9a8803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-05-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [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 <g.branden.robinson@gmail.com>
 
        [troff]: Trivially refactor.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a19935d20..59d9c2274 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8815,14 +8815,16 @@ static void do_error(error_type type,
     fputs("debug: ", stderr);
     break;
   case OUTPUT_WARNING:
-    double fromtop = topdiv->get_vertical_position().to_units() / warn_scale;
-    fprintf(stderr, "warning [p %d, %.1f%c",
+    double fromtop = topdiv->get_vertical_position().to_units() \
+                    / warn_scale;
+    fprintf(stderr, "warning [page %d, %.1f%c",
            topdiv->get_page_number(), fromtop, warn_scaling_indicator);
     if (topdiv != curdiv) {
       double fromtop1 = curdiv->get_vertical_position().to_units()
                        / warn_scale;
-      fprintf(stderr, ", div '%s', %.1f%c",
-             curdiv->get_diversion_name(), fromtop1, warn_scaling_indicator);
+      fprintf(stderr, " (diversion '%s', %.1f%c)",
+             curdiv->get_diversion_name(), fromtop1,
+             warn_scaling_indicator);
     }
     fprintf(stderr, "]: ");
     break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]