[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: tmac/an-old.tmac: Add CS and CT number registers.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/01: tmac/an-old.tmac: Add CS and CT number registers. |
Date: |
Mon, 9 Sep 2019 07:51:12 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 9503b794e821ef1cf6f705b25dc7abbadb920ad2
Author: G. Branden Robinson <address@hidden>
Date: Mon Sep 9 21:01:23 2019 +1000
tmac/an-old.tmac: Add CS and CT number registers.
The an (man) macro package supports new CS and CT number registers to
impose full capitalization on man page section headings and titles,
respectively. These default off (with no visible effect on pages which
already fully capitalize these strings in man page sources). The
rationale is to encourage man page authors to preserve and/or restore
case distinction information in their titles and section headings, while
giving users (including system administrators, distributors,
integrators, and maintainers of man(1) implementations) a way to impose
full capitalization on these page elements if desired.
* tmac/an-old.tmac (TH/an-init): If number register CT is defined and
nonzero, call .stringup on \*[an-title].
(SH): Store macro argument list to \*[an-section-heading]. If number
register CS is defined and nonzero, call .stringup on it.
* tmac/groff_man.7.man (OPTIONS): Document the CS and CT number
registers.
* tmac/tests/an-old_CS_register_off.sh:
* tmac/tests/an-old_CS_register_on.sh:
* tmac/tests/an-old_CS_register_unspecified.sh:
* tmac/tests/an-old_CT_register_off.sh:
* tmac/tests/an-old_CT_register_on.sh:
* tmac/tests/an-old_CT_register_unspecified.sh: Add tests.
* tmac/tmac.am: Run tests.
---
ChangeLog | 26 ++++++++++++++++++++++++++
NEWS | 11 +++++++++++
tmac/an-old.tmac | 7 ++++++-
tmac/groff_man.7.man | 24 ++++++++++++++++++++++++
tmac/tests/an-old_CS_register_off.sh | 27 +++++++++++++++++++++++++++
tmac/tests/an-old_CS_register_on.sh | 27 +++++++++++++++++++++++++++
tmac/tests/an-old_CS_register_unspecified.sh | 27 +++++++++++++++++++++++++++
tmac/tests/an-old_CT_register_off.sh | 27 +++++++++++++++++++++++++++
tmac/tests/an-old_CT_register_on.sh | 27 +++++++++++++++++++++++++++
tmac/tests/an-old_CT_register_unspecified.sh | 27 +++++++++++++++++++++++++++
tmac/tmac.am | 10 ++++++++++
11 files changed, 239 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 69a47dd..211d633 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
2019-09-09 G. Branden Robinson <address@hidden>
+ The an (man) macro package supports new CS and CT number registers to
+ impose full capitalization on man page section headings and titles,
+ respectively. These default off (with no visible effect on pages which
+ already fully capitalize these strings in man page sources). The
+ rationale is to encourage man page authors to preserve and/or restore
+ case distinction information in their titles and section headings, while
+ giving users (including system administrators, distributors,
+ integrators, and maintainers of man(1) implementations) a way to impose
+ full capitalization on these page elements if desired.
+
+ * tmac/an-old.tmac (TH/an-init): If number register CT is defined and
+ nonzero, call .stringup on \*[an-title].
+ (SH): Store macro argument list to \*[an-section-heading]. If number
+ register CS is defined and nonzero, call .stringup on it.
+ * tmac/groff_man.7.man (OPTIONS): Document the CS and CT number
+ registers.
+ * tmac/tests/an-old_CS_register_off.sh:
+ * tmac/tests/an-old_CS_register_on.sh:
+ * tmac/tests/an-old_CS_register_unspecified.sh:
+ * tmac/tests/an-old_CT_register_off.sh:
+ * tmac/tests/an-old_CT_register_on.sh:
+ * tmac/tests/an-old_CT_register_unspecified.sh: Add tests.
+ * tmac/tmac.am: Run tests.
+
+2019-09-09 G. Branden Robinson <address@hidden>
+
Add regression test to check behavior of case transformation
request on a string containing a Unicode character escape.
Right now, this is not supported, so it is an XFAIL test in the
diff --git a/NEWS b/NEWS
index 2f3abcb..690398a 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,17 @@ o On the Latin-1 output device ("groff -T latin1") the
output glyph \[oq]
sequences like `this' in the input (character remapping with ".char"
requests and similar notwithstanding).
+an (man) Macros
+===============
+o The "an" (man) macro package supports new CS and CT number registers to
+ impose full capitalization on man page section headings and titles,
+ respectively. These default off (with no visible effect on pages which
+ already fully capitalize these strings in man page sources). The
+ rationale is to encourage man page authors to preserve and/or restore case
+ distinction information in their titles and section headings, while giving
+ users (including system administrators, distributors, integrators, and
+ maintainers of man(1) implementations) a way to impose full capitalization
+ on these page elements if desired.
VERSION 1.22.4
==============
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 971d2cd..bca09c8 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -148,6 +148,7 @@
.
. de an-init \" This approach gets multiple man pages right.
. ds an-title "\\$1\"
+. if r CT .if \\\\n[CT] .stringup an-title
. ds an-section "\\$2\"
. ds an-extra1 "\\$3\"
. ie (\\n[.$] > 3) .ds an-extra2 "\\$4\"
@@ -361,7 +362,11 @@
. ps \\n[PS-SH]u
. ft \\*[HF]
. ne (2v + 1u)
-. if \\n[.$] \&\\$*
+. if \\n[.$] \{\
+. ds an-section-heading \\$*\"
+. if r CS .if \\n[CS] .stringup an-section-heading
+\&\\*[an-section-heading]
+. \}
..
.
.de1 SS
diff --git a/tmac/groff_man.7.man b/tmac/groff_man.7.man
index 8f419dd..8055600 100644
--- a/tmac/groff_man.7.man
+++ b/tmac/groff_man.7.man
@@ -2245,6 +2245,30 @@ pages continuously, rather than starting each at\~1.
.
.
.TP
+.B \-rCS=1
+Capitalize section headings.
+.
+Set section headings (the argument(s) to
+.BR .SH )
+in full capitals.
+.
+This transformation is off by default because it discards case
+distinction information.
+.
+.
+.TP
+.B \-rCT=1
+Capitalize titles.
+.
+Set the man page title (the first argument to
+.BR .TH )
+in full capitals in headers and footers.
+.
+This transformation is off by default because it discards case
+distinction information.
+.
+.
+.TP
.B \-rD1
Enable double-sided printing.
.
diff --git a/tmac/tests/an-old_CS_register_off.sh
b/tmac/tests/an-old_CS_register_off.sh
new file mode 100755
index 0000000..d896233
--- /dev/null
+++ b/tmac/tests/an-old_CS_register_off.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -rCS=0 -Tascii -P-cbou -man <<EOF | grep -q Name
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tests/an-old_CS_register_on.sh
b/tmac/tests/an-old_CS_register_on.sh
new file mode 100755
index 0000000..5dfca32
--- /dev/null
+++ b/tmac/tests/an-old_CS_register_on.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -rCS=1 -Tutf8 -man <<EOF | grep -q NAME
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tests/an-old_CS_register_unspecified.sh
b/tmac/tests/an-old_CS_register_unspecified.sh
new file mode 100755
index 0000000..e53924c
--- /dev/null
+++ b/tmac/tests/an-old_CS_register_unspecified.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -Tascii -P-cbou -man <<EOF | grep -q Name
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tests/an-old_CT_register_off.sh
b/tmac/tests/an-old_CT_register_off.sh
new file mode 100755
index 0000000..38ee37f
--- /dev/null
+++ b/tmac/tests/an-old_CT_register_off.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -rCT=0 -Tascii -P-cbou -man <<EOF | grep -q 'sample(1)'
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tests/an-old_CT_register_on.sh
b/tmac/tests/an-old_CT_register_on.sh
new file mode 100755
index 0000000..e6ca1ce
--- /dev/null
+++ b/tmac/tests/an-old_CT_register_on.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -rCT=1 -Tascii -P-cbou -man <<EOF | grep -q 'SAMPLE(1)'
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tests/an-old_CT_register_unspecified.sh
b/tmac/tests/an-old_CT_register_unspecified.sh
new file mode 100755
index 0000000..cf1ce12
--- /dev/null
+++ b/tmac/tests/an-old_CT_register_unspecified.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2019 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+"$groff" -Tascii -P-cbou -man <<EOF | grep -q 'sample(1)'
+.TH sample 1 2019-09-09 "groff test suite"
+.SH Name
+sample \- test subject for groff
+EOF
diff --git a/tmac/tmac.am b/tmac/tmac.am
index bee6229..c2c9179 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -136,6 +136,16 @@ EXTRA_DIST += \
tmac/TODO \
tmac/www.tmac.in
+tmac_TESTS = \
+ tmac/tests/an-old_CS_register_off.sh \
+ tmac/tests/an-old_CS_register_on.sh \
+ tmac/tests/an-old_CS_register_unspecified.sh \
+ tmac/tests/an-old_CT_register_off.sh \
+ tmac/tests/an-old_CT_register_on.sh \
+ tmac/tests/an-old_CT_register_unspecified.sh
+
+TESTS += $(tmac_TESTS)
+
dist-hook: tmac-dist-hook
tmac-dist-hook:
chmod u+w $(distdir)/tmac
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: tmac/an-old.tmac: Add CS and CT number registers.,
G. Branden Robinson <=