summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-15 21:09:54 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-15 21:09:54 +0000
commit891288ca199a2ca5b7e63cce216e3b787acee9a1 (patch)
tree9fbabc36bcf5fcbe7d36a2beb2d3ce125dacca2b /usr.bin/mandoc/man_term.c
parenta86b8c718ed5aa62b68637b33de2c8db5d4a1f45 (diff)
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
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c16
1 files changed, 13 insertions, 3 deletions
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 <kristaps@kth.se>
*
@@ -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: