aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-11-13 13:15:14 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-11-13 13:15:14 +0000
commitab6453fdca1be7946e737b3374ec480a539fc41e (patch)
treeca8912be6d0f13fd94b62678e66ccb0ac2d33ea4 /mdoc_term.c
parent26a93b19ed081622643e47785d2ba7810a015efc (diff)
downloadmandoc-ab6453fdca1be7946e737b3374ec480a539fc41e.tar.gz
mandoc-ab6453fdca1be7946e737b3374ec480a539fc41e.tar.zst
mandoc-ab6453fdca1be7946e737b3374ec480a539fc41e.zip
Make the default left text margin configurable from the command line,
just like the default right margin already is. This may be useful for people with expensive screen real estate. Besides, it helps automated man(7) to mdoc(7) output comparisons to validate -Tman output. ok kristaps@ on an earlier version
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 9b01d651..53335664 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.237 2011/11/03 20:36:59 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.238 2011/11/13 13:15:14 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -34,9 +34,6 @@
#include "mdoc.h"
#include "main.h"
-#define INDENT 5
-#define HALFINDENT 3
-
struct termpair {
struct termpair *ppair;
int count;
@@ -259,6 +256,9 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc)
p = (struct termp *)arg;
+ if (0 == p->defindent)
+ p->defindent = 5;
+
p->overstep = 0;
p->maxrmargin = p->defrmargin;
p->tabwidth = term_len(p, 5);
@@ -562,9 +562,9 @@ a2offs(const struct termp *p, const char *v)
else if (0 == strcmp(v, "left"))
return(0);
else if (0 == strcmp(v, "indent"))
- return(term_len(p, INDENT + 1));
+ return(term_len(p, p->defindent + 1));
else if (0 == strcmp(v, "indent-two"))
- return(term_len(p, (INDENT + 1) * 2));
+ return(term_len(p, (p->defindent + 1) * 2));
else if ( ! a2roffsu(v, &su, SCALE_MAX))
SCALE_HS_INIT(&su, term_strlen(p, v));
@@ -1424,7 +1424,7 @@ termp_sh_pre(DECL_ARGS)
term_fontpush(p, TERMFONT_BOLD);
break;
case (MDOC_BODY):
- p->offset = term_len(p, INDENT);
+ p->offset = term_len(p, p->defindent);
break;
default:
break;
@@ -1492,7 +1492,7 @@ termp_d1_pre(DECL_ARGS)
if (MDOC_BLOCK != n->type)
return(1);
term_newln(p);
- p->offset += term_len(p, (INDENT + 1));
+ p->offset += term_len(p, p->defindent + 1);
return(1);
}
@@ -1797,7 +1797,7 @@ termp_ss_pre(DECL_ARGS)
break;
case (MDOC_HEAD):
term_fontpush(p, TERMFONT_BOLD);
- p->offset = term_len(p, HALFINDENT);
+ p->offset = term_len(p, (p->defindent+1)/2);
break;
default:
break;