From: Ingo Schwarze <schwarze@usta.de>
To: Baptiste Daroussin <bapt@freebsd.org>
Cc: tech@mandoc.bsd.lv
Subject: Re: Naive patch for handling empty input
Date: Fri, 13 Oct 2023 12:13:49 +0200 [thread overview]
Message-ID: <ZSkYXX2PdK0JnCKw@asta-kit.de> (raw)
In-Reply-To: <ncotcm65ah3e2q64b5cejjk74oc2c26uueqns435r4cdolsusr@aecbtptwad72>
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?
Yours,
Ingo
--
To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv
next prev parent reply other threads:[~2023-10-13 10:13 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 [this message]
2023-10-13 10:22 ` Baptiste Daroussin
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=ZSkYXX2PdK0JnCKw@asta-kit.de \
--to=schwarze@usta.de \
--cc=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).