bugGNU troff - Bugs: bug #57416, [PATCH] repair .AT and .UC in the...


bug #57416: [PATCH] repair .AT and .UC in the groff_man(7) macros

Submitted by:  Ingo Schwarze <schwarze>
Submitted on:  Sun 15 Dec 2019 05:04:41 PM UTC  
Category:  Macro - man Severity:  2 - Minor
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  Ingo Schwarze <schwarze>
Open/Closed:  Closed Planned Release:  1.22.5

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 16 Jan 2020 02:52:19 PM UTC, comment #6: 

Er, rather, fixed in a628605e2b26106a6e1e5afbf8cc390283099fa8.

Regression test added in 5ee5bb7f1222a9c53c434984d7a755d61569dcd0.

G. Branden Robinson <gbranden>
Project Member
Thu 16 Jan 2020 02:51:18 PM UTC, comment #5: 

Fixed in 5ee5bb7f1222a9c53c434984d7a755d61569dcd0.

G. Branden Robinson <gbranden>
Project Member
Thu 16 Jan 2020 01:48:03 PM UTC, comment #4: 

Your explanations make perfect sense.

I find myself wanting a "continuous-numbering, continuous-rendering" mode that doesn't suppress the page footers now.

I suppose that is a wishlist item.

And yes, the output generation part of my regression test is working fine with your updated patch.  When I crank back to "HEAD^", the .AT page wrongly gets the user-specified .TH field, but the .UC page is not incorrect.  However, I will check to see if that is a matter of ordering.

I'll finish my reg test, push it when I'm happy, and then close the ticket.


G. Branden Robinson <gbranden>
Project Member
Thu 16 Jan 2020 01:40:23 PM UTC, comment #3: 

Hi Branden,

thanks for checking!

The warning message was due to the four backslashes in "\\\\n[CT]".  Before the patch, that code was inside two nested macro definitions, so they all got expanded.  After the patch, it is only inside a single macro definition.  So i had to reduce the number of backslashes from four to two, which i did before pushing the patch.

Given that you agreed to the idea, i pushed it rather than starting a game of patch ping pong, hoping that will make life and testing easier for everyone.

Regarding the different behaviour in -T ps/pdf and -T utf8/ascii mode, note that the former macro .an-init was called at different  times depending on the cR register, which is on by default for nroff but off by default for troff.  So it doesn't surprise me that a bug related to it only affected some output devices.

Feel free to set this ticket to "closed" once you are satisfied that what we have in git is now good.  Thanks!

Ingo Schwarze <schwarze>
Project MemberIn charge of this item.
Thu 16 Jan 2020 10:35:06 AM UTC, comment #2: 

I can confirm the failure as Ingo describes on the `ps` device.

The really interesting bit is that the failure does not manifest on the `utf8` device.

G. Branden Robinson <gbranden>
Project Member
Thu 16 Jan 2020 10:30:47 AM UTC, comment #1: 

I'm writing a regression test for this, and, well, there's something wrong...

$ ./test-groff -Tutf8 -man src/devices/grops/grops.1
/home/branden/src/GIT/groff/build/../tmac/an-old.tmac:195: backtrace: string 'TH'
/home/branden/src/GIT/groff/build/../tmac/andoc.tmac:79: backtrace: macro 'TH'
troff: src/devices/grops/grops.1:1: warning: missing closing delimiter

Still scratching my chin over it (just started looking today, though).

I'm certainly a +1 on the idea here.  I'm just a greedy bastard and I want my regression test.

Please communicate my thanks to Jonathan Gray for finding this problem.

G. Branden Robinson <gbranden>
Project Member
Sun 15 Dec 2019 05:04:41 PM UTC, original submission:  

The following file does not work as expected:

.UC 4

In -Tps and -Tpdf output mode, it does not print the expected string "4th Berkeley Distribution" in the page footer because the (empty) default string from the an-init macro overrides what the author defines with .UC.

The comment

  \" This approach gets multiple man pages right.

is a lie: it doesn't even work for a single page.
Besides, even when a file contains multiple pages, all that is needed is setting the various strings on the right sides of the page breaks: those strings used in the page header before, those used in the page footer after the page break.

The attached patch works for single and multiple pages with and without .AT or .UC; OK to push it?

Ingo Schwarze <schwarze>
Project MemberIn charge of this item.


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

Attach Files:

Attached Files
file #48066:  man-UC.patch added by schwarze (4KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-16 gbranden StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 1.22.5
    2020-01-16 gbranden StatusFixed => Confirmed
        Planned Release1.22.5 => None
    2020-01-16 schwarze StatusConfirmed => Fixed
        Planned ReleaseNone => 1.22.5
    2020-01-16 gbranden StatusNone => Confirmed
    2019-12-15 schwarze Attached File- => Added man-UC.patch, #48066

    Back to the top

    Powered by Savane 3.5