summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mandoc/mdoc_macro.c4
-rw-r--r--usr.bin/mandoc/mdoc_term.c17
-rw-r--r--usr.bin/mandoc/mdoc_validate.c6
3 files changed, 18 insertions, 9 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index 5752729efbc..0466f066d0e 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.10 2009/07/12 22:35:08 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.11 2009/07/12 23:19:48 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -83,7 +83,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fn */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ft */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ic */
- { in_line_eoln, 0 }, /* In */ /* FIXME: historic usage! */
+ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */
{ in_line_eoln, 0 }, /* Nd */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 07fbe4e158b..bf848c937f2 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.22 2009/07/07 00:42:04 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.23 2009/07/12 23:19:48 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1833,8 +1833,12 @@ static int
termp_in_pre(DECL_ARGS)
{
+ /* XXX This conforms to new-groff style. */
TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_INCLUDE]);
- term_word(p, "#include");
+
+ if (SEC_SYNOPSIS == node->sec)
+ term_word(p, "#include");
+
term_word(p, "<");
p->flags |= TERMP_NOSPACE;
return(1);
@@ -1849,9 +1853,16 @@ termp_in_post(DECL_ARGS)
p->flags |= TERMP_NOSPACE;
term_word(p, ">");
- term_newln(p);
if (SEC_SYNOPSIS != node->sec)
return;
+
+ term_newln(p);
+ /*
+ * XXX Not entirely correct. If `.In foo bar' is specified in
+ * the SYNOPSIS section, then it produces a single break after
+ * the <foo>; mandoc asserts a vertical space. Since this
+ * construction is rarely used, I think it's fine.
+ */
if (node->next && MDOC_In != node->next->tok)
term_vspace(p);
}
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index f80bb588431..8a410e8fe39 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.21 2009/07/12 22:35:08 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.22 2009/07/12 23:19:48 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -85,7 +85,6 @@ static int eerr_le2(POST_ARGS);
static int eerr_eq1(POST_ARGS);
static int eerr_ge1(POST_ARGS);
static int ewarn_eq0(POST_ARGS);
-static int ewarn_eq1(POST_ARGS);
static int bwarn_ge1(POST_ARGS);
static int hwarn_eq1(POST_ARGS);
static int ewarn_ge1(POST_ARGS);
@@ -129,7 +128,7 @@ static v_post posts_wline[] = { bwarn_ge1, herr_eq0, NULL };
static v_post posts_sh[] = { herr_ge1, bwarn_ge1, post_sh, NULL };
static v_post posts_bl[] = { bwarn_ge1, post_bl, NULL };
static v_post posts_it[] = { post_it, NULL };
-static v_post posts_in[] = { ewarn_eq1, NULL };
+static v_post posts_in[] = { eerr_eq1, NULL };
static v_post posts_ss[] = { herr_ge1, NULL };
static v_post posts_pf[] = { eerr_eq1, NULL };
static v_post posts_lb[] = { eerr_eq1, NULL };
@@ -403,7 +402,6 @@ CHECK_CHILD_DEFN(err, eq, ==) /* err_child_eq() */
CHECK_CHILD_DEFN(err, lt, <) /* err_child_lt() */
CHECK_CHILD_DEFN(warn, lt, <) /* warn_child_lt() */
CHECK_BODY_DEFN(ge1, warn, warn_child_gt, 0) /* bwarn_ge1() */
-CHECK_ELEM_DEFN(eq1, warn, warn_child_eq, 1) /* ewarn_eq1() */
CHECK_ELEM_DEFN(eq0, warn, warn_child_eq, 0) /* ewarn_eq0() */
CHECK_ELEM_DEFN(ge1, warn, warn_child_gt, 0) /* ewarn_gt1() */
CHECK_ELEM_DEFN(eq1, err, err_child_eq, 1) /* eerr_eq1() */