From owner-freebsd-arch@freebsd.org Sun Feb 26 19:06:55 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E14CEE199 for ; Sun, 26 Feb 2017 19:06:55 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66F18E5B for ; Sun, 26 Feb 2017 19:06:55 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1403) id B74BA2597; Sun, 26 Feb 2017 19:06:54 +0000 (UTC) Date: Sun, 26 Feb 2017 20:06:54 +0100 From: "Piotr P. Stefaniak" To: freebsd-arch@freebsd.org Subject: I want to remove troff output support from indent(1) Message-ID: <20170226190654.GA23029@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 19:06:55 -0000 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).