summaryrefslogtreecommitdiffstats
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-07 17:31:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-07 17:31:45 +0000
commitdf7add94ac0e6037b421b622febfdbe3236dad5c (patch)
treed3549eb68d21b93b68a624099f590ddb686ecfd9 /mdoc_man.c
parent412e48b8cba6db0a6b8eae7f848cfa460e0a315d (diff)
downloadmandoc-df7add94ac0e6037b421b622febfdbe3236dad5c.tar.gz
Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization. Improves the formatting of the SYNOPSIS in many Xenocara GL manuals. Also important for ports, as reported by many, including naddy@.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 567d1788..fb4d17e1 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -112,6 +112,7 @@ static void pre_sp(DECL_ARGS);
static int pre_sect(DECL_ARGS);
static int pre_sy(DECL_ARGS);
static void pre_syn(const struct roff_node *);
+static void pre_ta(DECL_ARGS);
static int pre_vt(DECL_ARGS);
static int pre_xr(DECL_ARGS);
static void print_word(const char *);
@@ -128,6 +129,7 @@ static const void_fp roff_manacts[ROFF_MAX] = {
pre_ft,
pre_ll,
pre_sp,
+ pre_ta,
};
static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
@@ -443,7 +445,6 @@ static void
print_line(const char *s, int newflags)
{
- outflags &= ~MMAN_br;
outflags |= MMAN_nl;
print_word(s);
outflags |= newflags;
@@ -1715,6 +1716,15 @@ pre_sy(DECL_ARGS)
return 1;
}
+static void
+pre_ta(DECL_ARGS)
+{
+ print_line(".ta", 0);
+ for (n = n->child; n != NULL; n = n->next)
+ print_word(n->string);
+ outflags |= MMAN_nl;
+}
+
static int
pre_vt(DECL_ARGS)
{