[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #55099] [ms]: nesting displays leads to confusing diagnostics
From: |
G. Branden Robinson |
Subject: |
[bug #55099] [ms]: nesting displays leads to confusing diagnostics |
Date: |
Fri, 30 Apr 2021 10:51:44 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Update of bug #55099 (project groff):
Status: Need Info => Fixed
Assigned to: None => gbranden
Open/Closed: Open => Closed
Planned Release: None => 1.23.0
Summary: undiagnosed error leads to misbehavior => [ms]:
nesting displays leads to confusing diagnostics
_______________________________________________________
Follow-up Comment #3:
I'm retrospectively regarding this ticket as a complaint about the
uncommunicative error message. That part of the problem was addressed in a
commit in March. ms uses diversions extensively, and there were simpler ways
to provoke such a message, such as with a document consisting solely of
".TL".
Here's what the error message looks like now.
s.tmac: error: diversion open while ejecting page (last file seen:
EXPERIMENTS/ds-ds-de.ms) (recovering)
This isn't as good as catching a problem when someone tries to call .DS within
an existing display diversion, but that's precisely the topic of bug #55136 as
Bjarni and Dave noted, so I'll treat that issue orthogonally rather than
regarding either of these two reports as a duplicate.
commit c7b14cb8f84b102dd591843a4e7fc2fbfe2a25a3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date: Tue Mar 2 10:38:01 2021 +1100
tmac/s.tmac: Improve diagnostic messages.
(@diag): New macro wraps .tm request, always prefixing it with the name
of the macro package, as well as file and line indicators only if these
are set to non-empty or non-zero values, respectively.
(@error, @warning): Call @diag instead of .tm directly.
(@fatal): Retire; it had only one call site and it would have greatly
complicated @diag to support calling .ab instead of .tm. An ugly
alternative would have been to call .ab with a redundant message after
calling @diag.
(@divert): New macro wraps .di request, remembering the name of
the current file (\n[.F]) when a diversion is started.
(@error-recover): Call .ab instead of (deleted) @fatal.
(pg@super-eject): Tell user what the last file name seen was when
recovering from an unfinished diversion when processing ends.
Examples of improved output compared to groff 1.22.4 follow.
$ (printf ".TL\n" > foo.ms; nroff -ms foo.ms | sed '/^$/d'; rm foo.ms)
:0: macro error: diversion open while ejecting page (recovering)
$ (printf ".TL\n" > foo.ms; ./build/test-groff -ms foo.ms \
| sed '/^$/d'; rm foo.ms)
s.tmac: error: diversion open while ejecting page (last file seen: foo.ms)
(recovering)
$ (printf '.nr a 23 1\n.while \\n-a .di d\\na\n' > foo.ms; \
nroff -ms foo.ms | sed '/^$/d'; \rm foo.ms)
:0: macro error: diversion open while ejecting page (recovering)
:0: fatal macro error: recovery failed
$ (printf '.nr a 23 1\n.while \\n-a .di d\\na\n' > foo.ms; \
./build/test-groff -ms foo.ms | sed '/^$/d'; \rm foo.ms)
s.tmac: error: diversion open while ejecting page (last file seen: foo.ms)
(recovering)
s.tmac: fatal error: recovery failed
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55099>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #55099] [ms]: nesting displays leads to confusing diagnostics,
G. Branden Robinson <=