[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #55136] [ms] recover from .DS within .DS
From: |
G. Branden Robinson |
Subject: |
[bug #55136] [ms] recover from .DS within .DS |
Date: |
Fri, 30 Apr 2021 11:43:12 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Update of bug #55136 (project groff):
Severity: 3 - Normal => 1 - Wish
Status: None => In Progress
Assigned to: None => gbranden
Summary: [PATCH] s.tmac: Check the closure of the .DS macro
(display) => [ms] recover from .DS within .DS
_______________________________________________________
Follow-up Comment #2:
Bad news first:
1. I'm rejecting the patch.
2. The ms @fatal macro has been retired since this bug was filed, so it
wouldn't work anyway.
The good news:
3. Checking for nested diversions is a good idea, and user-friendly.
4. The situation is recoverable, with no loss of text, and therefore we don't
need a fatal diagnostic anyway as Bjarni suggested for such a scenario.
5. The recovery mechanism is already implemented and has been in place for
years.
6. A one-line patch not only addresses the simple reproducing case reported in
bug #55099, but it preserves groff ms's existing ability to have a display
within a footnote within a display.
7. We fare much better than Heirloom Doctools ms in this regard; it discards
the contents of all diversions in the stack, producing no diagnostic and
exiting with a successful status.
I'm attaching some reproducers. Here's the patch.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 01f92e62..9d617d4b 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1013,6 +1013,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.el .@error-recover mismatched .DE
..
.de DS
+.if '\\n(.z'ds*div' .@error-recover cannot use .DS within a .DS
.br
.di ds*div
.ie '\\$1'B' \{\
I'll do some more tests.
(file #51344, file #51345)
_______________________________________________________
Additional Item Attachment:
File name: ds-ds-de.ms Size:0 KB
<https://file.savannah.gnu.org/file/ds-ds-de.ms?file_id=51344>
File name: ds-ds-fn-de.ms Size:0 KB
<https://file.savannah.gnu.org/file/ds-ds-fn-de.ms?file_id=51345>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55136>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #55136] [ms] recover from .DS within .DS,
G. Branden Robinson <=