discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: discuss@mdocml.bsd.lv
Subject: Re: WARNING: blocks badly nested: Oc breaks Op
Date: Thu, 16 Sep 2010 23:23:33 +0200	[thread overview]
Message-ID: <20100916212333.GB5462@usta.de> (raw)
In-Reply-To: <20100911074624.GC5369@bramka.kerhand.co.uk>

Hi Jason,

Jason McIntyre wrote on Sat, Sep 11, 2010 at 08:46:00AM +0100:

> hi. pfctl(8) contains this snippet:
> 
> 	.Xo
> 	.Oo Fl t Ar table
> 	.Fl T Ar command
> 	.Op Ar address ... Oc
> 	.Xc
> 
> mandoc is not happy about having a ".Op ... Oc" line and warns:
> 
> 	pfctl.8:56:20: WARNING: blocks badly nested: Oc breaks Op
> 
> but is that fair?

Yes, i implemented that warning on purpose, and i consider it fair.

The scope of the .Op macro is defined to extend to the end of the line.
So, the code cited above
 - first opens .Oo
 - then opens .Op
 - then closes .Oo (breaking .Op)

In XML, it would look like this:  <Oo> <Op> </Oo> </Op>

When the two enclosures are different, it does even matter
with respect to rendering:

  .Oo Fl t Ar table
  .Fl T Ar command
  .Pq Ar address ... Oc

produces

  [-t table -T command (address ...])

in both old and new groff, and also in mandoc.

> of course i can move the Oc to a separate line, but
> why should i?

Because then you get nice nesting:
Then the Op is completely contained in the Oo.

I admit groff doesn't warn about bad nesting,
but then again, groff issues very few warnings at all.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2010-09-16 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-11  7:46 Jason McIntyre
2010-09-16 21:23 ` Ingo Schwarze [this message]
2010-09-16 22:27   ` Jason McIntyre
2010-09-17 10:50     ` Joerg Sonnenberger
2010-09-17 14:08       ` Jason McIntyre

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=20100916212333.GB5462@usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mdocml.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).