From 891288ca199a2ca5b7e63cce216e3b787acee9a1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 15 May 2010 21:09:54 +0000 Subject: More systematic output width handling by Joerg Sonnenberger: * save and restore the output width when switching to MANT_LITERAL * add an argument to ascii_alloc to specify the output width * set the default output width to 80 minus 2 characters * OpenBSD local: set the output width to 65 characters for -man --- usr.bin/mandoc/man_term.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'usr.bin/mandoc/man_term.c') diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 9036b670dba..89d47ae139d 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.31 2010/05/15 18:06:03 schwarze Exp $ */ +/* $Id: man_term.c,v 1.32 2010/05/15 21:09:53 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -161,8 +161,14 @@ terminal_man(void *arg, const struct man *man) p = (struct termp *)arg; + /* + * XXX + * Hardcode the -man output width for now; + * it is not yet externally configurable, anyway. + */ + p->defrmargin = 65; + p->maxrmargin = p->defrmargin; p->overstep = 0; - p->maxrmargin = 65; if (NULL == p->symtab) switch (p->enc) { @@ -802,6 +808,7 @@ post_RS(DECL_ARGS) static void print_man_node(DECL_ARGS) { + size_t rm, rmax; int c; c = 1; @@ -818,10 +825,13 @@ print_man_node(DECL_ARGS) /* FIXME: this means that macro lines are munged! */ if (MANT_LITERAL & mt->fl) { + rm = p->rmargin; + rmax = p->maxrmargin; p->rmargin = p->maxrmargin = TERM_MAXMARGIN; p->flags |= TERMP_NOSPACE; term_flushln(p); - p->rmargin = p->maxrmargin = 65; + p->rmargin = rm; + p->maxrmargin = rmax; } break; default: -- cgit v1.2.3