-# $OpenBSD: Makefile,v 1.22 2017/05/08 15:33:43 schwarze Exp $
+# $OpenBSD: Makefile,v 1.23 2017/06/14 22:50:37 schwarze Exp $
SUBDIR = args cond esc scale string
-SUBDIR += br cc de ds ft ig it ll na nr ps rm sp ta ti tr
+SUBDIR += br cc de ds ft ig it ll na nr po ps rm sp ta ti tr
.include "../Makefile.sub"
.include <bsd.subdir.mk>
--- /dev/null
+# $OpenBSD: Makefile,v 1.1 2017/06/14 22:50:37 schwarze Exp $
+
+REGRESS_TARGETS = basic-mdoc
+
+.include <bsd.regress.mk>
--- /dev/null
+.Dd June 14, 2017
+.Dt PO-BASIC-MDOC 1
+.Os OpenBSD
+.Sh NAME
+.Nm po-basic-mdoc
+.Nd the roff page offset request
+.Sh DESCRIPTION
+initial text
+.Pp
+.po -2n
+shifted left
+.Pp
+.po +5n
+shifted right
+.Pp
+.po XXX
+shifted left
+.Pp
+.po 0
+final text
--- /dev/null
+PO-BASIC-MDOC(1) General Commands Manual PO-BASIC-MDOC(1)
+
+N\bNA\bAM\bME\bE
+ p\bpo\bo-\b-b\bba\bas\bsi\bic\bc-\b-m\bmd\bdo\boc\bc - the roff page offset request
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text
+
+ shifted left
+
+ shifted right
+
+ shifted left
+
+ final text
+
+OpenBSD June 14, 2017 OpenBSD
-.\" $OpenBSD: roff.7,v 1.71 2017/06/14 19:39:05 schwarze Exp $
+.\" $OpenBSD: roff.7,v 1.72 2017/06/14 22:50:37 schwarze Exp $
.\"
.\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010,2011,2013-2015,2017 Ingo Schwarze <schwarze@openbsd.org>
Print all number registers on standard error output.
Currently ignored.
.It Ic \&po Op Oo Cm + Ns | Ns Cm - Oc Ns Ar offset
-Set horizontal page offset.
-Currently ignored.
+Set a horizontal page offset.
+If no argument is specified, the page offset is reverted to its
+previous value.
+If a sign is specified, the new page offset is calculated relative
+to the current one; otherwise, it is absolute.
+The argument follows the syntax of
+.Sx Scaling Widths
+and the default scaling unit is
+.Cm m .
.It Ic \&ps Op Oo Cm + Ns | Ns Cm - Oc Ns size
Change point size.
Currently ignored.
-/* $OpenBSD: mdoc_man.c,v 1.119 2017/06/14 13:00:13 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.120 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
pre_ft, /* ft */
pre_onearg, /* ll */
pre_onearg, /* mc */
+ pre_onearg, /* po */
pre_onearg, /* rj */
pre_sp, /* sp */
pre_ta, /* ta */
-/* $OpenBSD: roff.c,v 1.183 2017/06/14 19:39:05 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.184 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
const char *__roff_name[MAN_MAX + 1] = {
"br", "ce", "ft", "ll",
- "mc", "rj", "sp", "ta",
- "ti", NULL,
+ "mc", "po", "rj", "sp",
+ "ta", "ti", NULL,
"ab", "ad", "af", "aln",
"als", "am", "am1", "ami",
"ami1", "as", "as1", "asciify",
"open", "opena", "os", "output",
"padj", "papersize", "pc", "pev",
"pi", "PI", "pl", "pm",
- "pn", "pnr", "po", "ps",
+ "pn", "pnr", "ps",
"psbb", "pshape", "pso", "ptr",
"pvs", "rchar", "rd", "recursionlimit",
"return", "rfschar", "rhang",
{ roff_onearg, NULL, NULL, 0 }, /* ft */
{ roff_onearg, NULL, NULL, 0 }, /* ll */
{ roff_onearg, NULL, NULL, 0 }, /* mc */
+ { roff_onearg, NULL, NULL, 0 }, /* po */
{ roff_onearg, NULL, NULL, 0 }, /* rj */
{ roff_onearg, NULL, NULL, 0 }, /* sp */
{ roff_manyarg, NULL, NULL, 0 }, /* ta */
{ roff_line_ignore, NULL, NULL, 0 }, /* pm */
{ roff_line_ignore, NULL, NULL, 0 }, /* pn */
{ roff_line_ignore, NULL, NULL, 0 }, /* pnr */
- { roff_line_ignore, NULL, NULL, 0 }, /* po */
{ roff_line_ignore, NULL, NULL, 0 }, /* ps */
{ roff_unsupp, NULL, NULL, 0 }, /* psbb */
{ roff_unsupp, NULL, NULL, 0 }, /* pshape */
-/* $OpenBSD: roff.h,v 1.35 2017/06/14 13:00:13 schwarze Exp $ */
+/* $OpenBSD: roff.h,v 1.36 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
ROFF_ft,
ROFF_ll,
ROFF_mc,
+ ROFF_po,
ROFF_rj,
ROFF_sp,
ROFF_ta,
ROFF_pm,
ROFF_pn,
ROFF_pnr,
- ROFF_po,
ROFF_ps,
ROFF_psbb,
ROFF_pshape,
-/* $OpenBSD: roff_html.c,v 1.9 2017/06/14 13:00:13 schwarze Exp $ */
+/* $OpenBSD: roff_html.c,v 1.10 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2017 Ingo Schwarze <schwarze@openbsd.org>
NULL, /* ft */
NULL, /* ll */
NULL, /* mc */
+ NULL, /* po */
roff_html_pre_ce, /* rj */
roff_html_pre_sp, /* sp */
NULL, /* ta */
-/* $OpenBSD: roff_term.c,v 1.12 2017/06/14 17:50:43 schwarze Exp $ */
+/* $OpenBSD: roff_term.c,v 1.13 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2010, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
static void roff_term_pre_ft(ROFF_TERM_ARGS);
static void roff_term_pre_ll(ROFF_TERM_ARGS);
static void roff_term_pre_mc(ROFF_TERM_ARGS);
+static void roff_term_pre_po(ROFF_TERM_ARGS);
static void roff_term_pre_sp(ROFF_TERM_ARGS);
static void roff_term_pre_ta(ROFF_TERM_ARGS);
static void roff_term_pre_ti(ROFF_TERM_ARGS);
roff_term_pre_ft, /* ft */
roff_term_pre_ll, /* ll */
roff_term_pre_mc, /* mc */
+ roff_term_pre_po, /* po */
roff_term_pre_ce, /* rj */
roff_term_pre_sp, /* sp */
roff_term_pre_ta, /* ta */
p->flags |= TERMP_ENDMC;
}
+static void
+roff_term_pre_po(ROFF_TERM_ARGS)
+{
+ struct roffsu su;
+ static int po, polast;
+ int ponew;
+
+ if (n->child != NULL &&
+ a2roffsu(n->child->string, &su, SCALE_EM) != NULL) {
+ ponew = term_hen(p, &su);
+ if (*n->child->string == '+' ||
+ *n->child->string == '-')
+ ponew += po;
+ } else
+ ponew = polast;
+ polast = po;
+ po = ponew;
+
+ ponew = po - polast + (int)p->tcol->offset;
+ p->tcol->offset = ponew > 0 ? ponew : 0;
+}
+
static void
roff_term_pre_sp(ROFF_TERM_ARGS)
{
-/* $OpenBSD: roff_validate.c,v 1.8 2017/06/14 13:00:13 schwarze Exp $ */
+/* $OpenBSD: roff_validate.c,v 1.9 2017/06/14 22:50:37 schwarze Exp $ */
/*
* Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
roff_valid_ft, /* ft */
NULL, /* ll */
NULL, /* mc */
+ NULL, /* po */
NULL, /* rj */
NULL, /* sp */
NULL, /* ta */