-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boxed within floating keep sends troff in endless loop (no output) #79
Comments
I can confirm what you're seeing. It appears to be due to double backslashes The traditional behavior was changed in commit 3f47f6... "Preserve |
@reffort Thanks for digging into this, I had no idea where to start. This definitely seems the point to fix it. I have not so much looked into the source, but it sounds like this could be not-so-wrong (from my phone, beware): case ESC: /* double backslash */
if (dilev)
i = ESC;
else if (prdblesc)
i = PRESC;
else
i = eschar;
goto gx; I'm absolutely not sure whether we should just perhaps fallthrough instead as I do not know what gx does etc., though. |
What I use is the original troff code:
but with a switch so I can use the other behavior if need be:
The variable The document will then need to make a distinction between an escape sequence and a printable escape character I think the behavior was probably changed to accommodate man pages that use the non-portable groff-specific convention, but I really don't know for sure. |
Hm, but isn't the current behavior wrong anyway? It is neither the 'old' behavior nor the groff behavior, as you wrote. On groff the code works as well as on 'old' troff. |
Reverting 3f47f6f, @leonardkoenig suggestion, and the original troff code cause wrong output of many manpages. case ESC:
if (prdblesc || (dilev && escesc))
i = PRESC;
else
i = eschr; with |
It would fix the manpage issue while keeping compatibility to use: case ESC:
if (prdblesc || (dilev && gemu))
i = PRESC;
else
i = eschr;
goto gx; |
Hm, but as far as I understand, heirloom's traditional behavior is not groff's behavior, which works for both, man-pages and this example code. Instead of supporting heirloom+old behavior, why not implement groff+old behavior -- or am I missing something? |
When I looked into this a while back, I got as far as realizing that groff handles escapes a different way than troff and I would have to dig into the groff code to find out how it worked, so I just took the easy way out with The double backslashes do work in groff with macros in nested diversions, and groff even correctly handles the on-the-fly macro code for output line traps defined several diversion levels deep (groff does not have output line traps, of course, but the macros work). Although groff's behavior is non-standard, I think it would be great if the double backslash could be made to work in diversions at multiple levels and with macros, because it would solve a consistency problem with C and sed about what As for What is the effect of |
Because of the endless loop issue it seems to be better to have the traditional behavior as the default by replacing |
With .eg, would prdblesc still be necessary?
Sent with [ProtonMail](https://protonmail.com) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Friday, November 2, 2018 3:10 PM, n-t-roff ***@***.***> wrote:
Because of the endless loop issue it seems to be better to have the traditional behavior as the default by replacing .ee with something like .eg (combine prdblesc and dilev with something that is 0 by default).
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#79 (comment)), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AMxHvzCilWfXDRtgUh170IkSBFBVv-Fhks5urKatgaJpZM4X-Ehy).
|
Without analyzing it--it is necessary for manpages, unfortunately. I agree that the actual issue are sloppy written manpages (and manpage generators like pod2man), but I can't change them and they work with groff. |
I understand where you're coming from about the manpage problems.
I realized right after I clicked the "Send" button that "prdblesc" (for fields) needs to work both at the top level and in a diversion, so it would be necessary in that case.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Saturday, November 3, 2018 7:40 AM, n-t-roff ***@***.***> wrote:
Without analyzing it--it is necessary for manpages, unfortunately. I agree that the actual issue are sloppy written manpages (and manpage generators like pod2man), but I can't change them and they work with groff.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#79 (comment)), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AMxHv4vVV6MLBnZ_JzYQeLnfxDohimhgks5urY6qgaJpZM4X-Ehy).
|
Minimum example (with
-ms -Tpost
):Interestingly reversing the order does not produce the problem (but probably results in different results):
This does not occur on the default troff of Illumos 2018.10 nor on Oracle Solaris 10 1/13, but on latest master (tested on Arch).
The text was updated successfully, but these errors were encountered: