infinite page length?

2020-04-29 Thread James K. Lowden
I don't understand how man(1) suppresses pagination.  Is there any
simple trick to viewing -ms documents in nroff without page
boundaries?  

I didn't find it in the papersize documentation.   Proof that I read
it, I found a typo:

The  value  of the papersize file can be overrideen 
by looking in order

I thought there might be a "fake" paper size, like length 0 or
something, that indicates no pagination is needed.  

I guess it has something to do with the macro set and the target
device, since mdoc is unpaginated in the terminal and paginated as
PDF.  It would be nice to have the same available with ms.  

Many thanks.

--jkl



Re: Potential enhancements to install-font.sh from https://www.schaffter.ca/mom/bin/install-font.sh

2020-04-29 Thread James K. Lowden
On Tue, 28 Apr 2020 17:45:46 -0400
Peter Schaffter  wrote:

> > Also, wouldn't this script be useful to include in the groff
> > distribution?
> 
> I'm inclined to think so, however it contains non-portable bashisms
> and so might not be appropriate.  The script was a quick and dirty
> solution to font installation.  

That's the best and biggest Q&D shell script I've ever seen.  

> Something similar but more robust and not reliant on a particular
> shell interpreter would be better.

I just took a look, Peter, because I have some experience writing
Bourne shell scripts.  I don't see anything bash-specific, just looking
over it.  You might just change #!/bin/bash to #!/bin/sh; I think it
will run pretty well, maybe perfectly.  

If I were publishing it, I'd remove the VT100 escape codes, and format
my if statements without semicolons:

if [ foo ]
then
bar
fi

because that's what Steven Bourne intended.  ;-)  

If you decide to add it to the distibution, I'll write the man page.  

--jkl




Re: infinite page length?

2020-04-29 Thread G. Branden Robinson
At 2020-04-29T17:04:27-0400, James K. Lowden wrote:
> I don't understand how man(1) suppresses pagination.  Is there any
> simple trick to viewing -ms documents in nroff without page
> boundaries?

Hi James!

I believe the answer is in an-old.tmac:

.\" We redefine .ne to avoid page breaks if cR is set; instead, the page
.\" length is increased to the necessary amount (this is needed for
.\" tables).
.\"
.\" Similarly, we redefine .bp if cR is set, adjusting the page length
.\" to the current position so that no empty lines are inserted.
.if \n[cR] \{\
.  de1 ne
.ie \\n[.$] \
.  nr an-ne (v;\\$*)
.el \
.  nr an-ne 1v
.if (\\n[an-ne] >= \\n[.t]) \
.  pl +(\\n[an-ne]u - \\n[.t]u + 1v)
.  .
.
.  rn bp an-bp
.  de1 bp
.br
.pl \\n[nl]u
.an-bp \\$*
.  .
.\}

> 
> I didn't find it in the papersize documentation.   Proof that I read
> it, I found a typo:
> 
>   The  value  of the papersize file can be overrideen
>   by looking in order

You appear to be referring to the papersize(5) man page.  On my
Debian-based system, this comes from a package called "libpaper1".

> I thought there might be a "fake" paper size, like length 0 or
> something, that indicates no pagination is needed.

That would be handy, but I have no idea if this could be added to the
core of the roff language without breaking things.

Individual macro packages can obviously hack round it.

The tbl preprocessor also needs a hack for tables of unbounded length;
see https://savannah.gnu.org/bugs/?57665 .

> I guess it has something to do with the macro set and the target
> device, since mdoc is unpaginated in the terminal and paginated as
> PDF.  It would be nice to have the same available with ms.

Maybe someone else on the list has an idea how practical this might be;
I don't.

Regards,
Branden


signature.asc
Description: PGP signature


Re: Potential enhancements to install-font.sh from https://www.schaffter.ca/mom/bin/install-font.sh

2020-04-29 Thread G. Branden Robinson
At 2020-04-29T17:04:31-0400, James K. Lowden wrote:
> If I were publishing it, I'd remove the VT100 escape codes, and format
> my if statements without semicolons:
> 
>   if [ foo ]
>   then
>   bar
>   fi
> 
> because that's what Steven Bourne intended.  ;-)  

I second the Bourne "brace style"; after many years resisting it I
finally gave in.

There's nothing wrong with SGR escapes as long as uses them portably.
You don't even have to learn the details of the escape codes with their
inscrutable syntax an unmemorizable numerical codes.

You can see an example here, in lines 42-118:

https://github.com/seL4/seL4_tools/blob/master/cmake-tool/griddle

Regards,
Branden


signature.asc
Description: PGP signature


Re: Potential enhancements to install-font.sh from https://www.schaffter.ca/mom/bin/install-font.sh

2020-04-29 Thread John Gardner
> You don't even have to learn the details of the escape codes with their
> inscrutable syntax an unmemorizable numerical codes.

I'm sorry, \x1B[4;1mwhat?\x1B[24;21m

On Thu, 30 Apr 2020 at 07:55, G. Branden Robinson <
g.branden.robin...@gmail.com> wrote:

> At 2020-04-29T17:04:31-0400, James K. Lowden wrote:
> > If I were publishing it, I'd remove the VT100 escape codes, and format
> > my if statements without semicolons:
> >
> >   if [ foo ]
> >   then
> >   bar
> >   fi
> >
> > because that's what Steven Bourne intended.  ;-)
>
> I second the Bourne "brace style"; after many years resisting it I
> finally gave in.
>
> There's nothing wrong with SGR escapes as long as uses them portably.
> You don't even have to learn the details of the escape codes with their
> inscrutable syntax an unmemorizable numerical codes.
>
> You can see an example here, in lines 42-118:
>
> https://github.com/seL4/seL4_tools/blob/master/cmake-tool/griddle
>
> Regards,
> Branden
>