summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-18 16:20:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-18 16:20:43 +0000
commit5f2297ce3a82d4d630e330fb4de3d3c6ce5e6829 (patch)
tree914dfe128d50336ef0e44c3d7e8cc40f922bbf5e
parent1c57e34fd38554f0651309503b2141e84b7db486 (diff)
downloadmandoc-5f2297ce3a82d4d630e330fb4de3d3c6ce5e6829.tar.gz
Let a trailing .Ns macro take effect
even on an input line containing a partial implicit macro. Fixes horizontal spacing in vi(1), ddb(4), and ppp(8). OpenBSD rev. 1.74.
-rw-r--r--TODO9
-rw-r--r--mdoc_macro.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/TODO b/TODO
index 771677cd..b8015639 100644
--- a/TODO
+++ b/TODO
@@ -243,15 +243,6 @@
Also, we don't want to break the line within the argument of:
.Fa "chtype tl"
-- .Ns should work when called at the end of an input line, see
- the following code in vi(1):
- .It Xo
- .Op Ar line
- .Cm a Ns Op Cm ppend Ns
- .Op Cm !\&
- .Xc
- The input text is appended after the specified line.
-
- Header lines of excessive length:
Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c
and document it in mdoc(7) and man(7) COMPATIBILITY
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 33cf397f..3e5d46af 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -1359,6 +1359,13 @@ blk_part_imp(MACRO_PROT_ARGS)
if (n && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos))
return(0);
+ /* Move trailing .Ns out of scope. */
+
+ for (n = body->child; n && n->next; n = n->next)
+ /* Do nothing. */ ;
+ if (n && MDOC_Ns == n->tok)
+ mdoc_node_relink(m, n);
+
return(1);
}