From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15522 invoked from network); 13 Oct 2023 10:13:55 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 13 Oct 2023 10:13:55 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id cedc9456 for ; Fri, 13 Oct 2023 10:13:51 +0000 (UTC) Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 1d79e0cc for ; Fri, 13 Oct 2023 10:13:51 +0000 (UTC) Received: from hekate.asta.kit.edu ([2a00:1398:5:f401::77]) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (envelope-from ) id 1qrFB0-00FU6u-0v; Fri, 13 Oct 2023 12:13:50 +0200 Received: from login-1.asta.kit.edu ([2a00:1398:5:f400::72]) by hekate.asta.kit.edu with esmtp (Exim 4.94.2) (envelope-from ) id 1qrFAz-002Mrm-9K; Fri, 13 Oct 2023 12:13:49 +0200 Received: from schwarze by login-1.asta.kit.edu with local (Exim 4.94.2) (envelope-from ) id 1qrFAz-00EioQ-26; Fri, 13 Oct 2023 12:13:49 +0200 Date: Fri, 13 Oct 2023 12:13:49 +0200 From: Ingo Schwarze To: Baptiste Daroussin Cc: tech@mandoc.bsd.lv Subject: Re: Naive patch for handling empty input Message-ID: References: X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Bapt, Baptiste Daroussin wrote on Fri, Oct 13, 2023 at 09:30:18AM +0200: > Please find attached a naive patch to handle dealing with empty Why would you want to do anything like that? While empty input is valid low-level roff(7) input, it is not a valid manual page. While mandoc(1) wants to be compatible with groff in manual pages, it is not a goal to be compatible with respect to each and every low-level roff(7) feature outside of manual pages. > This is probably a two naive approach, but I didn't want to come > with empty hands :D > > the issue is the following: > ./mandoc > before the patch is show 3 lines > after nothing I guess which approach makes sense for empty input depends on the reasons *why* you want to handle empty input in any particular way. So far, i cannot think of any possible reasons. Also, where do you want to stop? Do you want the output of echo foo | mandoc to become compatible with echo foo | groff -ket -ww -mtty-char -Tascii -P -c If yes, your patch is indeed much too naive. If not, what is so special about empty input compared to other low-level roff(7) non-manual-page input? Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv