aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-24 19:59:26 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-24 20:03:21 +0200
commit51b0a6c8bfd93e035ca80a46838771972e473600 (patch)
tree7d57ec68127f819129f2878c6aa7d83e6f5af0ab
parentd2335d060ffa1e8e2285bde265d71c1db703486b (diff)
downloadmk-51b0a6c8bfd93e035ca80a46838771972e473600.tar.gz
ux.tmac: Improve he, se macros
-rw-r--r--README.t16
-rw-r--r--toc/README.t6
-rw-r--r--toc/example.t6
-rw-r--r--toc/toc.13
-rw-r--r--ux.tmac8
5 files changed, 13 insertions, 26 deletions
diff --git a/README.t b/README.t
index 5a3535a..36d5b2c 100644
--- a/README.t
+++ b/README.t
@@ -14,7 +14,7 @@
. br
. sp -1
\$*
-. te .the \na \n% \$*
+. te .the \\\T'\na'\$*\t\n%\\T
..
.
.de se
@@ -28,23 +28,13 @@
. nr hdi +1
. if \n[hdi]>1 \{\
. shift 3
-. te .the \na \n% \\h'36p'"\\h'20.4p'\$*
+. te .the \\\T'\na'\\h'36p'"\\h'20.4p'\$*\t\n%\\T
. return
. \}
. \}
-. te .the \na \n% \\h'18p'\$*
+. te .the \\\T'\na'\\h'18p'\$*\t\n%\\T
..
.
-.de the
-. nr _a \$1
-. nr _p \$2
-. shift 2
-. ta \n(.luR
-. tc .
-\T'\n(_a'\$* \n(_p\T
-. tc
-. br
-..
.ec
.
.\" configure header and footer
diff --git a/toc/README.t b/toc/README.t
index 62cebaa..ccb06f3 100644
--- a/toc/README.t
+++ b/toc/README.t
@@ -238,14 +238,12 @@ Table of contents
\\$*
\&. br
\&. ft
-\&. te .the \\n% \\$*
+\&. te .the \\$*\\t\\n%
\&..
\&.de the
-\&. nr _ \\$1
-\&. shift
\&. ta 0 \\n(.luR
\&. tc .
-\\$* \\n_
+\\$*
\&. tc
\&. br
\&..
diff --git a/toc/example.t b/toc/example.t
index 167c105..8b4e536 100644
--- a/toc/example.t
+++ b/toc/example.t
@@ -10,15 +10,13 @@
. ft
. ps
. vs
-. te .T \\n% \\$*
+. te .T \\$* \\n%
..
.
.de T
-. nr _ \\$1
-. shift
. ta 0 \\n(.luR
. tc .
-\\$*\t\\n_
+\\$*
. tc
. br
..
diff --git a/toc/toc.1 b/toc/toc.1
index dbee298..413a206 100644
--- a/toc/toc.1
+++ b/toc/toc.1
@@ -19,6 +19,9 @@ from the end of the document to the beginning.
As arguments, it takes a
.Xr troff 1
command line, which is evaluated as a shell command on each pass.
+If the command line is a pipeline,
+.Xr troff 1
+must be the final command.
.Pp
.Nm
runs
diff --git a/ux.tmac b/ux.tmac
index caace60..2b75f6d 100644
--- a/ux.tmac
+++ b/ux.tmac
@@ -12,23 +12,21 @@
.de he
. h
\$*
-. te .the \n% \$*
+. te .the \$*\t\n%
..
.
.\" se -- toc-enabled subheading
.de se
. s
\$*
-. te .the \n% \\h'18p'\$*
+. te .the \\h'18p'\$*\t\n%
..
.
.\" the -- toc entry
.de the
-. nr _ \$1
-. shift
. ta \n(.luR
. tc .
-\$* \n_
+\$*
. tc
. br
..