.\" Copyright (c) 2011 Stijn van Dongen .TH "zoem" 1 "15 Jun 2011" "zoem 11-166" "USER COMMANDS " .po 2m .de ZI .\" Zoem Indent/Itemize macro I. .br 'in +\\$1 .nr xa 0 .nr xa -\\$1 .nr xb \\$1 .nr xb -\\w'\\$2' \h'|\\n(xau'\\$2\h'\\n(xbu'\\ .. .de ZJ .br .\" Zoem Indent/Itemize macro II. 'in +\\$1 'in +\\$2 .nr xa 0 .nr xa -\\$2 .nr xa -\\w'\\$3' .nr xb \\$2 \h'|\\n(xau'\\$3\h'\\n(xbu'\\ .. .if n .ll -2m .am SH .ie n .in 4m .el .in 8m .. .ZJ 3m 1m "1\&." NAME .in -4m .ZJ 3m 1m "2\&." SYNOPSIS .in -4m .ZJ 3m 1m "3\&." DESCRIPTION .in -4m .ZJ 3m 1m "4\&." OPTIONS .in -4m .ZJ 3m 1m "5\&." SESSION MACROS .in -4m .ZJ 3m 1m "6\&." THE SET MODIFIERS .in -4m .ZJ 3m 1m "7\&." THE INSPECT SUBLANGUAGE .in -4m .ZJ 3m 1m "8\&." THE TR SUBLANGUAGE .in -4m .ZJ 3m 1m "9\&." TILDE EXPANSION .in -4m .ZJ 3m 1m "10\&." ENVIRONMENT .in -4m .ZJ 3m 1m "11\&." DIAGNOSTICS .in -4m .ZJ 3m 1m "12\&." BUGS .in -4m .ZJ 3m 1m "13\&." SEE ALSO .in -4m .ZJ 3m 1m "14\&." EXAMPLES .in -4m .ZJ 3m 1m "15\&." AUTHOR .in -4m .SH NAME zoem \- macro processor for the Zoem macro/programming language\&. .SH SYNOPSIS \fBzoem\fP \fB[-i\fP [\&.azm] (\fIentry file name\fP)\fB]\fP \fB[-I\fP (\fIentry file name\fP)\fB]\fP \fB[-o\fP (\fIoutput file name\fP)\fB]\fP \fB[-d\fP (\fIset device key\fP)\fB]\fP \fBzoem\fP .br (enter interactive mode - happens when none of \fB-i\fP, \fB-I\fP, \fB-o\fP is given) \fBzoem\fP \fB-i\fP [\&.azm] (\fIentry file name\fP) \fB-I\fP (\fIentry file name\fP) \fB[-o\fP (\fIoutput file name\fP)\fB]\fP \fB[-d\fP (\fIset device key\fP)\fB]\fP \fB[-x\fP (\fIenter interactive mode on error\fP)\fB]\fP \fB[-s\fP [=] (\fIset key to val\fP)\fB]\fP \fB[-e\fP (\fIevaluate any, exit\fP)\fB]\fP \fB[-E\fP (\fIevaluate any, proceed\fP)\fB]\fP \fB[-chunk-size\fP (\fIprocess chunks of size num\fP)\fB]\fP \fB[--trace\fP (\fItrace mode, default\fP)\fB]\fP \fB[--trace-all-long\fP (\fIlong trace mode\fP)\fB]\fP \fB[--trace-all-short\fP (\fIshort trace mode\fP)\fB]\fP \fB[--trace-regex\fP (\fItrace regexes\fP)\fB]\fP \fB[-trace\fP k (\fItrace mode, explicit\fP)\fB]\fP \fB[--stats\fP (\fIshow symbol table stats after run\fP)\fB]\fP \fB[--split\fP (\fIassume \ewriteto usage, set \e__split__\fP)\fB]\fP \fB[--stress-write\fP (\fImake \ewrite#3 recover\fP)\fB]\fP \fB[--unsafe\fP (\fIprompt for \esystem#3\fP)\fB]\fP \fB[--unsafe-silent\fP (\fIsimply allow \esystem#3\fP)\fB]\fP \fB[-allow\fP cmd1[:cmdx]+ (\fIallowable commands\fP)\fB]\fP \fB[--system-honor\fP (\fIrequire \esystem#3 to succeed\fP)\fB]\fP \fB[-nuser\fP k (\fIuser dict stack size\fP)\fB]\fP \fB[-nenv\fP k (\fIenvironment dict stack size\fP)\fB]\fP \fB[-nsegment\fP k (\fImaximum simple nesting depth\fP)\fB]\fP \fB[-nstack\fP k (\fImaximum eval nesting depth\fP)\fB]\fP \fB[-buser\fP (\fIinitial user dict capacity\fP)\fB]\fP \fB[-bzoem\fP (\fIinitial zoem dict capacity\fP)\fB]\fP \fB[-tl\fP k (\fItab length\fP)\fB]\fP \fB[-l\fP (\fIlist items\fP)\fB]\fP \fB[-h\fP (\fIshow options\fP)\fB]\fP \fB[--apropos\fP (\fIshow options\fP)\fB]\fP .SH DESCRIPTION Zoem is a macro/programming language\&. It is fully described in the \fIZoem User Manual\fP (zum\&.html), currently available in HTML only\&. This manual page documents the zoem processor, not the zoem language\&. If the input file is specified using the \fB-i\fP option and is a regular file (i\&.e\&. not STDIN - which is specified by using a single hyphen), it must have the extension \fC\&.azm\fP\&. This extension can but need not be specified\&. The zoem key \fB\e__fnbase__\fP will be set to the file base name stripped of the \fC\&.azm\fP extension and any leading path components\&. If the input file is specified using the \fB-I\fP option, no extension is assumed, and \fB\e__fnbase__\fP is set to the file base name, period\&. The file base name is the file name with any leading path components stripped away\&. If neither \fB-i\fP nor \fB-o\fP is specified, zoem enters interactive mode\&. Zoem should fully recover from any error it encounters in the input\&. If you find an exception to this rule, consider filing a bug report\&. In interactive mode, zoem start interpreting once it encounters a line containing a single dot\&. Zoem\&'s input behaviour can be modified by setting the key \fB\e__parmode__\fP\&. See the section \fBSESSION MACROS\fP for the details\&. In interactive mode, zoem does \fInot\fP preprocess the interactive input, implying that it does not accept inline files and it does not recognize comments\&. Both types of sequence will generate syntax errors\&. Finally, readline editing and history retrieval can be used in interactive mode provided that they are available on the system\&. This means that the input lines can be retrieved, edited, and discarded with a wide range of cursor positioning and text manipulation commands\&. From within the entry file and included files it is possible to open and write to arbitrary files using the \fB\ewrite#3\fP primitive\&. Arbitrary files can be read in various modes using the \fB\edofile#2\fP macro (providing four different modes with respect to file existence and output), \fB\efinsert#1\fP, and \fB\ezinsert#1\fP\&. Zoem will write the default output to a single file, the name of which is either specified by the \fB-o\fP option, or constructed as described below\&. Zoem can split the default output among multiple files\&. This is governed from within the input files by issuing \fB\ewriteto#1\fP calls\&. Refer to the \fB--split\fP option and the \fIZoem User Manual\fP\&. If none of \fB-i\fP or \fB-o\fP is given, then zoem will enter interactive mode\&. In this mode, zoem interprets by default chunks of text that are ended by a single dot on a line of its own\&. This can be useful for testing or debugging\&. In interactive mode, zoem should recover from any failure it encounters\&. Interactive mode can also be accessed from within a file by issuing \fC\ezinsert{stdia}\fP, and it can be triggered as the mode to enter should an error occur (by adding the \fB-x\fP option to the command line)\&. If \fB-o\fP is given and \fB-i\fP is not, zoem reads input from STDIN\&. If \fB-i\fP is given and \fB-o\fP is not, zoem will construct an output file name as follows\&. If the \fB-d\fP option was used with argument \fC\fP, zoem will write to the file which results from expanding \fB\e__fnbase__\&.\fP\&. Otherwise, zoem writes to (the expansion of) \fB\e__fnbase__\&.ozm\fP\&. For \fB-i\fP and \fB-o\fP, the argument \fC-\fP is interpreted as respectively \fCstdin\fP and \fCstdout\fP\&. .SH OPTIONS .ZI 2m "\fB-i\fP [\&.azm] (\fIentry file name\fP)" \& .br Specify the entry file name\&. The file must have the \fC\&.azm\fP extension, but it need not be specified\&. .in -2m .ZI 2m "\fB-I\fP [\&.azm] (\fIentry file name\fP)" \& .br Specify the entry file name, without restrictions on the file name\&. .in -2m .ZI 2m "\fB-o\fP (\fIoutput file name\fP)" \& .br Specify the output file name\&. .in -2m .ZI 2m "\fB-d\fP (\fIset key \e__device__\fP)" \& .br Set the key \fB\e__device__\fP to \fC\fP\&. .in -2m .ZI 2m "\fB-x\fP (\fIenter interactive mode on error\fP)" \& .br The afterlife option\&. If zoem encounters an error during regular processing, it will emit error messages as usual, and then enter interactive mode\&. This allows you e\&.g\&. to inspect the values of keys used or defined within the problematic area\&. .in -2m .ZI 2m "\fB-s\fP [=] (\fIset key to val\fP)" \& .br Set the key \fB\ekey\fP to \fBval\fP if present, \fB1\fP otherwise\&. Any type of key can be set, including keys taking arguments and keys surrounded in quotes\&. Beware of the shell\&'s quote and backslash interpolation\&. Currently \fBval\fP is not evaluated, so appending or prepending to a key is not possible\&. .in -2m .ZI 2m "\fB-e\fP (\fIevaluate any, exit\fP)" \& .br This causes zoem to evaluate \fC\fP, write any result text to stdout, and exit\&. .in -2m .ZI 2m "\fB-E\fP (\fIevaluate any, proceed\fP)" \& .br This causes zoem to evaluate \fC\fP, write any result text to stdout, and proceed e\&.g\&. with the entry file or an interactive session\&. .in -2m .ZI 2m "\fB-chunk-size\fP (\fIprocess chunks of size num\fP)" \& .br Zoem reads its input in chunks\&. It fully processes a chunk before moving on with the next one\&. This option defines the (minimum) size of the chunks\&. The size or count of the chunks does not at all affect zoem\&'s output\&. The default minimum chunk size equals one megabyte\&. Zoem will read files in their entirety before further processing if \fB-chunk-size\fP\ \&\fB0\fP is specified\&. Zoem does not chunk input files arbitrarily\&. It will append to a chunk until it is in the outermost scope (not contained within any block) and the chunk will end with a line that was fully read\&. Consequently, if e\&.g\&. a file contains a block (delimited by balanced curlies) spanning the entire file then zoem is forced to read it in its entirety\&. .in -2m .ZI 2m "\fB--trace\fP (\fItrace mode, default\fP)" \& .br Trace in default mode\&. .in -2m .ZI 2m "\fB--trace-all-long\fP (\fIlong trace mode\fP)" \& .br Sets on \fImost\fP trace options in long mode\&. Trace options \fCxxx\fP not set have their own \fB--trace-xxx\fP entry (see below)\&. .in -2m .ZI 2m "\fB--trace-all-short\fP (\fIshort trace mode\fP)" \& .br Sets on \fImost\fP trace options in short mode\&. Trace options \fCxxx\fP not set have their own \fB--trace-xxx\fP entry (see below)\&. .in -2m .ZI 2m "\fB--trace-keys\fP (\fItrace keys\fP)" \& .br Trace keys\&. .in -2m .ZI 2m "\fB--trace-regex\fP (\fItrace regexes\fP)" \& .br Trace regexes (i\&.e\&. the \fB\einspect#4\fP primitive)\&. .in -2m .ZI 2m "\fB-trace\fP k (\fItrace mode, explicit\fP)" \& .br Set trace options by adding their representing bits\&. .in -2m .ZI 2m "\fB--stress-write\fP (\fIstress test using write\fP)" \& .br This makes \fB\ewrite#3\fP recover from errors\&. It is a special purpose option used for creating zoem stress test suites, such as \fCstress\&.azm\fP in the zoem distribution \fC/examples\fP subdirectory\&. .in -2m .ZI 2m "\fB--unsafe\fP (\fIprompt for \esystem#3\fP)" \& 'in -2m .ZI 2m "\fB--unsafe-silent\fP (\fIsimply allow \esystem#3\fP)" \& 'in -2m .ZI 2m "\fB-allow\fP cmd1[:cmdx]+ (\fIallowable commands\fP)" \& 'in -2m 'in +2m \& .br With \fB--unsafe\fP system calls are allowed but the user is prompted for each invocation\&. The command and its arguments (if any) are shown, but the STDIN information (if any) is withheld\&. With \fB--unsafe-silent\fP system calls are allowed and the user is never prompted\&. Use \fB-allow\fP\ \&\fIstr\fP or \fB--allow\fP=\fIstr\fP to specify a list of allowable commands, as a string in which the commands are separated by colons\&. .in -2m .ZI 2m "\fB--system-honor\fP (\fIrequire \esystem#3 to succeed\fP)" \& .br With this option any \fC\esystem#3\fP failure (for whatever reason, including safe behaviour) is regarded as a zoem failure\&. By default, failing system calls are ignored under either safe mode, unsafe mode (--unsafe), or silent unsafe mode (--unsafe-silent)\&. .in -2m .ZI 2m "\fB--split\fP (\fIassume split output\fP)" \& .br This assumes zoem input that allows output to multiple files (e\&.g\&. chapters)\&. It sets the default output stream to \fCstdout\fP (anticipating custom output redirection with \fB\ewriteto#1\fP) and sets the session macro \fB\e__split__\fP to \fC1\fP\&. .in -2m .ZI 2m "\fB--stats\fP (\fIshow symbol table stats after run\fP)" \& .br Show symbol table chacteristics\&. Symbol tables are maintained as hashes\&. .in -2m .ZI 2m "\fB-tl\fP k (\fIset tab length\fP)" \& .br Set the tab length\&. HTML output can be indented according to nesting structure, using tabs which are expanded to simple spaces\&. By default, the tab length is zero, meaning that no indent is shown\&. The maximum value the tab length can be set to is four\&. .in -2m .ZI 2m "\fB-nsegment\fP k (\fIlevel of macro nesting allowed\fP)" \& 'in -2m .ZI 2m "\fB-nstack\fP k (\fIstack count\fP)" \& 'in -2m .ZI 2m "\fB-nuser\fP k (\fIuser dictionary stack size\fP)" \& 'in -2m .ZI 2m "\fB-nenv\fP k (\fIenvironment dictionary stack size\fP)" \& 'in -2m .ZI 2m "\fB-buser\fP k (\fIinitial user dict capacity\fP)" \& 'in -2m .ZI 2m "\fB-bzoem\fP k (\fIinitial zoem dict capacity\fP)" \& 'in -2m 'in +2m \& .br Probably needed only if you have some obscure and extreme use for zoem\&. The segment limit applies to simple nesting of macros\&. The stack limit applies to nesting of macros that evaluate an argument before use\&. Each such evaluation creates a new stack\&. The user limit applies to \fB\epush{user}\fP, the env limit applies to the nesting level of environments (started with \fC\ebegin#2\fP)\&. The user dict capacity pertains to the initial number of buckets allocated for user and environment dictionaries, and the zoem dict capacity pertains to the dictionary containing the zoem primitives\&. .in -2m .ZI 2m "\fB-l\fP (\fIlist items\fP)" \& .br List items identified by \fC\fP\&. It can be any of \fBall\fP, \fBfilter\fP\&. \fBlegend\fP, \fBbuiltin\fP, \fBsession\fP, \fBtrace\fP, or \fBzoem\fP, Multiple identifiers can be joined in a string, e\&.g\&. \fC-l legendzoem\fP prints a legend followed by a listing of zoem primitives\&. .in -2m .ZI 2m "\fB-h\fP (\fIshow options\fP)" \& .br Show short synopsis of options\&. .in -2m .SH SESSION MACROS .ZI 2m "\fB\e__parmode__\fP" \& .br This macro affects zoem\&'s read behaviour in interactive mode\&. It can be set on the command line using the \fB-s\fP option\&. Bits that can be set: .di ZV .in 0 .nf \fC 1 chomp newlines (remove the newline character) 2 skip empty newlines 4 read paragraphs (an empty line triggers input read) 8 newlines can be escaped using a backslash 16 read large paragraphs (a single dot on a line triggers input read) .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR .in -2m .ZI 2m "\fB\e__device__\fP" \& .br The current output device, set by the command line option \fB-d\fP\&. The \fBman\fP and \fBfaq\fP packages support \fBhtml\fP and \fBroff\fP as its values\&. .in -2m .ZI 2m "\fB\e__fnbase__\fP" \& .br The base name of the input file name\&. Leading path components are stripped away\&. If the \fB-i\fP option is used the input file is required to have the \fC\&.azm\fP suffix\&. In that case the suffix is also stripped to obtain the base name\&. .in -2m .ZI 2m "\fB\e__fnentry__\fP" \& .br The name of the entry file\&. .in -2m .ZI 2m "\fB\e__fnin__\fP" \& .br The file currently being processed\&. .in -2m .ZI 2m "\fB\e__fnout__\fP" \& .br The name of the default output file\&. .in -2m .ZI 2m "\fB\e__fnpath__\fP" \& .br The leading component of the input file name, possibly empty\&. .in -2m .ZI 2m "\fB\e__fnup__\fP" \& .br The file that included the current file, if applicable\&. .in -2m .ZI 2m "\fB\e__fnwrite__\fP" \& .br This key is set by \fC\ewrite#3\fP to its first argument\&. It can be used by macros that are expanded during evaluation of the third argument\&. Possible usage is to branch on the name of the \fIwrite\fP output stream\&. For example a file called \fIindex\&.html\fP may be treated differently from other files\&. The key is deleted afterwards\&. Nested invocations of \fC\ewrite#3\fP may corrupt the status of this key\&. .in -2m .ZI 2m "\fB\e__ia__\fP" \& .br The input/output separator used in interactive mode\&. .in -2m .ZI 2m "\fB\e__line__\fP" \& .br The line number in the file currently being processed\&. This number will be correct for any invocation outside the scope of a macro\&. For any invocation within a macro the result will be the line number of the closing curly of the outermost containing macro\&. The following .di ZV .in 0 .nf \fC \e__line__ \e__line__ \e__line__ \egroup{ \e__line__ \egroup{\e__line__} \e__line__} .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR Results in .di ZV .in 0 .nf \fC 1 2 3 7 7 7 .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR .in -2m .ZI 2m "\fB\e__searchpath__\fP" \& .br A vararg containing a list of paths to search when a file is to be included/imported/read/loaded\&. When you start zoem, this key should contain the location of the \fBman\&.zmm\fP and \fBfaq\&.zmm\fP package files\&. It is advisable not to overwrite this key but to append to it instead\&. .in -2m .ZI 2m "\fB\e__zoemstat__\fP" \& .br Set to one of \fCok\fP, \fCtowel\fP (that one is a bit lame), or \fCerror\fP by either the interpreter, an occurrence of \fC\ecatch#2\fP, or \fC\etry#1\fP\&. .in -2m .ZI 2m "\fB\e__zoemput__\fP" \& .br Set by \fC\etry#1\fP to the possibly truncated result of processing its argument\&. .in -2m .ZI 2m "\fB\e__lc__\fP" \& .br Expands to a left curly\&. It is hard to find a need for this \- the zoem stress suite uses it to generate a particular syntax error at a deeper interpretation level\&. .in -2m .ZI 2m "\fB\e__rc__\fP" \& .br Expands to a right curly\&. .in -2m .SH THE SET MODIFIERS The \fC\eset#3\fP primitive allows a \fC{modes}{}\fP directive in its first argument\&. Here \fI\fP can be a combination of single-letter modifiers, each described below\&. .ZI 2m "a" append to the key, do not overwrite, create if not existing\&. .in -2m .ZI 2m "c" conditionally; only set if not already defined\&. .in -2m .ZI 2m "e" existing; update existing key, possibly in lower dictionary\&. .in -2m .ZI 2m "g" global; set in the global (bottom) user dictionary\&. .in -2m .ZI 2m "u" unary; do not interpret vararg in \fC\fP as key-value list (data keys only) .in -2m .ZI 2m "v" vararg; interpret vararg in \fC\fP as key-value list (regular keys only)\&. .in -2m .ZI 2m "w" warn if key exists (like \fC\edef#2\fP and \fC\edefx#2\fP)\&. .in -2m .ZI 2m "x" expand argument (like \fC\esetx#2\fP and \fC\edefx#2\fP)\&. .in -2m .SH THE INSPECT SUBLANGUAGE The \fC\einspect#4\fP primitive takes four arguments\&. The languages accepted by the first two arguments are described below\&. The third argument is a replacement string or a replacement macro accepting back-references (supplied as an anonymous macro)\&. The fourth argument is the data to be processed\&. \fBarg 1\fP .br Is a vararg\&. Currently it accepts a single key \fImods\fP for which the value should be a comma-separated list over the words \fIposix\fP, \fIicase\fP, \fIdotall\fP, \fIiter-lines\fP \fIiter-args\fP, \fImatch-once\fP, \fIdiscard-nmp\fP, \fIdiscard-nil-out\fP, \fIdiscard-miss\fP, \fIcount-matches\fP\&. Alternatively repeated use of \fImods\fP is allowed\&. \fBarg 2\fP .br Is a regular expression\&. Tilde patterns are expanded according to all of the ZOEM, UNIX, and REGEX schemes\&. Refer to \fBTILDE EXPANSION\fP for these\&. The third argument is a constant string or an anonymous key, the fourth argument is data\&. .SH THE TR SUBLANGUAGE The \fC\etr#2\fP primitive takes two arguments\&. The first argument contains key-value pairs\&. The accepted keys are \fIfrom\fP and \fIto\fP which must always occur together, and \fIdelete\fP and \fIsquash\fP\&. The values of these keys must be valid \fItranslation\fP specifications\&. This primitive transforms the data in the second argument by successively applying translation, deletion and squashing in that order\&. Only the transformations that are needed need be specified\&. Translation specifications are subjected to UNIX tilde expansion as described below\&. The syntax accepted by translation specifications is almost fully compliant with the syntax accepted by \fBtr\fP(1), with three exceptions\&. First, repeats are introduced as \fC[*a*20]\fP rather than \fC[a*20]\fP\&. Second, ranges can (for now) only be entered as \fCX-Y\fP, not as \fC[X-Y]\fP\&. \fCX\fP and \fCY\fP \fIcan\fP be entered in either octal or hexadecimal notation (see further below)\&. As an additional feature, the magic repeat operator \fC[*a#]\fP stops on both class and range boundaries\&. Character specifications can be complemented by preceding them with the caret \fC^\fP\&. Specifications may contain ranges of characters such as \fCa-z\fP and \fC0-9\fP\&. Posix character classes are allowed\&. The available classes are .di ZV .in 0 .nf \fC [:alnum:] [:alpha:] [:cntrl:] [:digit:] [:graph:] [:lower:] [:print:] [:punct:] [:space:] [:upper:] [:xdigit:] .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR Characters can be specified using octal notation, e\&.g\&. \fC\e012\fP encodes the newline\&. Use \fC\e173\fP for the opening curly, \fC\e175\fP for the closing curly, \fC\e134\fP for the backslash, and \fC\e036\fP for the caret if it is the first character in a specification\&. \fIDON\&'T\fP use \fC\e\e\fP, \fC\e{\fP, or\ \&\fC\e}\fP in this case! Hexadecimal notation is written as \fC\ex7b\fP (the left curly in this instance)\&. See \fBEXAMPLES\fP for an example of \fCtr#2\fP usage\&. .SH TILDE EXPANSION Some primitives interface with UNIX libraries that require backslash escape sequences to encode certain tokens or characters\&. The backslash is special in zoem too and without further measures it can become very cumbersome to encode the correct escape sequences as it is not always clear which tokens should be escaped or unprotected at what point\&. It is especially difficult to handle the zoem characters with special meaning, \fC{\fP, \fC}\fP and \fC\e\fP\&. The two primitives under consideration are \fB\einspect#4\fP and \fB\etr#2\fP\&. Both treat the tilde as an additional escape character for certain arguments (as documented in the user manual)\&. These arguments are subjected to tilde expansion, where the tilde and the character it proceeds are translated to a new character or character sequence\&. There are three different sets of tilde escapes, ZOEM, UNIX and REGEX escapes\&. \fB\etr#2\fP only accepts UNIX escapes, \fB\einspect#4\fP accepts all\&. Tilde expansion is always the last processing step before strings are passed on to external libraries\&. The ZOEM scheme contains some convenience escapes, such as \fC~E\fP to encode a double backslash\&. \fBZOEM tilde expansion\fP .nf \fC \fB meta sequence replacement \&.-----------------------------\&. | ~~ | ~ | | ~E | \e\e | | ~e | \e | | ~I | \e{ | | ~J | \e} | | ~x | \ex | | ~i | { | | ~j | } | \&`-----------------------------\&'\fP .fi \fR The zoem tr specification language accepts \fC\ex**\fP as hexadecimal notation, e\&.g\&. \fC\ex0a\fP denotes a newline in the ASCII character set\&. \fBUNIX tilde expansion\fP .nf \fC \fB meta sequence replacement \&.-----------------------------\&. | ~a | \ea | | ~b | \eb | | ~f | \ef | | ~n | \en | | ~r | \er | | ~t | \et | | ~v | \ev | | ~0 | \e0 | | ~1 | \e1 | | ~2 | \e2 | | ~3 | \e3 | \&`-----------------------------\&'\fP .fi \fR \fBREGEX tilde expansion\fP .nf \fC \fB meta sequence replacement \&.-----------------------------\&. | ~^ | \e^ | | ~\&. | \e\&. | | ~[ | \e[ | | ~$ | \e$ | | ~( | \e( | | ~) | \e) | | ~| | \e| | | ~* | \e* | | ~+ | \e+ | | ~? | \e? | \&`-----------------------------\&'\fP .fi \fR .SH ENVIRONMENT The environment variable ZOEMSEARCHPATH may contain a colon and/or whitespace separated list of paths\&. It will be used when searching for files included via one of the \fCdofile\fP aliases \fC\einput\fP, \fC\eimport\fP, \fC\eread\fP, and \fC\eload\fP\&. Note that the zoem macro \fC\e__searchpath__\fP contains the location where the zoem macro files were copied at the time of installation of zoem\&. .SH DIAGNOSTICS On error, Zoem prints a file name and a line number to which it was able to trace the error\&. The number reported is the same as the one stored in the session macro \fC\e__line__\fP\&. For an error-trigering macro which is not nested within another macro the line number should be correct\&. For a macro that does occur nested within another macro the line number will be the line number of the closing curly in the outermost containing macro\&. If in despair, use one of the tracing modes, \fB--trace-keys\fP is one of the first to come to mind\&. Another possibility is to supply the \fB-x\fP option\&. .SH BUGS No known bugs\&. \fB\einspect#4\fP has not received thorough stress-testing, and the more esoteric parts of its interface will probably change\&. .SH SEE ALSO \fIAephea\fP is a document authoring framework largely for HTML documents\&. \fIPortable Unix Documentation\fP provides two mini-languages for authoring in the unix environment\&. These languages, pud-man and pud-faq are both written in zoem\&. .SH EXAMPLES This is a relatively new section, aimed at assembling useful or explanatory snippets\&. Create a vararg containing file names matching a pattern (\fCpng\fP in this example)\&. .di ZV .in 0 .nf \fC \esetx{images}{ \einspect{ {mods}{iter-lines,discard-miss} }{(\&.*~\&.png)}{_#1{{\e1}}}{\esystem{ls}} } .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR Use magic boundary stops with \fCtr#2\fP\&. .di ZV .in 0 .nf \fC \etr{ {from}{[:lower:][:upper:][:digit:][:space:][:punct:]} {to}{[*L#][*U#][*D#][*S#][*P#]}}{ !"#$%&\&'()*+,-\&./0123456789:;<=>?@ ABCDEFGHIJKLMNOPQRSTUVWXYZ [\e\e]^_\&` abcdefghijklmnopqrstuvwxyz \e{|\e}~]} .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR .SH AUTHOR Stijn van Dongen\&.