summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-04-04 18:52:12 +0000
committerschwarze <schwarze@openbsd.org>2015-04-04 18:52:12 +0000
commit0178871272e67bd94459bd1a1f7693ede7d5734b (patch)
treef668ff5eab5d0af58d403691ea3037f5875003d7
parentfchmod and lstat are standard, widen their visibility (diff)
downloadwireguard-openbsd-0178871272e67bd94459bd1a1f7693ede7d5734b.tar.xz
wireguard-openbsd-0178871272e67bd94459bd1a1f7693ede7d5734b.zip
Give man(7) section and subsection headers heanging indentation.
Reduces groff-mandoc differences in base by about 2.5% due to various Perl manuals having long section titles. Quirk found in argtable2(3).
-rw-r--r--regress/usr.bin/mandoc/man/SH/Makefile4
-rw-r--r--regress/usr.bin/mandoc/man/SH/longarg.in9
-rw-r--r--regress/usr.bin/mandoc/man/SH/longarg.out_ascii17
-rw-r--r--regress/usr.bin/mandoc/man/SS/Makefile4
-rw-r--r--regress/usr.bin/mandoc/man/SS/longarg.in9
-rw-r--r--regress/usr.bin/mandoc/man/SS/longarg.out_ascii17
-rw-r--r--usr.bin/mandoc/man_term.c14
7 files changed, 69 insertions, 5 deletions
diff --git a/regress/usr.bin/mandoc/man/SH/Makefile b/regress/usr.bin/mandoc/man/SH/Makefile
index f8027cde419..f94a4cae89a 100644
--- a/regress/usr.bin/mandoc/man/SH/Makefile
+++ b/regress/usr.bin/mandoc/man/SH/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.3 2015/03/20 16:09:25 schwarze Exp $
+# $OpenBSD: Makefile,v 1.4 2015/04/04 18:52:12 schwarze Exp $
-REGRESS_TARGETS = broken broken_eline empty_before noarg
+REGRESS_TARGETS = broken broken_eline empty_before longarg noarg
LINT_TARGETS = broken broken_eline empty_before noarg
# groff-1.22.3 defects:
diff --git a/regress/usr.bin/mandoc/man/SH/longarg.in b/regress/usr.bin/mandoc/man/SH/longarg.in
new file mode 100644
index 00000000000..54fa474f4b4
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/SH/longarg.in
@@ -0,0 +1,9 @@
+.TH SH-LONGARG 1 "April 4, 2015" OpenBSD
+.SH NAME
+SH-longarg \- long section header lines
+.SH
+DESCRIPTION
+initial text
+.SH "This section has a really ridiculously long title\
+ which won't even fit on the line."
+custom section text
diff --git a/regress/usr.bin/mandoc/man/SH/longarg.out_ascii b/regress/usr.bin/mandoc/man/SH/longarg.out_ascii
new file mode 100644
index 00000000000..cb45e2a33c1
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/SH/longarg.out_ascii
@@ -0,0 +1,17 @@
+SH-LONGARG(1) General Commands Manual SH-LONGARG(1)
+
+
+
+NNAAMMEE
+ SH-longarg - long section header lines
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text
+
+TThhiiss sseeccttiioonn hhaass aa rreeaallllyy rriiddiiccuulloouussllyy lloonngg ttiittllee wwhhiicchh wwoonn''tt eevveenn ffiitt oonn tthhee
+ lliinnee..
+ custom section text
+
+
+
+OpenBSD April 4, 2015 SH-LONGARG(1)
diff --git a/regress/usr.bin/mandoc/man/SS/Makefile b/regress/usr.bin/mandoc/man/SS/Makefile
index a7c1576d8a0..e76a4ee92a5 100644
--- a/regress/usr.bin/mandoc/man/SS/Makefile
+++ b/regress/usr.bin/mandoc/man/SS/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2015/03/20 16:09:25 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2015/04/04 18:52:12 schwarze Exp $
-REGRESS_TARGETS = broken broken_eline noarg
+REGRESS_TARGETS = broken broken_eline longarg noarg
LINT_TARGETS = broken broken_eline noarg
# groff-1.22.3 defects:
diff --git a/regress/usr.bin/mandoc/man/SS/longarg.in b/regress/usr.bin/mandoc/man/SS/longarg.in
new file mode 100644
index 00000000000..ba218e4da1a
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/SS/longarg.in
@@ -0,0 +1,9 @@
+.TH SS-LONGARG 1 "April 4, 2015" OpenBSD
+.SH NAME
+SS-longarg \- long subsection header lines
+.SH
+DESCRIPTION
+initial text
+.SS
+This subsection has a ridiculously long title which won't even fit on the line.
+subsection text
diff --git a/regress/usr.bin/mandoc/man/SS/longarg.out_ascii b/regress/usr.bin/mandoc/man/SS/longarg.out_ascii
new file mode 100644
index 00000000000..0f4a2cb6e4e
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/SS/longarg.out_ascii
@@ -0,0 +1,17 @@
+SS-LONGARG(1) General Commands Manual SS-LONGARG(1)
+
+
+
+NNAAMMEE
+ SS-longarg - long subsection header lines
+
+DDEESSCCRRIIPPTTIIOONN
+ initial text
+
+ TThhiiss ssuubbsseeccttiioonn hhaass aa rriiddiiccuulloouussllyy lloonngg ttiittllee wwhhiicchh wwoonn''tt eevveenn ffiitt oonn tthhee
+ lliinnee..
+ subsection text
+
+
+
+OpenBSD April 4, 2015 SS-LONGARG(1)
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index d59762f34a7..9023d5d8474 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.128 2015/04/04 17:46:58 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.129 2015/04/04 18:52:12 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -766,9 +766,15 @@ pre_SS(DECL_ARGS)
case ROFFT_HEAD:
term_fontrepl(p, TERMFONT_BOLD);
p->offset = term_len(p, 3);
+ p->rmargin = mt->offset;
+ p->trailspace = mt->offset;
+ p->flags |= TERMP_NOBREAK | TERMP_BRIND;
break;
case ROFFT_BODY:
p->offset = mt->offset;
+ p->rmargin = p->maxrmargin;
+ p->trailspace = 0;
+ p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
break;
default:
break;
@@ -821,9 +827,15 @@ pre_SH(DECL_ARGS)
case ROFFT_HEAD:
term_fontrepl(p, TERMFONT_BOLD);
p->offset = 0;
+ p->rmargin = mt->offset;
+ p->trailspace = mt->offset;
+ p->flags |= TERMP_NOBREAK | TERMP_BRIND;
break;
case ROFFT_BODY:
p->offset = mt->offset;
+ p->rmargin = p->maxrmargin;
+ p->trailspace = 0;
+ p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
break;
default:
break;