tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Baptiste Daroussin <bapt@freebsd.org>
To: tech@mandoc.bsd.lv
Subject: Re: Naive patch for handling empty input
Date: Fri, 13 Oct 2023 12:22:09 +0200	[thread overview]
Message-ID: <m3dpbb2r53tgnzz2mtvck2kgqwer35kxnp4ehycvcgwyh5jjbt@u66ktrucl3db> (raw)
In-Reply-To: <ZSkYXX2PdK0JnCKw@asta-kit.de>

On Fri, Oct 13, 2023 at 12:13:49PM +0200, Ingo Schwarze wrote:
> 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 </dev/null
> > 
> > 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?
> 

I was looking for compatibility with groff like you showed above, this
is an "issue" a user reported, he was expecting to have an empty output
if provided an empty input, but if the current behaviour is how you think
mandoc should behave, I am fine with closing the report with work as intended.

Best regards,
Bapt
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


  reply	other threads:[~2023-10-13 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  7:30 Baptiste Daroussin
2023-10-13 10:13 ` Ingo Schwarze
2023-10-13 10:22   ` Baptiste Daroussin [this message]
2023-10-13 11:05     ` Ingo Schwarze
2023-10-13 11:22       ` Baptiste Daroussin
2023-10-13 11:52         ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3dpbb2r53tgnzz2mtvck2kgqwer35kxnp4ehycvcgwyh5jjbt@u66ktrucl3db \
    --to=bapt@freebsd.org \
    --cc=tech@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).