From 21a0f9a1a5bc29abdffea3529d79a09932397e4a Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 20 Jul 2009 15:05:34 +0000 Subject: Undocumented behaviour in groff: `Bl -column' implies `-compact'. mandoc now allows fewer columns than the -width specifies. --- mdoc_term.c | 3 +++ mdoc_validate.c | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mdoc_term.c b/mdoc_term.c index f6b1e583..fb3a3658 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -672,6 +672,9 @@ fmt_block_vspace(struct termp *p, if (arg_hasattr(MDOC_Compact, bl)) return(1); + /* XXX - not documented! */ + else if (arg_hasattr(MDOC_Column, bl)) + return(1); for (n = node; n; n = n->parent) { if (MDOC_BLOCK != n->type) diff --git a/mdoc_validate.c b/mdoc_validate.c index 2c7dba22..2f1fa122 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1028,11 +1028,20 @@ post_it(POST_ARGS) c = mdoc->last->child; for (i = 0; c && MDOC_HEAD == c->type; c = c->next) i++; - if (i == cols) + + if (i < cols) { + if ( ! mdoc_vwarn(mdoc, mdoc->last->line, + mdoc->last->pos, "column " + "mismatch: have %d, want %d", + i, cols)) + return(0); break; - return(mdoc_verr(mdoc, mdoc->last->line, mdoc->last->pos, - "column mismatch (have %d, want %d)", - i, cols)); + } else if (i == cols) + break; + + return(mdoc_verr(mdoc, mdoc->last->line, + mdoc->last->pos, "column mismatch: " + "have %d, want %d", i, cols)); default: break; } -- cgit