bugGNU roff - Bugs: bug #63142, [troff] unsupport newlines as...

 
 

bug #63142: [troff] unsupport newlines as escape argument delimiters

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 30 Sep 2022 11:33:47 PM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Feature change Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Aug 2024 12:40:09 AM UTC, comment #4: 


commit 1e53037d5d3f934cf89081436f39f87ff2f2efad
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Aug 19 14:11:56 2024 -0500

    [troff]: Fix Savannah #63142 (newlines as delims).

    Withdraw support for newlines as escape sequence delimiters.  Only a few
    (6) supported this, and the rationale behind it is unknown.  DWB 3.3
    troff didn't behave this way in any case.

    * src/roff/troff/input.cpp (do_overstrike, do_bracket, do_name_test)
      (do_zero_width_output, do_width, do_device_control): Do it.  As a
      bonus, check starting delimters for these escape sequences
      (`\[obAZwX]`) for validity in general.

      (do_overstrike, do_bracket, do_zero_width_output): When returning
      early, delete the `new` node we just allocated to avoid leaking
      memory.

      (token:next): Be prepared for the `\b` and `\o` escape sequences
      to return a null pointer (if the sequence doesn't even validly
      get off the ground), as `\Z` and `\X` already do.

    * src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh:
      Delete.
    * src/roff/groff/groff.am (groff_TESTS): Drop test.

    * doc/groff.texi.in (Delimiters):
    * man/groff.7.man (Delimiters):
    * NEWS: De-document support for newlines as delimiters.

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


G. Branden Robinson <gbranden>
Group administrator
Sat 08 Oct 2022 12:40:47 AM UTC, comment #3: 

CSTR#54's section 5.2 makes the general observation "In \x'...' and other functions [sic] having a pair of delimiters around their parameter, the delimiter choice (here ') is arbitrary...", a nicely ambiguous term that could be interpreted as anything from "any punctuation mark" to "any printing character" to "any ASCII character."  So historical behavior does seem a more reliable guide here than historical documentation.

Dave <barx>
Group Member
Tue 04 Oct 2022 02:34:12 AM UTC, comment #2: 

I don't aim to move on this until after 1.23.

G. Branden Robinson <gbranden>
Group administrator
Sat 01 Oct 2022 06:37:31 PM UTC, comment #1: 


Heirloom Doctools troff in non-groff compatibility mode:


$ ./bin/nroff -V
Heirloom doctools nroff, release 191015
$ printf '.xflag 0\n\A\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '.xflag 0\n.sp\n\b\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '.xflag 0\n\o\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '.xflag 0\n\w\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

0ABC D
$ printf '.xflag 0\n\X\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '.xflag 0\n\Z\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff | cat -s
ABC D


DWB 3.3:


$ ./bin/nroff -V
nroff: DWB 3.3   8/3/16 18:29
$ printf '\A\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff | cat -s
A ABC D

$ printf '.sp\n\b\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '\o\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '\w\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

0ABC D
$ printf '\X\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff

ABC D
$ printf '\Z\nABC\nD\n.pl \\n(nlu\n' | ./bin/nroff | cat -s
Z ABC D


G. Branden Robinson <gbranden>
Group administrator
Fri 30 Sep 2022 11:33:47 PM UTC, original submission:  

I recently had to research this issue to revise the corresponding section of our Texinfo manual.

https://git.savannah.gnu.org/cgit/groff.git/tree/doc/groff.texi?id=f86b47890a6759bbef94216bf6f9cd7fe337cfe3#n6935

I've taken time to look at Heirloom Doctools troff and its ancestor DWB 3.3 troff, and I found out to my surprise that this support for newlines as escape delimiters does not appear to be a backward-compatibility provision.

This feature was undocumented in our man pages, incorrectly documented in our Texinfo manual for 20 years, and was associated with the spurious emission of a warning when attempted (bug #63011).

I therefore propose to emit a deprecation diagnostic for this case and remove it from a future (post-1.23) groff release.

I'll return with exhibits of groff, Heirloom, and DWB behavior from their respective Git HEADs...but first I found a bug in our handling of \Z, so I'm going to chase that down first.

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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-08-20 gbranden Planned ReleaseNone 1.24.0
    2024-08-20 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2024-08-19 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2024-07-11 gbranden Dependencies- bugs #65099 is dependent
    2024-07-11 gbranden Summary[troff] deprecate newlines as escape argument delimiters [troff] unsupport newlines as escape argument delimiters
    2023-08-10 gbranden StatusPostponed None
    2022-10-04 gbranden Summary[troff] deprecate newlines as escape argument delimeters [troff] deprecate newlines as escape argument delimiters
    2022-10-04 gbranden StatusNeed Info Postponed
        Summary[troff]: deprecate newlines as escape argument delimeters [troff] deprecate newlines as escape argument delimeters

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code