bugGNU roff - Bugs: bug #62826, [PATCH] [tmac] clearly comment bug...

 
 

bug #62826: [PATCH] [tmac] clearly comment bug #44714 workaround in andoc.tmac

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Wed 27 Jul 2022 09:45:24 PM UTC
   
 
Category:  Macro package - others/general Severity:  2 - Minor
Item Group:  Documentation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 15 Aug 2024 09:40:33 PM UTC, comment #9: 

comment #8:

> Uh, I goofed the commit and forgot to set the Author to you, Dave.


Not remotely concerned about that.  Thanks for applying the patch!

Dave <barx>
Group Member
Thu 15 Aug 2024 05:19:33 PM UTC, comment #8: 

Uh, I goofed the commit and forgot to set the Author to you, Dave.

Sorry about that.

It's correct in the ChangeLog.


commit 2911ff37fdb5055425298154eaa57f5907806c6e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Aug 9 03:32:03 2024 -0500

    tmac/andoc.tmac: Fix Savannah #62826.

    * tmac/andoc.tmac: Annotate "unnecessary" control lines.

    Fixes <https://savannah.gnu.org/bugs/?62826>.


G. Branden Robinson <gbranden>
Group administrator
Mon 22 Jul 2024 04:39:45 AM UTC, comment #7: 

Attaching a proposed patch to more clearly comment tmac/andoc.tmac.

If the deleted and unsupported sed script tmac/strip.sed is applied to andoc.tmac, andoc.tmac will fail, because the bug-workaround lines will be removed.  This is true of the current tmac file and of the modified version with my patch.  Bjarni argues for a more extensive change that lets andoc.tmac work even after stripping.  I consider this unnecessary because tmac stripping is deleted and unsupported.

(file #56295)

Dave <barx>
Group Member
Mon 06 May 2024 01:08:41 AM UTC, comment #6: 

Thanks for the clarification, Bjarni.

Since the patch is not relevant to anyone running groff tools as distributed, I'm removing the "[PATCH]" indicator.

The one thing this patch does that IMO is worth keeping is commenting the two empty lines that implement the bug #44714 workaround, especially as that bug report predicts it will be challenging to fix, suggesting the workaround will be in place quite a while.  And as I posted over there, the andoc.tmac comment near the top should cite bug #44714 rather than vaguely referring to "a bug in GNU troff."  (Or if the two empty lines themselves are given sufficiently detailed comments, this leading comment may not be needed anymore.)

So I'm altering this bug's Summary to reflect this reduced scope.

comment #5:

>   The test for such a change is
>
> test-nroff -mandoc -ww -z -t -C tmac/groff_mdoc.7


As Branden noted in the email thread linked in comment #1, test-nroff is your own script, not groff's.  (See bug #55941.)

Dave <barx>
Group Member
Sun 05 May 2024 10:44:30 PM UTC, comment #5: 

  I do not have a case example as I use stripping (expanded
'tmac/strip.sed') to avoid the repeated removal of non-essential
characters.

  Example is file 'tmac/doc.tmac'.

  Size

162336 mar 27 12:39 tmac/doc.tmac

  Stripped size

 90253 maĆ­  5 17:52 build/s-tmac/doc.tmac

  I can get rid of my '.hw' (and thus the '.' in tmac/doc.tmac)
line and the comments by changing '.de' to '.de1' for three
macros in 'tmac/mdoc/doc-common'

  The test for such a change is

test-nroff -mandoc -ww -z -t -C tmac/groff_mdoc.7

N.B.

  cd tmac/mdoc

  The files in this directory have to be changed to
non-compatibility mode like some other tmac files.

Bjarni Ingi Gislason <bjarniig>
Thu 02 May 2024 01:10:00 AM UTC, comment #4: 

Classifying this as a documentation issue, since the two instances of the bug #44714 workaround already present in tmac/andoc.tmac should indeed be documented as such.

Dave <barx>
Group Member
Thu 02 May 2024 12:53:57 AM UTC, comment #3: 

In the cited email thread, a bug occurs only when the deleted sed script tmac/strip.sed is applied to tmac/andoc.tmac.  This sed script is no longer shipped or supported (bug #55091).

Bjarni, can you post a test case that demonstrates buggy behavior using supported tools?

I do agree that until bug #44714 is fixed, the empty control lines to work around it should be commented.  But the rest of the proffered patch appears to be to support a local customization.

And even for that purpose, it looks like overkill.  Why have the .ie and two separate branches, simply to include or exclude the bug-workaround line?  That line should have no effect regardless of the compatibility-mode setting, so why not simply always include it and eliminate the conditional?

Dave <barx>
Group Member
Wed 01 May 2024 06:25:56 AM UTC, comment #2: 

comment #1:

> .\" Due to a bug in GNU troff it necessary to have a no-op line between
> .\" '.do' and '\*'.


This is bug #44714.

> +.  do ie \\n[.cp] \{\
> +.    do als TH reload-man
> +.    hw\"DO NOT REMOVE the line, see an earlier comment about a bug
> +\\*(Dd\\


The current andoc.tmac demonstrates that an empty control line is sufficient to work around #44714.  A control line with only a comment also works.  Using a bare .hw as a no-op, although it acts as one, unnecessarily complicates the code and confuses readers.

Dave <barx>
Group Member
Thu 28 Jul 2022 12:37:15 PM UTC, comment #1: 

  There were extra two lines ".  fi" in the first patch.


From 24e4cf7dfedd58b2a1be6c600d27fed937d24fb0 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Thu, 28 Jul 2022 12:32:11 +0000
Subject: [PATCH] [tmac] options "-mandoc" and '-C' are not compatible

  See also
https://lists.gnu.org/archive/html/bug-groff/2022-07/msg00039.html
and number 40, 43, 44, and 106.

"\\*[<macro>]\\" does not work in compatibility mode after a ".do"
according to a comment earlier in the file:

.\" Due to a bug in GNU troff it necessary to have a no-op line between
.\" '.do' and '\*'.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/andoc.tmac | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tmac/andoc.tmac b/tmac/andoc.tmac
index 4e3f0dd35..ccd930295 100644
--- a/tmac/andoc.tmac
+++ b/tmac/andoc.tmac
@@ -66,9 +66,15 @@
 .  do rm Dd          \" force reinitialization of doc.tmac
 .  do mso doc.tmac
 .
-.  do als TH reload-man
-.
+.  do ie \\n[.cp] \{\
+.    do als TH reload-man
+.    hw\"DO NOT REMOVE the line, see an earlier comment about a bug
+\\*(Dd\\
+.  \}
+.  el \{\
+.    als TH reload-man
 \\*(Dd\\
+.  \}
 ..
 .
 .de reload-man
@@ -89,9 +95,15 @@
 .  do rm TH          \" force reinitialization of an.tmac
 .  do mso an.tmac
 .
-.  do als Dd reload-doc
-.
+.  do ie \\n[.cp] \{\
+.    do als Dd reload-doc
+.    hw\"DO NOT REMOVE the line, see an earlier comment about a bug
+\\*(TH\\
+.  \}
+.  el \{\
+.    als Dd reload-doc
 \\*(TH\\
+.  \}
 ..
 .
 .als TH reload-man
--
2.35.1


Bjarni Ingi Gislason <bjarniig>
Wed 27 Jul 2022 09:45:24 PM UTC, original submission:  

From 314284934893379281edd2ded2233afae00f24a0 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Wed, 27 Jul 2022 21:35:52 +0000
Subject: [PATCH] [tmac] options "-mandoc" and '-C' are not compatible

  See also
https://lists.gnu.org/archive/html/bug-groff/2022-07/msg00039.html
and number 40, 43, 44, and 106.

"\\*[<macro>]\\" does not work in compatibility mode after a ".do"
according to a comment earlier in the file:

.\" Due to a bug in GNU troff it necessary to have a no-op line between
.\" '.do' and '\*'.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/andoc.tmac | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/tmac/andoc.tmac b/tmac/andoc.tmac
index 4e3f0dd35..a8c65a6f2 100644
--- a/tmac/andoc.tmac
+++ b/tmac/andoc.tmac
@@ -66,9 +66,16 @@
 .  do rm Dd          \" force reinitialization of doc.tmac
 .  do mso doc.tmac
 .
-.  do als TH reload-man
-.
+.  do ie \\n[.cp] \{\
+.    do als TH reload-man
+.    hw\"DO NOT REMOVE this line, see an earlier comment about a bug
+\\*(Dd\\
+.  \}
+.  el \{\
+.    als TH reload-man
 \\*(Dd\\
+.  \}
+.  fi
 ..
 .
 .de reload-man
@@ -89,9 +96,16 @@
 .  do rm TH          \" force reinitialization of an.tmac
 .  do mso an.tmac
 .
-.  do als Dd reload-doc
-.
+.  do ie \\n[.cp] \{\
+.    do als Dd reload-doc
+.    hw\"DO NOT REMOVE this line, see an earlier comment about a bug
+\\*(TH\\
+.  \}
+.  el \{\
+.    als Dd reload-doc
 \\*(TH\\
+.  \}
+.  fi
 ..
 .
 .als TH reload-man
--
2.35.1


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56295:  62826.patch added by barx (790B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-08-15 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2024-08-09 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2024-07-22 barx Attached File- Added 62826.patch, #56295
        Summary[tmac] clearly comment bug #44714 workaround in andoc.tmac [PATCH] [tmac] clearly comment bug #44714 workaround in andoc.tmac
    2024-05-06 barx Severity3 - Normal 2 - Minor
        StatusNeed Info None
        Summary[PATCH] [tmac] options &quot;-mandoc&quot; and '-C' are not compatible [tmac] clearly comment bug #44714 workaround in andoc.tmac
    2024-05-02 barx Item GroupNone Documentation
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.14-9aa3.
    Corresponding source code