From b1938d01834105572311aa9b06d667939309bee7 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 30 Mar 2014 19:47:48 +0000 Subject: 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. --- mdoc_term.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mdoc_term.c') diff --git a/mdoc_term.c b/mdoc_term.c index b27dc4ae..5e1a10e8 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.259 2014/02/16 12:33:39 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.260 2014/03/30 19:47:48 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -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; + } } @@ -613,6 +617,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) -- cgit v1.2.3-56-ge451