From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5CBfrFQ008859 for ; Sat, 12 Jun 2010 07:41:53 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o5CBfr29010625; Sat, 12 Jun 2010 07:41:53 -0400 (EDT) Date: Sat, 12 Jun 2010 07:41:53 -0400 (EDT) Message-Id: <201006121141.o5CBfr29010625@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Removed stipulation that an empty `Bd -offset' will default to X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Removed stipulation that an empty `Bd -offset' will default to 6n. Not sure where this came about. Added regression tests to convince myself that this is so. Also consolidated COMPATIBILITY notes regarding `Bd'. Added COMPATIBILITY note to the effect that old groff pukes on `Bd -compact -ragged' (regression test will fail on old groff). Modified Files: -------------- mdocml: main.c mandoc.h mdoc.7 mdoc_validate.c mdocml/regress/mdoc/Cd: cd.in Added Files: ----------- mdocml/regress/mdoc/Bd: bd-compact.in bd-empty-offset.in Revision Data ------------- Index: mdoc_validate.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v retrieving revision 1.94 retrieving revision 1.95 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.94 -r1.95 --- mdoc_validate.c +++ mdoc_validate.c @@ -731,23 +731,8 @@ pre_bd(PRE_ARGS) dup = (NULL != n->data.Bd.offs); break; } - /* - * If empty, assign it to a sane default, which - * groff stipulates is about 8n. - */ - /* - * FIXME: remove this. - * - * Where the hell did I get the idea that this - * happens? - */ - assert(1 == n->args->refcnt); - n->args->argv[i].sz++; - n->args->argv[i].value = - mandoc_malloc(sizeof(char *)); - n->args->argv[i].value[0] = - mandoc_strdup("8n"); - offs = n->args->argv[i].value[0]; + if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV)) + return(0); break; case (MDOC_Compact): comp = 1; Index: mandoc.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v retrieving revision 1.11 retrieving revision 1.12 diff -Lmandoc.h -Lmandoc.h -u -p -r1.11 -r1.12 --- mandoc.h +++ mandoc.h @@ -36,7 +36,9 @@ enum mandocerr { MANDOCERR_BADESCAPE, /* bad escape sequence */ MANDOCERR_BADQUOTE, /* unterminated quoted string */ MANDOCERR_NOWIDTHARG, /* argument requires the width argument */ + /* FIXME: merge with MANDOCERR_IGNARGV. */ MANDOCERR_WIDTHARG, /* superfluous width argument */ + MANDOCERR_IGNARGV, /* macro ignoring argv */ MANDOCERR_BADDATE, /* bad date argument */ MANDOCERR_BADWIDTH, /* bad width argument */ MANDOCERR_BADMSEC, /* unknown manual section */ Index: mdoc.7 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.7,v retrieving revision 1.125 retrieving revision 1.126 diff -Lmdoc.7 -Lmdoc.7 -u -p -r1.125 -r1.126 --- mdoc.7 +++ mdoc.7 @@ -1094,10 +1094,7 @@ As a scaling unit following the syntax d As the calculated string length of the opaque string. .El .Pp -If unset, it will revert to the value of -.Ar 8n -as described in -.Sx Scaling Widths . +If not provided an argument, it will be ignored. .It Fl compact Do not assert a vertical space before the block. .It Fl file Ar file @@ -2169,11 +2166,8 @@ Heirloom troff, the other significant tr .Pp .Bl -dash -compact .It -groff supports a -.Fl file Ar filename -argument to -.Sx \&Bd . -mandoc does not. +Old groff fails to assert a newline before +.Sx \&Bd Fl ragged compact . .It groff behaves inconsistently when encountering .Pf non- Sx \&Fa @@ -2249,16 +2243,15 @@ In quoted literals, groff allowed pair-w standalone double-quote in formatted output. This idiosyncratic behaviour is not applicable in mandoc. .It -Display types +Display offsets .Sx \&Bd -.Fl center +.Fl offset Ar center and -.Fl right -are aliases for -.Fl left -in mandoc. Furthermore, the +.Fl offset Ar right +are disregarded in mandoc. +Furthermore, the .Fl file Ar file -argument is ignored. +argument is not supported in mandoc. Lastly, since text is not right-justified in mandoc (or even groff), .Fl ragged and Index: main.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v retrieving revision 1.87 retrieving revision 1.88 diff -Lmain.c -Lmain.c -u -p -r1.87 -r1.88 --- main.c +++ main.c @@ -109,6 +109,7 @@ static const char * const mandocerrs[MAN "unterminated quoted string", "argument requires the width argument", "superfluous width argument", + "ignoring argument", "bad date argument", "bad width argument", "unknown manual section", --- /dev/null +++ regress/mdoc/Bd/bd-empty-offset.in @@ -0,0 +1,31 @@ +.Dd $Mdocdate: June 12 2010 $ +.Dt FOO 1 +.Os +.Sh NAME +.Nm foo +.Nd bar +.Sh DESCRIPTION +1 +.Bd -literal -offset +a b +c d +.Ed +2 +1 +.Bd -filled -offset +a b +c d +.Ed +2 +1 +.Bd -ragged -offset +a b +c d +.Ed +2 +1 +.Bd -unfilled -offset +a b +c d +.Ed +2 --- /dev/null +++ regress/mdoc/Bd/bd-compact.in @@ -0,0 +1,33 @@ +.Dd $Mdocdate: June 12 2010 $ +.Dt FOO 1 +.Os +.Sh NAME +.Nm foo +.Nd bar +.Sh DESCRIPTION +1 +.Bd -literal -compact +a b +c d +.Ed +2 +1 +.Bd -filled -compact +a b +c d +.Ed +2 +3 +.\" NOTE: OLD GROFF WILL PUKE HERE, AS IT BUGGILY FORGETS TO EMIT A +.\" NEWLINE BEFORE THE DISPLAY. +.Bd -ragged -compact +a b +c d +.Ed +2 +1 +.Bd -unfilled -compact +a b +c d +.Ed +2 Index: cd.in =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/regress/mdoc/Cd/cd.in,v retrieving revision 1.1 retrieving revision 1.2 diff -Lregress/mdoc/Cd/cd.in -Lregress/mdoc/Cd/cd.in -u -p -r1.1 -r1.2 --- regress/mdoc/Cd/cd.in +++ regress/mdoc/Cd/cd.in @@ -9,6 +9,8 @@ .Cd "it* at isa? port 0x2e" .Cd "it* at isa? port 0x2e" .Sh DESCRIPTION +.\" OLD GROFF WILL PUKE ON THIS PART, RENDERING IT JUST AS IT WAS +.\" RENDERED IN THE SYNOPSIS. .Cd "it* at isa? port 0x2e" .Cd "it* at isa? port 0x2e" .Cd "it* at isa? port 0x2e" -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv