-# $OpenBSD: Makefile,v 1.8 2014/08/18 16:26:13 schwarze Exp $
+# $OpenBSD: Makefile,v 1.9 2015/01/24 01:59:40 schwarze Exp $
-REGRESS_TARGETS = breaking broken empty literal lonelyRE nested noRE width
-LINT_TARGETS = broken lonelyRE noRE
-
-# groff-1.22.2/mandoc difference:
-# RS PP RE gives a blank line in groff, none in mandoc.
-
-SKIP_GROFF = broken
+REGRESS_TARGETS = breaking broken empty literal lonelyRE
+REGRESS_TARGETS += nested noRE REarg width
+LINT_TARGETS = lonelyRE noRE REarg
.include <bsd.regress.mk>
--- /dev/null
+.TH RS-REARG 1 "January 24, 2015" OpenBSD
+.SH NAME
+RS-REarg \- arguments to the RE macro
+.SH DESCRIPTION
+level 1
+.RS 4n
+level 2
+.RS 2n
+level 3
+.RE 2a
+back to 2
+.RE 1b
+back to 1
+.RS 4n
+level 2
+.RS 2n
+level 3
+.RE 1c
+back to 1
+.RS 4n
+level 2
+.RS 2n
+level 3
+.RE 0d
+back to 1
+.RE 1e
--- /dev/null
+RS-REARG(1) General Commands Manual RS-REARG(1)
+
+
+
+N\bNA\bAM\bME\bE
+ RS-REarg - arguments to the RE macro
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ level 1
+ level 2
+ level 3
+ back to 2
+ back to 1
+ level 2
+ level 3
+ back to 1
+ level 2
+ level 3
+ back to 1
+
+
+
+OpenBSD January 24, 2015 RS-REARG(1)
--- /dev/null
+mandoc: REarg.in:10:6: ERROR: skipping excess arguments: RE ... a
+mandoc: REarg.in:12:6: ERROR: skipping excess arguments: RE ... b
+mandoc: REarg.in:18:6: ERROR: skipping excess arguments: RE ... c
+mandoc: REarg.in:24:6: ERROR: skipping excess arguments: RE ... d
+mandoc: REarg.in:26:6: ERROR: skipping excess arguments: RE ... e
+mandoc: REarg.in:26:2: ERROR: fewer RS blocks open, skipping: RE 1
-.TH RS-BROKEN 1 "August 28, 2014" OpenBSD
+.TH RS-BROKEN 1 "January 24, 2015" OpenBSD
.SH NAME
RS-broken \- indented blocks broken by other blocks
.SH DESCRIPTION
-initial text
+broken by PP:
.RS 2n
indented
.PP
still indented
.RE
-back to normal
+broken by IP:
.RS
-.P
+indented
+.IP tag 6n
+first line
+.br
+second line
+.PP
+still indented
+.RE
+broken by TP:
+.RS
+indented
+.TP 6n
+tag
+first line
+.br
+second line
+.PP
+still indented
+.RE
+broken by HP:
+.RS
+indented
+.HP 2n
+Let's have a longer text here such that we can see the line break.
+.PP
+still indented
.RE
final text
RS-broken - indented blocks broken by other blocks
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- initial text
+ broken by PP:
indented
still indented
- back to normal
+ broken by IP:
+ indented
+
+ tag first line
+ second line
+
+ still indented
+ broken by TP:
+ indented
+
+ tag first line
+ second line
+
+ still indented
+ broken by HP:
+ indented
+
+ Let's have a longer text here such that we can see the line
+ break.
+
+ still indented
final text
-OpenBSD August 28, 2014 RS-BROKEN(1)
+OpenBSD January 24, 2015 RS-BROKEN(1)
+++ /dev/null
-mandoc: broken.in:13:2: WARNING: skipping paragraph macro: P empty
-mandoc: broken.in:12:2: WARNING: argument count wrong: want children (have none)
-.\" $OpenBSD: man.7,v 1.40 2014/12/28 15:22:42 schwarze Exp $
+.\" $OpenBSD: man.7,v 1.41 2015/01/24 01:59:40 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
-.\" Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
.\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 28 2014 $
+.Dd $Mdocdate: January 24 2015 $
.Dt MAN 7
.Os
.Sh NAME
.Ss \&RE
Explicitly close out the scope of a prior
.Sx \&RS .
-The default left margin is restored to the state of the original
+The default left margin is restored to the state before that
.Sx \&RS
invocation.
+.Pp
+The syntax is as follows:
+.Bd -filled -offset indent
+.Pf \. Sx \&RE
+.Op Ar level
+.Ed
+.Pp
+Without an argument, the most recent
+.Sx \&RS
+block is closed out.
+If
+.Ar level
+is 1, all open
+.Sx \&RS
+blocks are closed out.
+Otherwise,
+.Ar level No \(mi 1
+nested
+.Sx \&RS
+blocks remain open.
.Ss \&RI
Text is rendered alternately in roman (the default font) and italics.
Whitespace between arguments is omitted in output.
-/* $OpenBSD: man_macro.c,v 1.54 2014/12/16 17:24:58 schwarze Exp $ */
+/* $OpenBSD: man_macro.c,v 1.55 2015/01/24 01:59:40 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
*
* Permission to use, copy, modify, and distribute this software for any
{
enum mant ntok;
const struct man_node *nn;
+ char *p;
+ int nrew, target;
+ nrew = 1;
switch (tok) {
case MAN_RE:
ntok = MAN_RS;
+ if ( ! man_args(man, line, pos, buf, &p))
+ break;
+ for (nn = man->last->parent; nn; nn = nn->parent)
+ if (nn->tok == ntok && nn->type == MAN_BLOCK)
+ nrew++;
+ target = strtol(p, &p, 10);
+ if (*p != '\0')
+ mandoc_vmsg(MANDOCERR_ARG_EXCESS, man->parse,
+ line, p - buf, "RE ... %s", p);
+ if (target == 0)
+ target = 1;
+ nrew -= target;
+ if (nrew < 1) {
+ mandoc_vmsg(MANDOCERR_RE_NOTOPEN, man->parse,
+ line, ppos, "RE %d", target);
+ return;
+ }
break;
case MAN_UE:
ntok = MAN_UR;
}
for (nn = man->last->parent; nn; nn = nn->parent)
- if (nn->tok == ntok && nn->type == MAN_BLOCK)
+ if (nn->tok == ntok && nn->type == MAN_BLOCK && ! --nrew)
break;
if (nn == NULL) {
-/* $OpenBSD: mandoc.h,v 1.127 2015/01/22 21:36:44 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.128 2015/01/24 01:59:40 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
MANDOCERR_IT_STRAY, /* skipping item outside list: It ... */
MANDOCERR_TA_STRAY, /* skipping column outside column list: Ta */
MANDOCERR_BLK_NOTOPEN, /* skipping end of block that is not open */
+ MANDOCERR_RE_NOTOPEN, /* fewer RS blocks open, skipping: RE arg */
MANDOCERR_BLK_BROKEN, /* inserting missing end of block: macro ... */
MANDOCERR_BLK_NOEND, /* appending missing end of block: macro */
-/* $OpenBSD: read.c,v 1.89 2015/01/22 21:36:44 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.90 2015/01/24 01:59:40 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
"skipping item outside list",
"skipping column outside column list",
"skipping end of block that is not open",
+ "fewer RS blocks open, skipping",
"inserting missing end of block",
"appending missing end of block",