From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout.scc.kit.edu (scc-mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p8RK0EWg010939 for ; Tue, 27 Sep 2011 16:00:15 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1R8dp6-00082F-JJ; Tue, 27 Sep 2011 22:00:12 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1R8dp6-0001y1-IN; Tue, 27 Sep 2011 22:00:12 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1R8dp6-0003Am-Fu; Tue, 27 Sep 2011 22:00:12 +0200 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1R8dp6-00004F-4c; Tue, 27 Sep 2011 22:00:12 +0200 Date: Tue, 27 Sep 2011 22:00:11 +0200 From: Ingo Schwarze To: discuss@mdocml.bsd.lv Cc: naddy@mips.inka.de, espie@openbsd.org Subject: Re: Let mandoc pipe to less? Message-ID: <20110927200011.GB20423@iris.usta.de> References: <20110921122358.1e15e3f2@greg.bestnet.kharkov.ua> <4E7BD897.5020403@Leviacomm.net> <20110925101243.GC4867@iris.usta.de> <20110925111746.GA14018@lain.home> <20110925180227.GJ4867@iris.usta.de> <20110927182436.GA33163@lorvorc.mips.inka.de> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110927182436.GA33163@lorvorc.mips.inka.de> User-Agent: Mutt/1.5.21 (2010-09-15) Hi, Christian Weisgerber wrote on Tue, Sep 27, 2011 at 08:24:36PM +0200: > Ingo Schwarze: >> espie@ just brought up the idea to automatically pipe mandoc >> output to less(1) if output is a tty. > FWIW, I dislike this. Unix commands don't behave like this. That's true, yes. So, nobody likes my patch, i guess i'm dopping it. By the way, i did find a case where it causes serious screwup. Apply the patch, build and install mandoc, and then do this: cd /usr/src/bin/ make cleandir make obj make depend make You get to press "q" multiple times to exit less. Ooops. So now you need to type make | cat Useful useless use of cat, very ugly no doubt. >> This could also solve naddy@'s old wish to get rid of the notorious >> 2>&1 | less dance after -Tlint. > That's a separate issue. Although the thought of -Tlint output > going to stderr and completely by-passing an automatically spawned > $PAGER highlights how mistaken linting to stderr is in the first > place. Hmm, quite a few people seem to agree on that. Probably we should make mandoc/main.c, mmsg() output - that is, parser warnings and errors - go to stdout in case of -Tlint, but leave other error output (like usage(), [mtw]options() "Bad argument", stat(2) errors, open(2) errors, read(2) errors, malloc(3) errors) on stderr - that's easy because all parser errors go through mmsg() but none of the system errors do, but instead use fprintf(3) or perror(3) directly. Yours, Ingo -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv