diff options
author | 2010-07-01 22:35:54 +0000 | |
---|---|---|
committer | 2010-07-01 22:35:54 +0000 | |
commit | e552a5cef0219ea63fb9521677e1a8a05ad35727 (patch) | |
tree | 4a4e069b6b57e03c5805f88f307dae15e95a65ad /mdoc_macro.c | |
parent | 9c216164abd606b0097a7d91e8e0026c721fa54d (diff) | |
download | mandoc-e552a5cef0219ea63fb9521677e1a8a05ad35727.tar.gz mandoc-e552a5cef0219ea63fb9521677e1a8a05ad35727.tar.zst mandoc-e552a5cef0219ea63fb9521677e1a8a05ad35727.zip |
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 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 0a8d2c5c..7d0ee327 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.89 2010/07/01 21:12:00 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.90 2010/07/01 22:35:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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. */ |