discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Robert Mustacchi <rm@fingolfin.org>
To: discuss@mandoc.bsd.lv
Subject: man_validate.c PP/LP macro confusion
Date: Sat, 29 Feb 2020 10:57:18 -0800	[thread overview]
Message-ID: <faabab23-3397-d1d3-0834-4a408c85737c@fingolfin.org> (raw)

Hi,

While dealing with a number of old manual pages that haven't been
converted to mdoc yet, I noticed that when asking mandoc to lint them
(mandoc -Tline <file>), the error message it generates has confused a
few folks. The following is the warning:

mandoc: abs.3c:10:2: WARNING: skipping paragraph macro: PP after SH

The warning itself is clear; however, the source actually uses a .LP
macro and not a .PP macro. Most of the time folks know to map the two
together, but it would be a little clearer if it listed the actual macro
that was present in the document that was invalid.

I believe this happens because man_validate() in man_validate.c
explicitly converts the .LP macro internally to be treated as a .PP.
When it then triggers this check in post_SH(), it uses the modified name
to print out the warning. The same appears to be true check_par().

While it's possible to modify things such that the warning generates the
right token name, I wasn't sure if such a change would be desired or
accepted given the explicit consolidation and transformation for this
being done in man_validate(). I'd appreciate hearing what others thought.

Thanks,
Robert
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

             reply	other threads:[~2020-02-29 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-29 18:57 Robert Mustacchi [this message]
2020-03-01 23:05 ` 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=faabab23-3397-d1d3-0834-4a408c85737c@fingolfin.org \
    --to=rm@fingolfin.org \
    --cc=discuss@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).