summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/context/third/filter/filter.txt5
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-filter.tex59
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex67
3 files changed, 80 insertions, 51 deletions
diff --git a/Master/texmf-dist/doc/context/third/filter/filter.txt b/Master/texmf-dist/doc/context/third/filter/filter.txt
index 0b62538cd2d..6487c818d89 100644
--- a/Master/texmf-dist/doc/context/third/filter/filter.txt
+++ b/Master/texmf-dist/doc/context/third/filter/filter.txt
@@ -28,6 +28,11 @@ program would be a waste of effort. Each new program requires only a few changes
in the R-module; what I needed was a R-module _template_ so that I could fill in
the blanks with the appropriate values. And so, the filter module was born.
+Compatibility
+------------
+
+This module works with both MkII and MkIV
+
Installation
------------
diff --git a/Master/texmf-dist/tex/context/third/filter/t-filter.tex b/Master/texmf-dist/tex/context/third/filter/t-filter.tex
index b724a527424..6f95644953f 100644
--- a/Master/texmf-dist/tex/context/third/filter/t-filter.tex
+++ b/Master/texmf-dist/tex/context/third/filter/t-filter.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-filter,
-%D version=2011.03.06,
+%D version=2011.06.12,
%D title=\CONTEXT\ User Module,
%D subtitle=Filter,
%D author=Aditya Mahajan,
@@ -11,54 +11,13 @@
\writestatus{loading}{ConTeXt User Module / Filter}
+\ifx\undefined\normalexpanded \let\normalexpanded\expanded \fi
+
\startmodule [filter]
+\usemodule [module-catcodes]
-% EXPERIMENTAL: Catcode table for internal commands
-
-\newcatcodetable \externalfiltermodulecatcodes
-
-\startcatcodetable \externalfiltermodulecatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\superscriptcatcode
-% \catcode\underscoreasciicode\subscriptcatcode
- \catcode\underscoreasciicode\lettercatcode
- \catcode\ampersandasciicode \alignmentcatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- \catcode\dollarasciicode \mathshiftcatcode
- \catcode\hashasciicode \parametercatcode
- \catcode\commentasciicode \commentcatcode
- \catcode`\@ \lettercatcode
- \catcode`\! \lettercatcode
- \catcode`\? \lettercatcode
- \catcode\tildeasciicode \activecatcode
- \catcode\barasciicode \activecatcode
- \catcode`\: \lettercatcode
-\stopcatcodetable
+\unprotectmodulecatcodes
-% IDEA:
-% Instead of using \externalfilter::command we can also define:
-%
-% \startmoduledefinition command #1
-% ...
-% \stopmoduledefinition
-%
-% which will be equivalent to
-%
-% \starttexdefinition externalfilter::command
-% ...
-% \stoptexdefinition
-%
-% and \modulevalue{command} => \getvalue{externalfilter::command}
-
-
-\pushcatcodetable
-\setcatcodetable\externalfiltermodulecatcodes
%D \section {Initialization}
%D
@@ -96,8 +55,6 @@
\def\externalfilter::temp_prefix {temp}
\def\externalfilter::count{\externalfilter::namespace-\externalfilter::name-counter}
-\ifx\undefined\normalexpanded \let\normalexpanded\expanded \fi
-
\installparameterhandler \externalfilter::namespace \externalfilter::id
\installparameterhashhandler \externalfilter::namespace \externalfilter::id
\installsetuphandler \externalfilter::namespace \externalfilter::id
@@ -215,7 +172,7 @@
%D internal names keep on changing which is a maintenance nightmare.
\newcatcodetable \externalfilter::read_catcodes
-\newcatcodetable \externalfilter::write_catcodes
+\newcatcodetable \externalfilter::minimal_catcodes
\newcatcodetable \externalfilter::verb_catcodes
\startcatcodetable \externalfilter::read_catcodes % same as typcatcodesa
@@ -228,7 +185,7 @@
\catcode\rightbraceasciicode = \endgroupcatcode
\stopcatcodetable
-\startcatcodetable \externalfilter::write_catcodes
+\startcatcodetable \externalfilter::minimal_catcodes
\catcode\backslashasciicode = \escapecatcode
\catcode\leftbraceasciicode = \begingroupcatcode
\catcode\rightbraceasciicode = \endgroupcatcode
@@ -452,5 +409,5 @@
\def\externalfilteroutputfile{\externalfilter::output_file}
\def\currentexternalfilter {\externalfilter::name}
-\popcatcodetable
+\protectmodulecatcodes
\stopmodule
diff --git a/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex b/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex
new file mode 100644
index 00000000000..539ca19f4e3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex
@@ -0,0 +1,67 @@
+%D \module
+%D [ file=t-module-catcodes,
+%D version=2011.04.02,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Module Catcodes,
+%D author=Aditya Mahajan,
+%D date=\currentdate,
+%D copyright=Aditya Mahajan,
+%D email=adityam <at> umich <dot> edu,
+%D license=Simplified BSD License]
+
+\writestatus{loading}{ConTeXt User Module / Module Catcodes}
+
+\startmodule [module-catcodes]
+% EXPERIMENTAL: Catcode table for internal commands
+
+\newcatcodetable \modulecatcodes
+
+\startcatcodetable \modulecatcodes
+ \catcode\tabasciicode \spacecatcode
+ \catcode\endoflineasciicode \endoflinecatcode
+ \catcode\formfeedasciicode \endoflinecatcode
+ \catcode\spaceasciicode \spacecatcode
+ \catcode\endoffileasciicode \ignorecatcode
+ \catcode\circumflexasciicode\superscriptcatcode
+% \catcode\underscoreasciicode\subscriptcatcode
+ \catcode\underscoreasciicode\lettercatcode
+ \catcode\ampersandasciicode \alignmentcatcode
+ \catcode\backslashasciicode \escapecatcode
+ \catcode\leftbraceasciicode \begingroupcatcode
+ \catcode\rightbraceasciicode\endgroupcatcode
+ \catcode\dollarasciicode \mathshiftcatcode
+ \catcode\hashasciicode \parametercatcode
+ \catcode\commentasciicode \commentcatcode
+ \catcode`\@ \lettercatcode
+ \catcode`\! \lettercatcode
+ \catcode`\? \lettercatcode
+ \catcode\tildeasciicode \activecatcode
+ \catcode\barasciicode \activecatcode
+ \catcode`\: \lettercatcode
+\stopcatcodetable
+
+% IDEA:
+% Instead of using \externalfilter::command we can also define:
+%
+% \startmoduledefinition command #1
+% ...
+% \stopmoduledefinition
+%
+% which will be equivalent to
+%
+% \starttexdefinition externalfilter::command
+% ...
+% \stoptexdefinition
+%
+% and \modulevalue{command} => \getvalue{externalfilter::command}
+
+
+\def\unprotectmodulecatcodes
+ {\pushcatcodetable
+ \setcatcodetable\modulecatcodes}
+
+\def\protectmodulecatcodes
+ {\popcatcodetable}
+
+
+\stopmodule