=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.47 retrieving revision 1.50 diff -u -p -r1.47 -r1.50 --- mandoc/mdoc_term.c 2009/07/19 08:24:16 1.47 +++ mandoc/mdoc_term.c 2009/07/21 12:47:52 1.50 @@ -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.50 2009/07/21 12:47:52 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -27,7 +27,6 @@ #include "mdoc.h" /* FIXME: macro arguments can be escaped. */ -/* FIXME: support more offset/width tokens. */ #define TTYPE_PROG 0 #define TTYPE_CMD_FLAG 1 @@ -672,6 +671,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) @@ -795,6 +797,8 @@ termp_it_pre(DECL_ARGS) if (0 == width) width = 8; break; + case (MDOC_Column): + /* FALLTHROUGH */ case (MDOC_Tag): if (0 == width) width = 10; @@ -913,13 +917,22 @@ termp_it_pre(DECL_ARGS) case (MDOC_Hang): /* FALLTHROUGH */ case (MDOC_Tag): + assert(width); if (MDOC_HEAD == node->type) p->rmargin = p->offset + width; else p->offset += width; break; case (MDOC_Column): + assert(width); p->rmargin = p->offset + width; + /* + * XXX - this behaviour is not documented: the + * right-most column is filled to the right margin. + */ + if (MDOC_HEAD == node->type && + MDOC_BODY == node->next->type) + p->rmargin = p->maxrmargin; break; default: break;