diff options
-rw-r--r-- | TODO | 9 | ||||
-rw-r--r-- | mdoc_term.c | 31 |
2 files changed, 24 insertions, 16 deletions
@@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.161 2013/12/15 23:56:42 schwarze Exp $ +* $Id: TODO,v 1.162 2013/12/25 14:40:34 schwarze Exp $ ************************************************************************ ************************************************************************ @@ -286,13 +286,6 @@ None known. That is, when it is alone on a line between two .Pp, we want three blank lines, not two as in mandoc. -- When .Fn arguments exceed one output line, all but the first - should be indented, see e.g. rpc(3); - reported by jmc@ on discuss@ Fri, 29 Oct 2010 13:48:33 +0100 - reported again by Nicolas Joly via wiz@ Sun, 18 Sep 2011 18:24:40 +0200 - Also, we don't want to break the line within the argument of: - .Fa "chtype tl" - - Header lines of excessive length: Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c and document it in mdoc(7) and man(7) COMPATIBILITY diff --git a/mdoc_term.c b/mdoc_term.c index 00a6595e..1a1458b0 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,7 +1,8 @@ -/* $Id: mdoc_term.c,v 1.255 2013/12/25 00:39:31 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.256 2013/12/25 14:40:34 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1601,20 +1602,17 @@ termp_fa_pre(DECL_ARGS) for (nn = n->child; nn; nn = nn->next) { term_fontpush(p, TERMFONT_UNDER); + if (MDOC_SYNPRETTY & n->flags) + p->flags |= TERMP_NBRWORD; term_word(p, nn->string); term_fontpop(p); - if (nn->next) { + if (nn->next || (n->next && n->next->tok == MDOC_Fa)) { p->flags |= TERMP_NOSPACE; term_word(p, ","); } } - if (n->child && n->next && n->next->tok == MDOC_Fa) { - p->flags |= TERMP_NOSPACE; - term_word(p, ","); - } - return(0); } @@ -2036,16 +2034,32 @@ termp_quote_post(DECL_ARGS) static int termp_fo_pre(DECL_ARGS) { + size_t width, rmargin = 0; + int pretty; + + pretty = MDOC_SYNPRETTY & n->flags; if (MDOC_BLOCK == n->type) { synopsis_pre(p, n); return(1); } else if (MDOC_BODY == n->type) { + if (pretty) { + width = term_len(p, 4); + rmargin = p->rmargin; + p->rmargin = p->offset + width; + p->flags |= TERMP_NOBREAK | TERMP_HANG; + } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; + if (pretty) { + term_flushln(p); + p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); + p->offset = p->rmargin; + p->rmargin = rmargin; + } return(1); - } + } if (NULL == n->child) return(0); @@ -2073,6 +2087,7 @@ termp_fo_post(DECL_ARGS) if (MDOC_SYNPRETTY & n->flags) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); + term_flushln(p); } } |