discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Nested displays?
@ 2010-07-19 11:42 Kristaps Dzonsons
  2010-07-19 12:03 ` Jason McIntyre
  0 siblings, 1 reply; 5+ messages in thread
From: Kristaps Dzonsons @ 2010-07-19 11:42 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi,

Can anybody think of a reason why display types (`Bd', `D1', `Dl')
shouldn't be nested?  Enclosed is a patch that downgrades the message to
ERROR (from FATAL) and lets these through.

Ok?

Kristaps

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2414 bytes --]

? callgrind.out.15706
? config.h
? config.log
? foo.1
? foo.1.html
? foo.3
? foo.7
? foo.html
? mandoc
? patch.txt
? relayd.8
? relayd.8.html
? spamd.8
? ssh.1
? ssh.1.html
? regress/output
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.98
diff -u -r1.98 main.c
--- main.c	7 Jul 2010 15:04:54 -0000	1.98
+++ main.c	19 Jul 2010 11:42:15 -0000
@@ -151,6 +151,7 @@
 	"macro requires body argument(s)",
 	"macro requires argument(s)",
 	"no title in document",
+	"displays may not be nested",
 	"missing list type",
 	"missing display type",
 	"missing font type",
@@ -160,7 +161,6 @@
 	"generic fatal error",
 
 	"column syntax is inconsistent",
-	"displays may not be nested",
 	"unsupported display type",
 	"blocks badly nested",
 	"no such block is open",
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.16
diff -u -r1.16 mandoc.h
--- mandoc.h	5 Jul 2010 20:10:22 -0000	1.16
+++ mandoc.h	19 Jul 2010 11:42:15 -0000
@@ -82,6 +82,7 @@
 	MANDOCERR_NOBODY, /* macro requires body argument(s) */
 	MANDOCERR_NOARGV, /* macro requires argument(s) */
 	MANDOCERR_NOTITLE, /* no title in document */
+	MANDOCERR_NESTEDDISP, /* displays may not be nested */
 	MANDOCERR_LISTTYPE, /* missing list type */
 	MANDOCERR_DISPTYPE, /* missing display type */
 	MANDOCERR_FONTTYPE, /* missing font type */
@@ -91,8 +92,6 @@
 	MANDOCERR_FATAL, /* ===== end of fatal errors ===== */
 
 	MANDOCERR_COLUMNS, /* column syntax is inconsistent */
-	/* FIXME: this should be a MANDOCERR_ERROR */
-	MANDOCERR_NESTEDDISP, /* displays may not be nested */
 	MANDOCERR_BADDISP, /* unsupported display type */
 	MANDOCERR_SCOPEFATAL, /* blocks badly nested */
 	MANDOCERR_SYNTNOSCOPE, /* no scope to rewind: syntax violated */
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.111
diff -u -r1.111 mdoc_validate.c
--- mdoc_validate.c	19 Jul 2010 11:11:54 -0000	1.111
+++ mdoc_validate.c	19 Jul 2010 11:42:15 -0000
@@ -528,8 +528,7 @@
 	if (NULL == node)
 		return(1);
 
-	mdoc_nmsg(mdoc, n, MANDOCERR_NESTEDDISP);
-	return(0);
+	return(mdoc_nmsg(mdoc, n, MANDOCERR_NESTEDDISP));
 }
 
 

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

* Re: Nested displays?
  2010-07-19 11:42 Nested displays? Kristaps Dzonsons
@ 2010-07-19 12:03 ` Jason McIntyre
  2010-07-19 13:37   ` Kristaps Dzonsons
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jason McIntyre @ 2010-07-19 12:03 UTC (permalink / raw)
  To: discuss

On Mon, Jul 19, 2010 at 01:42:46PM +0200, Kristaps Dzonsons wrote:
> Hi,
> 
> Can anybody think of a reason why display types (`Bd', `D1', `Dl')
> shouldn't be nested?  Enclosed is a patch that downgrades the message to
> ERROR (from FATAL) and lets these through.
> 

well, it doesn;t make sense to nest displays, does it? i can;t think of
why you would ever want to. don;t tell me we have examples of this in
our pages...

jmc
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

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

* Re: Nested displays?
  2010-07-19 12:03 ` Jason McIntyre
@ 2010-07-19 13:37   ` Kristaps Dzonsons
  2010-07-19 16:48   ` Joerg Sonnenberger
  2010-07-19 17:09   ` Ingo Schwarze
  2 siblings, 0 replies; 5+ messages in thread
From: Kristaps Dzonsons @ 2010-07-19 13:37 UTC (permalink / raw)
  To: discuss

>> Can anybody think of a reason why display types (`Bd', `D1', `Dl')
>> shouldn't be nested?  Enclosed is a patch that downgrades the message to
>> ERROR (from FATAL) and lets these through.
>>
> 
> well, it doesn;t make sense to nest displays, does it? i can;t think of
> why you would ever want to. don;t tell me we have examples of this in
> our pages...

Not in OpenBSD.  I think this FATAL should be lifted to ERROR anyway.
It's completely artificial.

% ./mandoc -Tlint -fign-errors -Wall \
> `cat ../{Open,Free,Net,DragonFly}BSD/manuals.txt` \
> 2>&1|grep "displays may not"|cut -d : -f 1|uniq
/home/kristaps/checkedout/FreeBSD/freebsd/usr.sbin/apmd/apmd.8
/home/kristaps/checkedout/FreeBSD/freebsd/bin/sh/sh.1
/home/kristaps/checkedout/FreeBSD/freebsd/lib/libc/net/nsdispatch.3
/home/kristaps/checkedout/FreeBSD/freebsd/lib/msun/man/ieee.3
/home/kristaps/checkedout/FreeBSD/freebsd/sys/netinet/libalias/libalias.3
/home/kristaps/checkedout/FreeBSD/freebsd/crypto/heimdal/kadmin/kadmin.8
/home/kristaps/checkedout/DragonFlyBSD/src/usr.sbin/apmd/apmd.8
/home/kristaps/checkedout/DragonFlyBSD/src/lib/libc/net/nsdispatch.3
/home/kristaps/checkedout/DragonFlyBSD/src/lib/libalias/libalias.3
/home/kristaps/checkedout/DragonFlyBSD/src/games/fortune/fortune/fortune.6
/home/kristaps/checkedout/DragonFlyBSD/src/usr.bin/rdist/rdist.1

Naughty naughty!
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

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

* Re: Nested displays?
  2010-07-19 12:03 ` Jason McIntyre
  2010-07-19 13:37   ` Kristaps Dzonsons
@ 2010-07-19 16:48   ` Joerg Sonnenberger
  2010-07-19 17:09   ` Ingo Schwarze
  2 siblings, 0 replies; 5+ messages in thread
From: Joerg Sonnenberger @ 2010-07-19 16:48 UTC (permalink / raw)
  To: discuss

On Mon, Jul 19, 2010 at 01:03:26PM +0100, Jason McIntyre wrote:
> On Mon, Jul 19, 2010 at 01:42:46PM +0200, Kristaps Dzonsons wrote:
> > Hi,
> > 
> > Can anybody think of a reason why display types (`Bd', `D1', `Dl')
> > shouldn't be nested?  Enclosed is a patch that downgrades the message to
> > ERROR (from FATAL) and lets these through.
> > 
> 
> well, it doesn;t make sense to nest displays, does it? i can;t think of
> why you would ever want to. don;t tell me we have examples of this in
> our pages...

I remember at least one example of hitting nesting displays ;)

Joerg
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

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

* Re: Nested displays?
  2010-07-19 12:03 ` Jason McIntyre
  2010-07-19 13:37   ` Kristaps Dzonsons
  2010-07-19 16:48   ` Joerg Sonnenberger
@ 2010-07-19 17:09   ` Ingo Schwarze
  2 siblings, 0 replies; 5+ messages in thread
From: Ingo Schwarze @ 2010-07-19 17:09 UTC (permalink / raw)
  To: discuss

Hi Jason, hi Kristaps,

Jason McIntyre wrote on Mon, Jul 19, 2010 at 01:03:26PM +0100:
> On Mon, Jul 19, 2010 at 01:42:46PM +0200, Kristaps Dzonsons wrote:

>> Can anybody think of a reason why display types (`Bd', `D1', `Dl')
>> shouldn't be nested?  Enclosed is a patch that downgrades the message
>> to ERROR (from FATAL) and lets these through.

> well, it doesn;t make sense to nest displays, does it? i can;t think of
> why you would ever want to. don;t tell me we have examples of this in
> our pages...

No longer:

From: Ingo Schwarze <schwarze@cvs.openbsd.org>
Date: Thu, 18 Feb 2010 06:39:21 -0700 (MST)
To: source-changes@cvs.openbsd.org
Subject: CVS: cvs.openbsd.org: src

CVSROOT:        /cvs
Module name:    src
Changes by:     schwarze@cvs.openbsd.org        2010/02/18 06:39:21

Modified files:
        share/man/man7 : mdoc.samples.7
        share/man/man8 : intro.8
        usr.bin/oldrdist: oldrdist.1
        usr.sbin/openssl: openssl.1

Log message:
Our groff does not handle all cases of nested displays properly, so
resolve the contradiction in the manual whether it's allowed or not
in favour of "not allowed" for now, shelving my diff to support
nested displays in mandoc(1) for later consideration.
Found by and unbreaking the build with mandoc(1).
Feedback and OK jmc@
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

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

end of thread, other threads:[~2010-07-19 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 11:42 Nested displays? Kristaps Dzonsons
2010-07-19 12:03 ` Jason McIntyre
2010-07-19 13:37   ` Kristaps Dzonsons
2010-07-19 16:48   ` Joerg Sonnenberger
2010-07-19 17:09   ` Ingo Schwarze

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