[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] vertical resolution and page location traps
From: |
Ralph Corderoy |
Subject: |
Re: [groff] vertical resolution and page location traps |
Date: |
Sun, 17 Jun 2018 12:51:14 +0100 |
Hi,
> > > > Reason is that traps are not recursive, IIRC: Traps are not
> > > > handled while another trap is active (this seems to be missing
> > > > in the info file).
...
> > > > In other words, while your first trap is active, it moves down
> > > > one line, which passes some traps without triggering them.
> > >
> > > That bit of information is missing from the manual
> >
> > And from CSTR 54. Werner, are you sure about that? I don't recall
> > hearing it before.
>
> No, I'm not sure
I think I've a test of this behaviour that shows a trap is sprung whilst
another is active.
$ cat recurse.tr
.de t0
t0a
.sp 2i
t0b
.br
..
.de t1
t1
.br
..
.wh 1i t0
.wh 2i t1
foo
.sp 4i
bar
$
$ groff -Tascii recurse.tr | tac | sed -n '/./{:l;p;n;bl}' | tac
foo
t0a
t1
t0b
bar
$
`foo' is at the top of the page.
The `.sp 4i' that follows it gets as far as 1i when `t0' trips,
six lines on being one inch, outputting `t0a', and attempting to move
past `t1's trap at 2i.
But it can't sneak past, `t1' is sprung, the `recursion' mentioned
above, and the rest of `t0's `.sp 2i' is cancelled.
`t1' finishes, we return back to `t0' that outputs `t0b'.
And then it returns and `bar' appears.
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy