bugGNU roff - Bugs: bug #58162, unicode.tmac re-enables...

 
 

bug #58162: unicode.tmac re-enables compatibility mode

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sun 12 Apr 2020 03:55:07 AM UTC
   
 
Category:  Macro - others/general Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 24 Feb 2023 11:00:51 PM UTC, comment #5: 


commit 1474eebe1f83c439dd6d422a311c1c39417fac40
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun Apr 19 15:24:24 2020 +1000

    **/*.{man,tmac}: Save compatibility mode robustly.

    Use new \n[.cp] register to save compatibilty mode.

    Use register names based on the filename (at the source maintenance
    level) to avoid clobbering other files' saved compatibility modes.

    tmac/html.tmac: Eliminate reference to saved-compatibility register by
    moving its test inside the block where compatibility mode is off.  This
    is the only part of this changeset that was not automated.


G. Branden Robinson <gbranden>
Group administrator
Sun 19 Apr 2020 10:09:35 AM UTC, comment #4: 

Fixed in 1474eebe1f83c439dd6d422a311c1c39417fac40.

G. Branden Robinson <gbranden>
Group administrator
Sun 12 Apr 2020 04:02:27 AM UTC, comment #3: 

Those of you reading only the email interface will think I'm an EVEN BIGGER idiot than I am.  Check the web interface.

Bad verbatim pairing is not handled gracefully.

G. Branden Robinson <gbranden>
Group administrator
Sun 12 Apr 2020 03:59:54 AM UTC, comment #2: 

I have a voodoo doll of Savannah and I am burning it, slowly.

---

John Gardner noticed the following regression test failure (for a different software project) on groff git HEAD relative to groff 1.22.4 (which does not have this bug).


*Command:*
printf '.ds FOO BAR\n\\*[FOO]' | groff -C -Tutf8 | head -n1

*Expected output:*
FOO]

*Actual output:*
BAR


He also identified the cause:


From a glance, it looks like the `.C` register is being set twice: once by the calling tty.tmac, and again by unicode.tmac.


So the saved register value was being clobbered.

The real problem here, contrary to my initial thoughts on the mailing list thread, is not the save/restore approach but a namespace problem.  A common pattern in macro files and in the man pages in the tree is to just save the .C register in a register named _C.  This fails as soon as nesting happens.

A while back I ground through all the man pages to make them save to uniquely-named registers, but out of timidity I did not the stuff in the tmac directory, where it actually would have done more good.  When I added save/restore to this file in 2019, I cautiously copied examples from the same directory.  But they were bad examples in this respect!

G. Branden Robinson <gbranden>
Group administrator
Sun 12 Apr 2020 03:57:31 AM UTC, comment #1: 

Savannah cruelly truncated my bug submission.  Fortunately, I was able to go back in my browser history and get it.

What gives, Savannah?

---

John Gardner noticed the following regression test failure (for a different software project) on groff git HEAD relative to groff 1.22.4 (which does not have this bug).


*Command:*
printf '.ds FOO BAR\n\\*[FOO]' | groff -C -Tutf8 | head -n1

*Expected output:*
FOO]

*Actual output:*
BAR
+verbatim+

He also identified the cause:

+verbatim+
From a glance, it looks like the `.C` register is being set twice: once by the calling tty.tmac, and again by unicode.tmac.


So the saved register value was being clobbered.

The real problem here, contrary to my initial thoughts on the mailing list thread, is not the save/restore approach but a namespace problem.  A common pattern in macro files and in the man pages in the tree is to just save the .C register in a register named _C.  This fails as soon as nesting happens.

A while back I ground through all the man pages to make them save to uniquely-named registers, but out of timidity I did not the stuff in the tmac directory, where it actually would have done more good.  When I added save/restore to this file in 2019, I cautiously copied examples from the same directory.  But they were bad examples in this respect!

G. Branden Robinson <gbranden>
Group administrator
Sun 12 Apr 2020 03:55:07 AM UTC, original submission:  

John Gardner noticed the following regression test failure (for a different software project) on groff git HEAD relative to groff 1.22.4 (which does not have this bug).


*Command:*
printf '.ds FOO BAR\n\\*[FOO]' | groff -C -Tutf8 | head -n1

*Expected output:*
FOO]

*Actual output:*
BAR
+verbatim+

He also identified the cause:

+verbatim+
From a glance, it looks like the `.C` register is being set twice: once by the calling tty.tmac, and again by unicode.tmac.


So the saved register value was being clobbered.

The real problem here, contrary to my initial thoughts on the mailing list thread, is not the save/restore approach but a namespace problem.  A common pattern in macro files and in the man pages in the tree is to just save the .C register in a register named _C.  This fails as soon as nesting happens.

A while back I ground through all the man pages to make them save to uniquely-named registers, but out of timidity I did not the stuff in the tmac directory, where it actually would have done more good.  When I added save/restore to this file in 2019, I cautiously copied examples from the same directory.  But they were bad examples in this respect!

G. Branden Robinson <gbranden>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-01 gbranden Planned ReleaseNone 1.23.0
    2020-04-19 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code