bugGNU roff - Bugs: bug #61909, [tbl] does not suppress...

 
 

bug #61909: [tbl] does not suppress inter-sentence space outside of text blocks

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Mon 24 Jan 2022 03:01:32 PM UTC
   
 
Category:  Preprocessor tbl 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
   

Jump to the original submission

Wed 30 Nov 2022 12:33:25 PM UTC, comment #8: 


commit f403592717e07dbf3a7886396d32618ddf73f74a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Nov 29 09:53:12 2022 -0600

    [tbl]: Regression-test Savannah #61909.

    * src/preproc/tbl/tests/save-and-restore-inter-sentence-space.sh: Do it.
    * src/preproc/tbl/tbl.am (tbl_TESTS): Run test.

    Test fails at this commit.

commit d75543ee567db15b2ac93309a4763401933b8f2c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Nov 29 10:05:21 2022 -0600

    [tbl]: Fix Savannah #61909.

    * src/preproc/tbl/table.cpp (SAVED_INTER_WORD_SPACE_SIZE)
      (SAVED_INTER_SENTENCE_SPACE_SIZE): Add new preprocessor macros.

    * src/preproc/tbl/table.cpp (SAVED_INTER_WORD_SPACE_SIZE)
      (SAVED_INTER_SENTENCE_SPACE_SIZE): Add new preprocessor macros.

      (block_entry::do_divert): Restore saved inter-word and inter-sentence
      space when formatting a text entry.

      (table::init_output): When a table region begions, save the values of
      inter-word and inter-sentence space.  Add request to the reset macro
      to restore saved inter-word and inter-sentence space when leaving
      table region.

      (table::do_top): Set inter-sentence space to be equal to inter-word
      space.  This way spaces are "literal" in ordinary table extries (but
      not text blocks).

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


G. Branden Robinson <gbranden>
Group administrator
Tue 29 Nov 2022 06:28:08 PM UTC, comment #7: 

I have a fix for this.

G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 09:23:32 AM UTC, comment #6: 

comment #5:

> comment #2:
> > > So making the groff behavior match Heirloom's would seem
> > > to give the user less control over the table rendering.
> >
> > Things that go into tbl(1) table entries (that are not text
> > blocks) tend strongly to not be sentences.  It is
> > surprising to me that each of the default text formatting
> > operations (enumerated in the man page) as "filling,
> > hyphenation, breaking, and adjustment" are disabled, but
> > supplementation with inter-sentence space is not.
>
> I agree, in light of that, the groff tbl behavior seems the
> anomalous one.  I was too much of a tbl n00b to appreciate the
> distinction between text in a cell and a text block.


No worries.  If the new text in tbl(1) doesn't make this
perfectly clear, please tell me.  I don't want others to
suffer as I did trying to craft a mental model of the
preprocessor's behavior.

> > So should we look at V7 troff?
>
> Only if you consider that fun.


I kind of do, but not enough to gate this activity on it.  If
John joins the discussion, we may have a bit of sport with it.

I do have a sick longing to revive the Tektronix 4014 as an
output device, though.

> I withdraw my dissent.


Cool.  I will try to see if I can get inter-sentence spacing
saved and disabled at the start of a table region, temporarily
restored a during text block (which may issue requests to modify
or switch it back off again), re-suppressed, and then finally
restored at the end of the table region.

Regards,
Branden

G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 07:11:06 AM UTC, comment #5: 

comment #2:

> > So making the groff behavior match Heirloom's would seem to give the
> > user less control over the table rendering.
>
> Things that go into tbl(1) table entries (that are not text blocks) tend
> strongly to not be sentences.  It is surprising to me that each of the
> default text formatting operations (enumerated in the man page) as
> "filling, hyphenation, breaking, and adjustment" are disabled, but
> supplementation with inter-sentence space is not.


I agree, in light of that, the groff tbl behavior seems the anomalous one.  I was too much of a tbl n00b to appreciate the distinction between text in a cell and a text block.

> So should we look at V7 troff?


Only if you consider that fun.  I withdraw my dissent.

Dave <barx>
Group Member
Tue 25 Jan 2022 06:51:59 AM UTC, comment #4: 

Nope.  No file attaching with lynx.


G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 06:46:12 AM UTC, comment #3: 

Trying again to attach file.  I didn't forget, but lynx and
Savannah seem to have gotten into a fight that resulted in an
TCP or HTTP timeout or something.

G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 06:38:20 AM UTC, comment #2: 

Hi, Dave!

comment #1:

> This is certainly worth documenting as a groff difference.  But it's
> not clear that it qualifies as a bug in groff rather than a bug in
> Heirloom troff.


I have no problem characterizing Heirloom Doctools troff as buggy, or
even Unix V7 troff as buggy (see bug #61597), but it's hard for me to
rationalize groff tbl's present behavior here.

> In particular, groff's system seems to give the user options that
> Heirloom's does not.


True.

> A groff user who doesn't want sentence spacing
> within a table need only invoke a .ss request before the .TS/.TE block
> to disable it.


Acknowledged.

> But how is an Heirloom user who does want such spacing to achieve
> it?


By making the table entry a text block.

> So making the groff behavior match Heirloom's would seem to give the
> user less control over the table rendering.


Things that go into tbl(1) table entries (that are not text blocks) tend
strongly to not be sentences.  It is surprising to me that each of the
default text formatting operations (enumerated in the man page) as
"filling, hyphenation, breaking, and adjustment" are disabled, but
supplementation with inter-sentence space is not.

Until the last few years, the phenomenon of inter-sentence space has
seen little discussion in *roff circles, it seems.  I am inclined to
think that people haven't complained about this because either (1) they
hadn't noticed or (2) they decided they just didn't understand tbl(1).

For the former group, this change will cause no problems.  For the
latter, I have a great deal of sympathy because I have struggled to
acquire competence with tbl until I undertook the task of rewriting our
man page for it.

A third group, one that takes Bjarni's belt-and-suspenders approach
to *roff input, will also notice no change, because they were
suppressing inter-sentence space all along.

> (I focus on Heirloom rather than Unix V7 because tbl-iss.roff as
> posted here is not legal V7 troff input: V7 troff's .ss request took
> only one argument.


And nroff ignores it anyway...(screenshot from V7 version of CSTR #54
attached).

> That it accepts the second without complaint only goes to show how
> long bug #61450 has been around.)


It has been around a long time, but in this case, it's ignored for the
same reason `ps` is.  The Teletype Model 37 just couldn't do that.

So should we look at V7 troff?  We can ask John Gardner to bust out his
cat-stream interpreter in JavaScript again.  I wish I had an easier time
using that thing.  Its generational clash of technologies makes it
perversely satisfying.

Regards,
Branden

G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 12:51:24 AM UTC, comment #1: 

This is certainly worth documenting as a groff difference.  But it's not clear that it qualifies as a bug in groff rather than a bug in Heirloom troff.

In particular, groff's system seems to give the user options that Heirloom's does not.  A groff user who doesn't want sentence spacing within a table need only invoke a .ss request before the .TS/.TE block to disable it.  But how is an Heirloom user who does want such spacing to achieve it?

So making the groff behavior match Heirloom's would seem to give the user less control over the table rendering.

(I focus on Heirloom rather than Unix V7 because tbl-iss.roff as posted here is not legal V7 troff input: V7 troff's .ss request took only one argument.  That it accepts the second without complaint only goes to show how long bug #61450 has been around.)

Dave <barx>
Group Member
Mon 24 Jan 2022 03:01:32 PM UTC, original submission:  

The tbl(1)s from Heirloom Doctools and Unix Version 7 do not supplement an ordinary table entry with inter-sentence space, but groff's tbl(1) does.

This seems wrong.  This bug is present in groff 1.22.4.


$ cat EXPERIMENTS/tbl-iss.roff
.ss 12 120
.TS
L.
Foo.  Bar.
.TE
$ nroff -t EXPERIMENTS/tbl-iss.roff | cat -s
Foo.           Bar.



PDP-11 simulator V3.8-1
sim> set cpu 11/45
Disabling XQ
sim> set tto 7b
sim> att rl unix_v7_rl.dsk
sim> boot rl
@boot
New Boot, known devices are hp ht rk rl rp tm vt
: rl(0,0)rl2unix
mem = 177856
# Restricted rights: Use, duplication, or disclosure
is subject to restrictions stated in your contract with
Western Electric Company, Inc.
Thu Sep 22 08:27:53 EDT 1988

login: dmr
$ cat > tbl-iss.roff
.ss 12 120
.TS
L.
Foo.  Bar.
.TE
$ tbl tbl-iss.roff | nroff
Foo.  Bar.


I'll have a look and see how hard this is.

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:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-30 gbranden Assigned toNone gbranden
    2022-11-30 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-11-29 gbranden StatusConfirmed In Progress
        Planned ReleaseNone 1.23.0
    2022-01-25 gbranden Attached File- Added unix_v7_troff_ss_request.png, #52727

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code