summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/prefixed.opm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/optex/prefixed.opm')
-rw-r--r--macros/luatex/optex/prefixed.opm27
1 files changed, 25 insertions, 2 deletions
diff --git a/macros/luatex/optex/prefixed.opm b/macros/luatex/optex/prefixed.opm
index c545c29f1a..06c46ee65d 100644
--- a/macros/luatex/optex/prefixed.opm
+++ b/macros/luatex/optex/prefixed.opm
@@ -2,10 +2,12 @@
\_codedecl \public {Prefixing and code syntax <2020-02-14>}
-% all TeX82 primitives have alternative control sequence \_hbox \_string, ...
-\let\_directlua = \directlua
+ \_doc ---------
+ All TeX82 primitives have alternative control sequence \_hbox \_string, ...
+ \_cod ---------
+\let\_directlua = \directlua
\_directlua {
% enable all TeX primitives with _ prefix
tex.enableprimitives('_', tex.extraprimitives('tex'))
@@ -15,6 +17,19 @@
tex.enableprimitives('_', tex.extraprimitives())
}
+ \_doc ------------------
+ `\public <sequence> <sequence> ... ;` does
+ `\let \<sequence> = \_<sequence>` for all sequences.
+
+ `\private <sequence> <sequence> ...;` does
+ `\let \_<sequence> = \<sequence>` for all sequences.
+
+ The auxiliary macro `\xargs <what> <sequece> <sequence> ... ;`
+ does `<what><sequence>` for each sequences.
+
+ `\_ea` is useful shotcut for `\expandafter`.
+ \_cod -----------------
+
\_let\_ea =\_expandafter % usefull shortcut
\_long\_def \_xargs #1#2{\_ifx #2;\_else \_ea#1\_ea#2\_ea\_xargs \_ea #1\_fi}
@@ -25,6 +40,13 @@
\_def \_private {\_xargs \_privateA}
\_def \_privateA #1{\_ea\_let \_csname _\_csstring #1\_endcsname =#1}
+ \_doc -----------------------
+ Each `.opm` file should begin with `\_codedecl \macro {<info>}`.
+ If `\macro` is defined already then the `\endpinput` protects to read
+ such file more than one times. Else the <info> is printed to terminal
+ and file is read.
+ \_cod \_fin ------------------
+
\_def \_codedecl #1#2{%
\_ifx #1\_undefined \_wterm{#2}%
\_else \_expandafter \_endinput \_fi
@@ -32,6 +54,7 @@
\_def \_wterm {\_immediate \_write16 }
\_public \public \private \xargs \ea \wterm ;
+\_private \optexversion ;
\_endcode %----------------------------------------------------