bug-groff
[Top][All Lists]
Advanced

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

[bug #60913] suboptimal diagnostics when (mis)using .evc


From: G. Branden Robinson
Subject: [bug #60913] suboptimal diagnostics when (mis)using .evc
Date: Mon, 12 Jul 2021 14:26:13 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?60913>

                 Summary: suboptimal diagnostics when (mis)using .evc
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Mon 12 Jul 2021 06:26:11 PM UTC
                Category: Core
                Severity: 2 - Minor
              Item Group: Warning/Suspicious behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

.evc gives the same diagnostic for a missing argument as for an environment
name that doesn't exist.

Also, when warnings of type `missing` are enabled, multiple diagnostics are
emitted for the same problem.

Here's output from groff 1.22.4 and Git HEAD.


$ nroff -ww | cat -s
.evc
troff: <standard input>:1: warning: missing number
troff: <standard input>:1: No environment to copy from
.evc nope
troff: <standard input>:2: No environment to copy from


We can do better than this.  "[M]issing number" is downright misleading.

I have a patch in progress to resolve this and also perform a simplifying
refactor of the environment switching and copying implementations.  For some
reason both a 10-element array and a dynamically-managed dictionary of
environments were managed.  However, as far as I can tell, the only thing that
was ever stored in the environment array (`env_table`) was the default
environment named "0".  I'm guessing the array stuff is a relic of an early
implementation effort that was never completely cleaned up.


 env.cpp |   99
++++++++++++++++++----------------------------------------------
 1 file changed, 28 insertions(+), 71 deletions(-)





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 12 Jul 2021 06:26:11 PM UTC  Name: env.diff  Size: 9KiB   By:
gbranden

<http://savannah.gnu.org/bugs/download.php?file_id=51663>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60913>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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