aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff_term.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
commit72ffb5f81a5259c8b01aa48d71c3542bc8eed8d7 (patch)
tree31fa6b4a1d8a875e8da528874a5b9907e452f853 /roff_term.c
parent3bbe9ca77bfa0a811b6ac068444fadfbb440cb8e (diff)
downloadmandoc-72ffb5f81a5259c8b01aa48d71c3542bc8eed8d7.tar.gz
mandoc-72ffb5f81a5259c8b01aa48d71c3542bc8eed8d7.tar.zst
mandoc-72ffb5f81a5259c8b01aa48d71c3542bc8eed8d7.zip
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 'roff_term.c')
-rw-r--r--roff_term.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/roff_term.c b/roff_term.c
index ea34208e..9786e0a6 100644
--- a/roff_term.c
+++ b/roff_term.c
@@ -31,12 +31,14 @@ static void roff_term_pre_br(ROFF_TERM_ARGS);
static void roff_term_pre_ft(ROFF_TERM_ARGS);
static void roff_term_pre_ll(ROFF_TERM_ARGS);
static void roff_term_pre_sp(ROFF_TERM_ARGS);
+static void roff_term_pre_ta(ROFF_TERM_ARGS);
static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = {
roff_term_pre_br, /* br */
roff_term_pre_ft, /* ft */
roff_term_pre_ll, /* ft */
- roff_term_pre_sp, /* br */
+ roff_term_pre_sp, /* sp */
+ roff_term_pre_ta, /* ta */
};
@@ -111,3 +113,11 @@ roff_term_pre_sp(ROFF_TERM_ARGS)
roff_term_pre_br(p, n);
}
+
+static void
+roff_term_pre_ta(ROFF_TERM_ARGS)
+{
+ term_tab_set(p, NULL);
+ for (n = n->child; n != NULL; n = n->next)
+ term_tab_set(p, n->string);
+}