summaryrefslogtreecommitdiffstats
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
commitb39d10f13dbeceaf64ab4f7e257aa3de6e3a1478 (patch)
tree0829da7bc58e53127b9df046d4d0af4a80fddee3 /mdoc_term.c
parente1e948c76eb5817bac9e6e4dbbc30fe62e010f62 (diff)
downloadmandoc-b39d10f13dbeceaf64ab4f7e257aa3de6e3a1478.tar.gz
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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index f0db5e89..3c9a87a7 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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;