Discussion:
I want to remove troff output support from indent(1)
Piotr P. Stefaniak
2017-02-26 19:06:54 UTC
Permalink
indent, the C source reformatting tool, has a -troff option to produce
roff output.

I have a few issues with it:
1) it doesn't work. When I view the resulting file with nroff(1) piped
to more(1), I see boxed comments broken completely, newlines missing
where they're really needed and the line wrapping that indent does makes
everything so much worse,
2) a source reformatting tool is not the right place to put this feature
into. We all know that each utility should do one thing and do it well.
I've been told that vgrind(1) already does what indent -troff promises
to do, only better,
3) indent(1) currently has multiple bugs around management of input and
output buffers and I know how to fix them easily if code for roff output
could be ignored - otherwise it's not that easy, because the paths for
generating roff output sometimes have different requirements for free
space in the output buffers,
4) if the feature is to stay, it must be improved to produce better
output in order for the feature to be actually useful. I don't see any
possible candidates for doing that, except me - but I want to improve
other things and this feature doesn't get me excited, so for me it would
be just a waste of time and effort. Non-trivial effort, now that I've
thought about it, because of all the output-changing options that result
in if-else spaghetti for normal output.

I tried to track down when the roff output might have been broken. I
started with running FreeBSD 1.0 release on a VM (see:
http://freebsdnow.blogspot.com/2013/10/happy-20th-birthday-freebsd.html)
to use indent(1), nroff(1) and more(1) of that time. The output was as
mangled as what I've seen on current a FreeBSD version.

The option was imported from Sun into BSD (I guess 4.3) by Keith Bostic
on September 15th 1988 in this commit:
https://svnweb.freebsd.org/csrg?view=revision&revision=35500 The change
broke the build process, which was fixed later that day. Even with the
fix, it's not compilable on a current FreeBSD, but I used my polarhome
account on a Ultrix 4.5 to compile and test that version. The output was
mangled just as it was in 1993 and as it is now in 2017. One could try
to see if any of commits following the import improved the roff output,
but I don't want to be that one - I've spent enough time on the
archeology part.

So if there are no objections from any possible users of the feature,
I'm going to remove the roff output support from indent(1).
Bob Bishop
2017-02-26 20:59:04 UTC
Permalink
Hi,
Post by Piotr P. Stefaniak
indent, the C source reformatting tool, has a -troff option to produce
roff output.
1) it doesn't work. When I view the resulting file with nroff(1) piped
to more(1) [etc]
From man indent:

"-troff Causes indent to format the program for processing by
troff(1)"

NB troff. Likely it was always broken with nroff.

--
Bob Bishop
***@gid.co.uk
Warner Losh
2017-02-26 22:08:00 UTC
Permalink
Post by Bob Bishop
Hi,
Post by Piotr P. Stefaniak
indent, the C source reformatting tool, has a -troff option to produce
roff output.
1) it doesn't work. When I view the resulting file with nroff(1) piped
to more(1) [etc]
"-troff Causes indent to format the program for processing by
troff(1)"
NB troff. Likely it was always broken with nroff.
I know that I used indent from this time with troff output to print
things that looked OK. It had to be troff, because nroff didn't work
with the laser printer that we had...

I have no trouble removing it, but I have first hand experience with
it working back in the day.

Warner
Baptiste Daroussin
2017-02-26 23:28:55 UTC
Permalink
Post by Warner Losh
Post by Bob Bishop
Hi,
Post by Piotr P. Stefaniak
indent, the C source reformatting tool, has a -troff option to produce
roff output.
1) it doesn't work. When I view the resulting file with nroff(1) piped
to more(1) [etc]
"-troff Causes indent to format the program for processing by
troff(1)"
NB troff. Likely it was always broken with nroff.
I know that I used indent from this time with troff output to print
things that looked OK. It had to be troff, because nroff didn't work
with the laser printer that we had...
I have no trouble removing it, but I have first hand experience with
it working back in the day.
It seems that what broke is that if output of indent -troff was to be passed in
a troff -mindent command line. meaning that there use to be a indent.tmac
somewhere but neither groff, neither heirloom roff seems to be providing it at
all a indent.tmac or equivalent.

So I doubt it ever worked on FreeBSD. I can see online some documentation
speaking about (on oracle website) and even some crazy french website saying it
worked with groff, but can't find the file in groff history either

Best regards,
Bapt
Piotr P. Stefaniak
2017-02-26 23:49:17 UTC
Permalink
Post by Baptiste Daroussin
Post by Warner Losh
Post by Bob Bishop
Hi,
Post by Piotr P. Stefaniak
indent, the C source reformatting tool, has a -troff option to produce
roff output.
1) it doesn't work. When I view the resulting file with nroff(1) piped
to more(1) [etc]
"-troff Causes indent to format the program for processing by
troff(1)"
NB troff. Likely it was always broken with nroff.
I know that I used indent from this time with troff output to print
things that looked OK. It had to be troff, because nroff didn't work
with the laser printer that we had...
I have no trouble removing it, but I have first hand experience with
it working back in the day.
It seems that what broke is that if output of indent -troff was to be passed in
a troff -mindent command line. meaning that there use to be a indent.tmac
somewhere but neither groff, neither heirloom roff seems to be providing it at
all a indent.tmac or equivalent.
So I doubt it ever worked on FreeBSD. I can see online some documentation
speaking about (on oracle website) and even some crazy french website saying it
worked with groff, but can't find the file in groff history either
The troff output was invented at Sun and the online docs for some
post-SunOS operating system include this:
The usual way to get a troffed listing is with the command
indent -troff program.c | troff -mindent

The indent manpage in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
So I guess the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but wasn't.
Piotr P. Stefaniak
2017-02-27 07:27:27 UTC
Permalink
Post by Piotr P. Stefaniak
The troff output was invented at Sun and the online docs for some
Of course I meant the indent's feature.
Post by Piotr P. Stefaniak
The usual way to get a troffed listing is with the command
indent -troff program.c | troff -mindent
The indent manpage in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
So I guess the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but wasn't.
According to
http://www.mit.edu/afs.new/net/dev/dev/system/sun4m_412/rsp.01/usr/share/man/man1/indent.1
.B /usr/share/lib/tmac/tmac.indent
troff macro package for
.RB ` "indent \-troff" '

But the file is missing from a Solaris 5.10 where I happen to have an
account. From what I can see, tmac.indent was never added to 4.3BSD or
FreeBSD. Internet search results suggest that Sun OS might be the only
OS to have the file.
Baptiste Daroussin
2017-03-01 10:23:22 UTC
Permalink
Post by Piotr P. Stefaniak
Post by Piotr P. Stefaniak
The troff output was invented at Sun and the online docs for some
Of course I meant the indent's feature.
Post by Piotr P. Stefaniak
The usual way to get a troffed listing is with the command
indent -troff program.c | troff -mindent
The indent manpage in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
So I guess the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but wasn't.
According to
http://www.mit.edu/afs.new/net/dev/dev/system/sun4m_412/rsp.01/usr/share/man/man1/indent.1
.B /usr/share/lib/tmac/tmac.indent
troff macro package for .RB ` "indent \-troff" '
But the file is missing from a Solaris 5.10 where I happen to have an
account. From what I can see, tmac.indent was never added to 4.3BSD or
FreeBSD. Internet search results suggest that Sun OS might be the only
OS to have the file.
I vote nuke in that case :)

Bapt
Garance A Drosehn
2017-03-01 21:23:58 UTC
Permalink
Post by Piotr P. Stefaniak
According to
http://www.mit.edu/afs.new/net/dev/dev/system/sun4m_412/rsp.01/usr/share/man/man1/indent.1
.B /usr/share/lib/tmac/tmac.indent
troff macro package for .RB ` "indent \-troff" '
But the file is missing from a Solaris 5.10 where I happen
to have an account. From what I can see, tmac.indent was
never added to 4.3BSD or FreeBSD. Internet search results
suggest that Sun OS might be the only OS to have the file.
I have no preference about whether troff-support should be
removed from indent, but it seems there is a:

https://lost-contact.mit.edu/afs/umich.edu/user/d/a/dafish/dafish/Favorites/alex%20harrington/system/sun4c_412/usr/share/lib/tmac/tmac.indent
--
Garance Alistair Drosehn = ***@rpi.edu
Senior Systems Programmer or ***@FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
Bob Bishop
2017-03-02 10:07:53 UTC
Permalink
Hi,
Post by Garance A Drosehn
[…]
I have no preference about whether troff-support should be
https://lost-contact.mit.edu/afs/umich.edu/user/d/a/dafish/dafish/Favorites/alex%20harrington/system/sun4c_412/usr/share/lib/tmac/tmac.indent
FWIW, `indent -troff thing.c |groff -m indent |lpr -Pps’ seems to work for me with that tmac.indent on a 9.3R system.

FSR I couldn’t persuade troff on the same system to produce PS output.
Post by Garance A Drosehn
--
Rensselaer Polytechnic Institute; Troy, NY; USA
_______________________________________________
--
Bob Bishop
***@gid.co.uk

Loading...