aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-28 19:00:02 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-28 19:00:02 +0200
commitcb9b9ac3de7c47b303398dcf6458aa443caf349c (patch)
tree10681ce26a4de9699b754c655fc896c02bf6fa30
parent6e603db0d71a49b499313eca7bb7d8e7ef9c492e (diff)
downloadmk-cb9b9ac3de7c47b303398dcf6458aa443caf349c.tar.gz
README.t: Document 'list' utility
-rw-r--r--Makefile2
-rw-r--r--README.pdfbin62043 -> 63686 bytes
-rw-r--r--README.t28
-rwxr-xr-xlist/list2
4 files changed, 30 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 36299f0..8d132db 100644
--- a/Makefile
+++ b/Makefile
@@ -18,4 +18,4 @@ HACKING.pdf: HACKING.t u.tmac
README.pdf: README.t u.tmac
TROFFONTS=/usr/pkg/share/fonts/X11/TTF/ \
- <README.t toc/toc list/list -p=.l \| $(PDFROFF) > README.pdf
+ <README.t toc/toc list/list -p.l \| $(PDFROFF) > README.pdf
diff --git a/README.pdf b/README.pdf
index 94d4dfa..4b99ea5 100644
--- a/README.pdf
+++ b/README.pdf
Binary files differ
diff --git a/README.t b/README.t
index f49637a..3c6c2be 100644
--- a/README.t
+++ b/README.t
@@ -834,3 +834,31 @@ See page \n[&refname].
.l)
.p
(I prefer prefixing my references with an ampersand.)
+.
+.se How do I include source code without needing to escape it?
+.p
+The
+.i µ
+distribution includes a troff preprocessor called
+.i list ,
+which filters text delimited by
+.c .l(
+and
+.c .l) ,
+escaping standard troff syntax.
+.p
+To automatically add a
+.c .l
+request before each listing, set the
+.i -p
+(prefix) flag accordingly:
+.l(
+list -p.l
+.l)
+.p
+To transparently pass an input line to troff,
+prefix it with
+.c \\\\! .
+(To disable this behavior, use the
+.i -E
+flag.)
diff --git a/list/list b/list/list
index d9dc558..c2c4afb 100755
--- a/list/list
+++ b/list/list
@@ -3,7 +3,7 @@
# list -- escape code listing for troff
use Getopt::Std;
-BEGIN { getopt('Ep:s:'); }
+BEGIN { getopt('Ep:s:') }
if (/^\.\s*l\(\s*$/ .. /^\.\s*l\)\s*$/) {
not $opt_E and s/^\\!// and next;