bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61428] [me] new page-length restriction too restrictive


From: G. Branden Robinson
Subject: [bug #61428] [me] new page-length restriction too restrictive
Date: Tue, 7 Dec 2021 18:00:27 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #61428 (project groff):

                  Status:             In Progress => Need Info              

    _______________________________________________________

Follow-up Comment #6:

Hi Dave,

[comment #0 original submission:]
> The fix to bug #61034 has the side effect of disallowing input that formerly
worked, e.g.:
> 
> printf '.pl 10v\nHello.\n' | groff -me -Tascii
> 
> This produced an error-free 10 lines of screen output in 1.22.4.  In a build
from the latest sources, it aborts with the error "e.tmac: cannot format short
page length 400u".

I'm all for minimal reproducing cases, but that one might be _too_ minimal...!
 It doesn't really exercise any me(7) features.  The package gets initialized,
sure...

Let's make it a real me(7) document.


$ cat EXPERIMENTS/hello-dave1.me 
.pp
Hello, Dave.
$ nroff -me EXPERIMENTS/hello-dave1.me | cat -s

     Hello, Dave.


Sure, seems all right.  But it's also formatting for a 66-line page, which
I've elided with `cat -s`.

Let's add some headers and footers.


$ cat EXPERIMENTS/hello-dave2.me 
.he 'A'B'C'
.fo 'D'E'F'
.pp
Hello, Dave.
$ nroff -me EXPERIMENTS/hello-dave2.me | cat -s

A                             B                            C

     Hello, Dave.

D                             E                            F


We're still good.  Now let's add your `pl` request.


$ cat EXPERIMENTS/hello-dave3.me 
.pl 10v
.he 'A'B'C'
.fo 'D'E'F'
.pp
Hello, Dave.
$ nroff -me EXPERIMENTS/hello-dave3.me | cat -s

A                             B                            C

     Hello, Dave.



Now something has gone wrong--our footer is missing and me(7) didn't even
complain.  It is very hard for me to regard this as acceptable output.

If the writer wants a page length that short they need to modify the vertical
margin registers to get it.

meref.me says (approximately, I'm in the midst of revising the entire
manual):


The spacing
of headers and footers
is controlled by four registers.
.NR (hm
[4v]
is the distance from the top of the page
to the top of the header,
.NR (fm
[3v]
is the distance from the bottom of the page
to the bottom of the footer,
.NR (tm
[7v]
is the distance from the top of the page
to the top of the text,
and
.NR (bm
[6v]
is the distance from the bottom of the page
to the bottom of the text
(nominal).


I _think_ that by "nominal", all Allman meant was that that distance was as
low as the running text could get; we're all familiar with pages that fail to
fill due to the text ending, `ne` requests, keeps, and so on.  I don't _think_
it intends to suggest anything about the footer getting chopped off.

One can reasonably protest that if we don't have headers and footers at all,
we should be allowed to have a shorter page length.  But that is not how me(7)
is designed.  The `tm` and `bm` registers are independent of header/footer
usage, and in fact fiddly calculations are required to take them into
account.

This is revealed when you check out the definitions of the super-legacy,
early-1970s *old* roff compatibility feature.


.de m1                  \" *** position one space
.nr _0 \\n(hmu
.nr hm \\$1v
.nr tm +\\n(hmu-\\n(_0u
.rr _0
..
.
.de m2                  \" *** position two space
.nr tm \\n(hmu+\\n(tpp+\\$1v
..
.
.de m3                  \" *** position three space
.nr bm \\n(fmu+\\n(tpp+\\$1v
..
.
.de m4                  \" *** position four space
.nr _0 \\n(fmu
.nr fm \\$1v
.nr bm +\\n(fmu-\\n(_0u
..


At some point Ossanna and Lesk et al. (?) decided that it made more sense, I
surmise, to measure the vertical margins to the running text independently of
the presence of (three-part) titles.

Anyway, the bottom line (heh) here is that a default me(7) document absolutely
demands 13 vees of space in a document, and one more than that if it's going
to have any running text at all.  This jibes with my experimental approach
that led to the hard-coded 14v.

I think the think to do here is make the `check_page_length` macro ensure that
the page length is strictly greater than the sum of `tm` and `bm`, (or greater
than or equal to the sum of `tm`, `bm`, and the line height `.v`.)  As
implemented, the check is definitely wrong because me(7) exposes all of those
as configurable (`.v` only directly though--you're supposed to use its `$v`
percentage instead).

I believe I can satisfy the flexibility requirement but not the
simplicity-of-input requirement in your original message quoted above.  My
view is that if someone wants me(7) to render extremely short pages, they need
to do the slight extra work of setting `tm` and `bm` values appropriate to
that unorthodox length--and `hm` and `fm` too, if they want titles on those
short pages.

What do you think?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61428>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]