Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2017 20:06:54 +0100
From:      "Piotr P. Stefaniak" <pstef@freebsd.org>
To:        freebsd-arch@freebsd.org
Subject:   I want to remove troff output support from indent(1)
Message-ID:  <20170226190654.GA23029@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170226190654.GA23029>