groff-commit
[Top][All Lists]
Advanced

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

[groff] 88/115: [troff]: Revise output warning diagnostic format.


From: G. Branden Robinson
Subject: [groff] 88/115: [troff]: Revise output warning diagnostic format.
Date: Thu, 1 Jun 2023 10:46:15 -0400 (EDT)

gbranden pushed a commit to branch branden-2022-06-01
in repository groff.

commit f2a62ce1a965fe98f38783120ee2b1ee686e19cd
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 0cc7ade14..3947b2b23 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 041b9c4cb..2a514573a 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]