summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-20 15:05:34 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-20 15:05:34 +0000
commitc6666257b49db6fafacd3e238ad90baeb79952ad (patch)
treeefb4885f03967439e61d2736dd36d7f63aa05cf5
parent205c0b3a2b64d0bd6f19e970acc354cc0851cd72 (diff)
downloadmandoc-c6666257b49db6fafacd3e238ad90baeb79952ad.tar.gz
mandoc-c6666257b49db6fafacd3e238ad90baeb79952ad.tar.zst
mandoc-c6666257b49db6fafacd3e238ad90baeb79952ad.zip
Undocumented behaviour in groff: `Bl -column' implies `-compact'.
mandoc now allows fewer columns than the -width specifies.
-rw-r--r--mdoc_term.c5
-rw-r--r--mdoc_validate.c19
2 files changed, 18 insertions, 6 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 5c49dd7d..8a600a7c 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.47 2009/07/19 08:24:16 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.48 2009/07/20 15:05:34 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 9c8d679a..15e10637 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.37 2009/07/18 23:31:04 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.38 2009/07/20 15:05:34 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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;
}