summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-01 17:33:40 +0000
committerKarl Berry <karl@freefriends.org>2018-05-01 17:33:40 +0000
commit002703b8668a6ddf3bb04d4f2447581407b07434 (patch)
tree600092960c19f141be132cbb246e5990d01877e7 /Master/texmf-dist/tex/context/third
parenta1171cbbcfe334f4de9fca827b788791795351e8 (diff)
context-filter (18apr18)
git-svn-id: svn://tug.org/texlive/trunk@47530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/third')
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-filter.mkiv22
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkii (renamed from Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex)0
-rw-r--r--Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkiv89
3 files changed, 103 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
index 255581f41ea..71ff0d72b64 100644
--- a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
+++ b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-filter,
-%D version=2016.03.02,
+%D version=2018.04.17,
%D title=\CONTEXT\ User Module,
%D subtitle=Filter,
%D author=Aditya Mahajan,
@@ -9,15 +9,12 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Filter (ver: 2016.03.02)}
+\writestatus{loading}{Filter (ver: 2018.04.17)}
\startmodule [filter]
\usemodule [module-catcodes]
\unprotect
-% For backward compatibility
-\ifx\grabbufferdata\undefined \let\grabbufferdata \dostartbuffer \fi
-
% \f!temporaryextension was removed from the core in July 2012.
\ifx\f!temporaryextension\undefined \def\f!temporaryextension{tmp} \fi
@@ -65,7 +62,7 @@
{\ifcsname\externalfilter@count\endcsname \else
\expandafter\newcounter\csname\externalfilter@count\endcsname\fi}%
\setuevalue{\e!start\currentexternalfilter}{\externalfilter@start[\currentexternalfilter]}%
- \setuvalue {\e!stop\currentexternalfilter}{\externalfilter@process_filter}%
+ \setuvalue {\e!stop\currentexternalfilter}{}%
\setuevalue{process\currentexternalfilter file}{\externalfilter@process_file[\currentexternalfilter]}%
\setuevalue{process\currentexternalfilter buffer}{\externalfilter@process_buffer[\currentexternalfilter]}%
\setuevalue{inline\currentexternalfilter}{\externalfilter@inline[\currentexternalfilter]}%
@@ -133,9 +130,17 @@
\externalfilter@set_filenames
% Capture the contents of the buffer
- \grabbufferdata[\externalfilter@buffer_name][\e!start#1][\e!stop#1]
+ \edef\p_strip{\getvalue{\externalfilter@id-\c!strip-\externalfilterparameter\c!strip}}
+ \buff_pickup{\externalfilter@buffer_name}{\e!start#1}{\e!stop#1}{}{\externalfilter@process_filter}{\p_strip}
\stoptexdefinition
+\setvalue{\externalfilter@id-\c!strip-}{\zerocount}
+\setvalue{\externalfilter@id-\c!strip-\v!off}{\zerocount}
+\setvalue{\externalfilter@id-\c!strip-\v!on}{\plusone}
+
+\setvalue{\externalfilter@id-\c!strip-\v!no}{\zerocount}
+\setvalue{\externalfilter@id-\c!strip-\v!yes}{\plusone}
+
\unexpanded\def\externalfilter@process_file
{\dodoubleargument\externalfilter@process_file_indeed}
@@ -342,7 +347,7 @@
%D So, we define a macro that is based on `\readfile`.
\def\externalfilter@any_filename#1%
- {\ctxcommand{getreadfilename("any",".","#1")}}
+ {\clf_getreadfilename{any}{.}{#1}}
%D \subsubject {Set file names}
%D
@@ -511,6 +516,7 @@
\c!cache=\externalfilterparameter\c!continue, % for backward compatibility
\c!cache\c!option=,
\c!read=\v!yes,
+ \c!strip=\v!yes,
\c!readcommand=\ReadFile,
\c!directory=,
\c!purge=\v!yes,
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.mkii
index 052c9fca5b3..052c9fca5b3 100644
--- a/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.tex
+++ b/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkii
diff --git a/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkiv b/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkiv
new file mode 100644
index 00000000000..60e25cc05ed
--- /dev/null
+++ b/Master/texmf-dist/tex/context/third/filter/t-module-catcodes.mkiv
@@ -0,0 +1,89 @@
+%D \module
+%D [ file=t-module-catcodes,
+%D version=2018.04.16,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Module Catcodes,
+%D author=Aditya Mahajan,
+%D date=\currentdate,
+%D copyright=Aditya Mahajan,
+%D email=adityam <at> ieee <dot> org,
+%D license=Simplified BSD License]
+%D
+%D MkII and MkIV use different names and values for commonly used catcode
+%D tables. So, I define a private copy of the catcode tables that are needed
+%D by the filter and vim modules.
+
+
+\writestatus{loading}{Module Catcodes (ver: 2018.04.16)}
+
+\startmodule [module-catcodes]
+
+\newcatcodetable \modulecatcodes
+\startcatcodetable \modulecatcodes % same as \prtcatcodes
+ \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
+\stopcatcodetable
+
+\def\unprotectmodulecatcodes
+ {\pushcatcodetable
+ \setcatcodetable\modulecatcodes}
+
+\def\protectmodulecatcodes
+ {\popcatcodetable}
+
+\unprotectmodulecatcodes
+
+%D The following catcode tables are used for reading
+%D and writing to files
+
+\newcatcodetable \externalfilter@read_catcodes
+\newcatcodetable \externalfilter@minimal_catcodes
+\newcatcodetable \externalfilter@verb_catcodes
+
+\startcatcodetable \externalfilter@read_catcodes % same as typcatcodesa
+ \catcode\tabasciicode = \othercatcode
+ \catcode\endoflineasciicode = \othercatcode
+ \catcode\formfeedasciicode = \othercatcode
+ \catcode\spaceasciicode = \othercatcode
+ \catcode\endoffileasciicode = \othercatcode
+ \catcode\leftbraceasciicode = \begingroupcatcode
+ \catcode\rightbraceasciicode = \endgroupcatcode
+\stopcatcodetable
+
+\startcatcodetable \externalfilter@minimal_catcodes % for reading t-vim output
+ \catcode\backslashasciicode = \escapecatcode
+ \catcode\leftbraceasciicode = \begingroupcatcode
+ \catcode\rightbraceasciicode = \endgroupcatcode
+ \catcode\endoflineasciicode = \activecatcode
+ \catcode\formfeedasciicode = \othercatcode
+ \catcode\spaceasciicode = \activecatcode
+\stopcatcodetable
+
+\startcatcodetable \externalfilter@verb_catcodes % same as vrbcatcodes
+ \catcode\tabasciicode = \othercatcode
+ \catcode\endoflineasciicode = \othercatcode
+ \catcode\formfeedasciicode = \othercatcode
+ \catcode\spaceasciicode = \othercatcode
+ \catcode\endoffileasciicode = \othercatcode
+\stopcatcodetable
+
+\protectmodulecatcodes
+\stopmodule