diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-07-01 22:35:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-07-01 22:35:54 +0000 |
commit | 0bae01a379ba9702c03dfcf16874c3ec9beaa711 (patch) | |
tree | 591d704bdb2bcdf1b1f8850888e883c4a8387358 /mdoc_macro.c | |
parent | 9aa51d8254f41d6b1f1ef2382a74288fb913f815 (diff) | |
download | mandoc-0bae01a379ba9702c03dfcf16874c3ec9beaa711.tar.gz |
In the mdoc(7) parser, inspect roff registers early such that all parts
of the parser can use the resulting cues. In particular, this allows
to use .nr nS to force SYNOPSIS-style .Nm indentation outside the
SYNOPSIS as needed by ifconfig(8).
To actually make this useable, .Pp must rewind .Nm, or the rest of the
section would end up indented. Implement a quick hack for now,
a generic solution can be designed later.
ok kristaps@ and tested by sobrado@
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r-- | mdoc_macro.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index eba02df7..bce50bd4 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1582,6 +1582,9 @@ in_line_eoln(MACRO_PROT_ARGS) assert( ! (MDOC_PARSED & mdoc_macros[tok].flags)); + if (tok == MDOC_Pp) + rew_sub(MDOC_BLOCK, m, MDOC_Nm, line, ppos); + /* Parse macro arguments. */ for (arg = NULL; ; ) { @@ -1645,7 +1648,7 @@ ctx_synopsis(MACRO_PROT_ARGS) nl = MDOC_NEWLINE & m->flags; /* If we're not in the SYNOPSIS, go straight to in-line. */ - if (SEC_SYNOPSIS != m->lastsec) + if ( ! (MDOC_SYNOPSIS & m->flags)) return(in_line(m, tok, line, ppos, pos, buf)); /* If we're a nested call, same place. */ |