tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Re: mdocml: First, make `Pp' (next to `Sm') be allowed as the first element
       [not found] <201012160025.oBG0PZeE023827@krisdoz.my.domain>
@ 2010-12-21 23:33 ` Ingo Schwarze
  2010-12-22  0:43   ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Schwarze @ 2010-12-21 23:33 UTC (permalink / raw)
  To: tech

Hi Kristaps,

kristaps@mdocml.bsd.lv wrote on Wed, Dec 15, 2010 at 07:25:35PM -0500:

> Log Message:
> -----------
> First, make `Pp' (next to `Sm') be allowed as the first element of a
> `Bl' (before any `It' have been invoked).  Next, have the existence of
> either macro raise a warning, as it's technically not legal according to
> mdoc.7.

Hmm, i agree it is good that Pp does not throw FATAL at this point,
and it is good that Pp throws a WARNING here, but Sm is just fine.
How else would you switch to Sm mode just for the It?
That's a real use case!

Note that it looks like Lp is missing, too.

> Second, delete any `Pp' as the first element of a `Bl' (i.e., before an
> `It') ONLY when -compact has not been specified.  This matches with the
> latest version of groff.  This deletion happens prior to the above
> check, so double-warnings will not be issued.

That one sounds good.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mdocml: First, make `Pp' (next to `Sm') be allowed as the first element
  2010-12-21 23:33 ` mdocml: First, make `Pp' (next to `Sm') be allowed as the first element Ingo Schwarze
@ 2010-12-22  0:43   ` Ingo Schwarze
  2010-12-22 11:44     ` Kristaps Dzonsons
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Schwarze @ 2010-12-22  0:43 UTC (permalink / raw)
  To: tech

Hi Kristaps,

replying to myself...

Ingo Schwarze wrote on Wed, Dec 22, 2010 at 12:33:38AM +0100:
> kristaps@mdocml.bsd.lv wrote on Wed, Dec 15, 2010 at 07:25:35PM -0500:

>> Log Message:
>> -----------
>> First, make `Pp' (next to `Sm') be allowed as the first element of a
>> `Bl' (before any `It' have been invoked).  Next, have the existence of
>> either macro raise a warning, as it's technically not legal according to
>> mdoc.7.

> Hmm, i agree it is good that Pp does not throw FATAL at this point,
> and it is good that Pp throws a WARNING here, but Sm is just fine.
[...]
> Note that it looks like Lp is missing, too.

Here is what i have done in OpenBSD to fix this.
Do you want that committed to bsd.lv as well?

Apart from that, and from .TS, we are now back in full sync.

Yours,
  Ingo


--- /usr/mdocml/mdoc_validate.c	Sat Dec 18 12:03:18 2010
+++ ./mdoc_validate.c	Tue Dec 21 16:57:31 2010
@@ -1570,12 +1574,14 @@ post_bl(POST_ARGS)
 
 	for (n = mdoc->last->child; n; n = n->next) {
 		switch (n->tok) {
-		case (MDOC_It):
-			continue;
-		case (MDOC_Sm):
+		case (MDOC_Lp):
 			/* FALLTHROUGH */
 		case (MDOC_Pp):
 			mdoc_nmsg(mdoc, n, MANDOCERR_CHILD);
+			/* FALLTHROUGH */
+		case (MDOC_It):
+			/* FALLTHROUGH */
+		case (MDOC_Sm):
 			continue;
 		default:
 			break;
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mdocml: First, make `Pp' (next to `Sm') be allowed as the first element
  2010-12-22  0:43   ` Ingo Schwarze
@ 2010-12-22 11:44     ` Kristaps Dzonsons
  0 siblings, 0 replies; 3+ messages in thread
From: Kristaps Dzonsons @ 2010-12-22 11:44 UTC (permalink / raw)
  To: tech

> Here is what i have done in OpenBSD to fix this.
> Do you want that committed to bsd.lv as well?
>
> Apart from that, and from .TS, we are now back in full sync.

I don't suppose I mind this, but for completeness, would like a note in 
mdoc.7 to the effect that `Sm' is allowed as a child of `Bl', as

  "Lists consist of items started by the It macro..."

is erroneous.  In general, I strongly want to avoid this sort of 
sometimes-it's-ok ambiguity that groff so generously bestows.  How about 
a note after the list types saying that this is allowed?

Thanks,

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-22 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201012160025.oBG0PZeE023827@krisdoz.my.domain>
2010-12-21 23:33 ` mdocml: First, make `Pp' (next to `Sm') be allowed as the first element Ingo Schwarze
2010-12-22  0:43   ` Ingo Schwarze
2010-12-22 11:44     ` Kristaps Dzonsons

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).