version 1.133, 2010/05/29 18:58:52 |
version 1.136, 2010/06/01 14:51:09 |
Line 260 static const struct termact termacts[MDOC_MAX] = { |
|
Line 260 static const struct termact termacts[MDOC_MAX] = { |
|
{ termp_sp_pre, NULL }, /* br */ |
{ termp_sp_pre, NULL }, /* br */ |
{ termp_sp_pre, NULL }, /* sp */ |
{ termp_sp_pre, NULL }, /* sp */ |
{ termp_under_pre, termp____post }, /* %U */ |
{ termp_under_pre, termp____post }, /* %U */ |
|
{ NULL, NULL }, /* Ta */ |
}; |
}; |
|
|
|
|
Line 700 termp_it_pre(DECL_ARGS) |
|
Line 701 termp_it_pre(DECL_ARGS) |
|
|
|
switch (type) { |
switch (type) { |
case (LIST_column): |
case (LIST_column): |
if (MDOC_BODY == n->type) |
if (MDOC_HEAD == n->type) |
break; |
break; |
/* |
/* |
* Imitate groff's column handling: |
* Imitate groff's column handling: |
Line 715 termp_it_pre(DECL_ARGS) |
|
Line 716 termp_it_pre(DECL_ARGS) |
|
/* LINTED */ |
/* LINTED */ |
dcol = ncols < 5 ? 4 : ncols == 5 ? 3 : 1; |
dcol = ncols < 5 ? 4 : ncols == 5 ? 3 : 1; |
|
|
|
/* |
|
* Calculate the offset by applying all prior MDOC_BODY, |
|
* so we stop at the MDOC_HEAD (NULL == nn->prev). |
|
*/ |
|
|
for (i = 0, nn = n->prev; |
for (i = 0, nn = n->prev; |
nn && i < (int)ncols; |
nn->prev && i < (int)ncols; |
nn = nn->prev, i++) |
nn = nn->prev, i++) |
offset += dcol + a2width |
offset += dcol + a2width |
(&bl->args->argv[vals[2]], i); |
(&bl->args->argv[vals[2]], i); |
Line 869 termp_it_pre(DECL_ARGS) |
|
Line 875 termp_it_pre(DECL_ARGS) |
|
p->flags |= TERMP_DANGLE; |
p->flags |= TERMP_DANGLE; |
break; |
break; |
case (LIST_column): |
case (LIST_column): |
if (MDOC_HEAD == n->type) { |
if (MDOC_HEAD == n->type) |
assert(n->next); |
break; |
if (MDOC_BODY == n->next->type) |
|
p->flags &= ~TERMP_NOBREAK; |
if (NULL == n->next) |
else |
p->flags &= ~TERMP_NOBREAK; |
p->flags |= TERMP_NOBREAK; |
else |
if (n->prev) |
p->flags |= TERMP_NOBREAK; |
p->flags |= TERMP_NOLPAD; |
|
} |
assert(n->prev); |
|
if (MDOC_BODY == n->prev->type) |
|
p->flags |= TERMP_NOLPAD; |
|
|
break; |
break; |
case (LIST_diag): |
case (LIST_diag): |
if (MDOC_HEAD == n->type) |
if (MDOC_HEAD == n->type) |
Line 929 termp_it_pre(DECL_ARGS) |
|
Line 938 termp_it_pre(DECL_ARGS) |
|
* XXX - this behaviour is not documented: the |
* XXX - this behaviour is not documented: the |
* right-most column is filled to the right margin. |
* right-most column is filled to the right margin. |
*/ |
*/ |
if (MDOC_HEAD == n->type && |
if (MDOC_HEAD == n->type) |
MDOC_BODY == n->next->type && |
break; |
p->rmargin < p->maxrmargin) |
if (NULL == n->next && p->rmargin < p->maxrmargin) |
p->rmargin = p->maxrmargin; |
p->rmargin = p->maxrmargin; |
break; |
break; |
default: |
default: |
Line 985 termp_it_pre(DECL_ARGS) |
|
Line 994 termp_it_pre(DECL_ARGS) |
|
return(0); |
return(0); |
break; |
break; |
case (LIST_column): |
case (LIST_column): |
if (MDOC_BODY == n->type) |
if (MDOC_HEAD == n->type) |
return(0); |
return(0); |
break; |
break; |
default: |
default: |
Line 1017 termp_it_post(DECL_ARGS) |
|
Line 1026 termp_it_post(DECL_ARGS) |
|
term_newln(p); |
term_newln(p); |
break; |
break; |
case (LIST_column): |
case (LIST_column): |
if (MDOC_HEAD == n->type) |
if (MDOC_BODY == n->type) |
term_flushln(p); |
term_flushln(p); |
break; |
break; |
default: |
default: |
Line 1863 termp_in_post(DECL_ARGS) |
|
Line 1872 termp_in_post(DECL_ARGS) |
|
term_word(p, ">"); |
term_word(p, ">"); |
term_fontpop(p); |
term_fontpop(p); |
|
|
if (SEC_SYNOPSIS != n->sec && ! (MDOC_LINE & n->flags)) |
if (SEC_SYNOPSIS != n->sec || ! (MDOC_LINE & n->flags)) |
return; |
return; |
|
|
term_newln(p); |
term_newln(p); |