diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 19:47:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 19:47:48 +0000 |
commit | b0b643c847c8a9530fc19fc081c52b9b6f5159dd (patch) | |
tree | ee93f2fc78dc0fddd4abbfdcd79f9df0714656ed /mdoc_term.c | |
parent | 1f5b9d128ee296272c97a8e1a191d09c75b10fd1 (diff) | |
download | mandoc-b0b643c847c8a9530fc19fc081c52b9b6f5159dd.tar.gz |
Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 73ef6d72..8da9366b 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -104,6 +104,7 @@ static int termp_ft_pre(DECL_ARGS); static int termp_in_pre(DECL_ARGS); static int termp_it_pre(DECL_ARGS); static int termp_li_pre(DECL_ARGS); +static int termp_ll_pre(DECL_ARGS); static int termp_lk_pre(DECL_ARGS); static int termp_nd_pre(DECL_ARGS); static int termp_nm_pre(DECL_ARGS); @@ -244,6 +245,7 @@ static const struct termact termacts[MDOC_MAX] = { { termp_sp_pre, NULL }, /* sp */ { NULL, termp____post }, /* %U */ { NULL, NULL }, /* Ta */ + { termp_ll_pre, NULL }, /* ll */ }; @@ -384,8 +386,10 @@ print_mdoc_node(DECL_ARGS) if (MDOC_EOS & n->flags) p->flags |= TERMP_SENTENCE; - p->offset = offset; - p->rmargin = rmargin; + if (MDOC_ll != n->tok) { + p->offset = offset; + p->rmargin = rmargin; + } } @@ -615,6 +619,16 @@ print_bvspace(struct termp *p, /* ARGSUSED */ static int +termp_ll_pre(DECL_ARGS) +{ + + (*p->setwidth)(p, n->nchild ? a2width(p, n->child->string) : 0); + return(0); +} + + +/* ARGSUSED */ +static int termp_it_pre(DECL_ARGS) { const struct mdoc_node *bl, *nn; |