aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--TODO6
-rw-r--r--main.c3
-rw-r--r--mandoc.h3
-rw-r--r--mdoc.76
-rw-r--r--mdoc_html.c5
-rw-r--r--mdoc_term.c5
-rw-r--r--mdoc_validate.c15
7 files changed, 28 insertions, 15 deletions
diff --git a/TODO b/TODO
index f0b8a36d..1e3524a1 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.87 2011/01/31 12:52:43 kristaps Exp $
+* $Id: TODO,v 1.88 2011/02/02 21:40:45 kristaps Exp $
************************************************************************
************************************************************************
@@ -246,10 +246,6 @@
should be indented, see e.g. rpc(3);
reported by jmc@ on discuss@ Fri, 29 Oct 2010 13:48:33 +0100
-- .Ns should only be effective when called by another macro,
- not as a stand-alone macro at the beginning of a line;
- see for example the awk(1) SYNOPSIS.
-
- .Ns should work when called at the end of an input line, see
the following code in vi(1):
.It Xo
diff --git a/main.c b/main.c
index f21ce6f5..5896d5ff 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.141 2011/01/25 12:24:27 schwarze Exp $ */
+/* $Id: main.c,v 1.142 2011/02/02 21:40:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -146,6 +146,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
/* related to macros and nesting */
"skipping obsolete macro",
"skipping paragraph macro",
+ "skipping no-space macro",
"blocks badly nested",
"child violates parent syntax",
"nested displays are not portable",
diff --git a/mandoc.h b/mandoc.h
index f9c77487..acef6815 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.53 2011/01/12 15:50:42 kristaps Exp $ */
+/* $Id: mandoc.h,v 1.54 2011/02/02 21:40:45 kristaps Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -68,6 +68,7 @@ enum mandocerr {
/* related to macros and nesting */
MANDOCERR_MACROOBS, /* skipping obsolete macro */
MANDOCERR_IGNPAR, /* skipping paragraph macro */
+ MANDOCERR_IGNNS, /* skipping no-space macro */
MANDOCERR_SCOPENEST, /* blocks badly nested */
MANDOCERR_CHILD, /* child violates parent syntax */
MANDOCERR_NESTEDDISP, /* nested displays are not portable */
diff --git a/mdoc.7 b/mdoc.7
index 32a30f7b..b92803b8 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -1,4 +1,4 @@
-.\" $Id: mdoc.7,v 1.177 2011/01/25 00:40:14 schwarze Exp $
+.\" $Id: mdoc.7,v 1.178 2011/02/02 21:40:45 kristaps Exp $
.\"
.\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 25 2011 $
+.Dd $Mdocdate: February 2 2011 $
.Dt MDOC 7
.Os
.Sh NAME
@@ -2203,6 +2203,8 @@ Suppress a space.
Following invocation, text is interpreted as free-form text until a
macro is encountered.
.Pp
+This has no effect when invoked at the start of a macro line.
+.Pp
Examples:
.Dl \&.Fl o \&Ns \&Ar output
.Pp
diff --git a/mdoc_html.c b/mdoc_html.c
index 4d42a5b7..c0e9b4ef 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.149 2011/01/29 14:49:44 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.150 2011/02/02 21:40:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -780,7 +780,8 @@ static int
mdoc_ns_pre(MDOC_ARGS)
{
- h->flags |= HTML_NOSPACE;
+ if ( ! (MDOC_LINE & n->flags))
+ h->flags |= HTML_NOSPACE;
return(1);
}
diff --git a/mdoc_term.c b/mdoc_term.c
index 6aa3e8b5..d9ecbbf0 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.214 2011/01/25 16:20:24 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.215 2011/02/02 21:40:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -1151,7 +1151,8 @@ static int
termp_ns_pre(DECL_ARGS)
{
- p->flags |= TERMP_NOSPACE;
+ if ( ! (MDOC_LINE & n->flags))
+ p->flags |= TERMP_NOSPACE;
return(1);
}
diff --git a/mdoc_validate.c b/mdoc_validate.c
index fc00b93a..86cf2309 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.154 2011/01/25 15:46:05 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.155 2011/02/02 21:40:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -104,6 +104,7 @@ static int post_eoln(POST_ARGS);
static int post_it(POST_ARGS);
static int post_lb(POST_ARGS);
static int post_nm(POST_ARGS);
+static int post_ns(POST_ARGS);
static int post_os(POST_ARGS);
static int post_ignpar(POST_ARGS);
static int post_prol(POST_ARGS);
@@ -148,6 +149,7 @@ static v_post posts_lb[] = { post_lb, NULL };
static v_post posts_nd[] = { berr_ge1, NULL };
static v_post posts_nm[] = { post_nm, NULL };
static v_post posts_notext[] = { ewarn_eq0, NULL };
+static v_post posts_ns[] = { post_ns, NULL };
static v_post posts_os[] = { post_os, post_prol, NULL };
static v_post posts_rs[] = { post_rs, NULL };
static v_post posts_sh[] = { post_ignpar, hwarn_ge1, bwarn_ge1, post_sh, NULL };
@@ -249,7 +251,7 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Fx */
{ NULL, NULL }, /* Ms */
{ NULL, posts_notext }, /* No */
- { NULL, posts_notext }, /* Ns */
+ { NULL, posts_ns }, /* Ns */
{ NULL, NULL }, /* Nx */
{ NULL, NULL }, /* Ox */
{ NULL, NULL }, /* Pc */
@@ -1744,6 +1746,15 @@ post_rs(POST_ARGS)
}
static int
+post_ns(POST_ARGS)
+{
+
+ if (MDOC_LINE & mdoc->last->flags)
+ mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_IGNNS);
+ return(1);
+}
+
+static int
post_sh(POST_ARGS)
{