From cb9b9ac3de7c47b303398dcf6458aa443caf349c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 28 Jun 2021 19:00:02 +0200 Subject: README.t: Document 'list' utility --- Makefile | 2 +- README.pdf | Bin 62043 -> 63686 bytes README.t | 28 ++++++++++++++++++++++++++++ list/list | 2 +- 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.pdf + README.pdf diff --git a/README.pdf b/README.pdf index 94d4dfa..4b99ea5 100644 Binary files a/README.pdf and b/README.pdf 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; -- cgit v1.2.3