summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/expkv/README.md2
-rw-r--r--Master/texmf-dist/doc/latex/expkv/expkv.pdfbin487605 -> 490757 bytes
-rw-r--r--Master/texmf-dist/source/latex/expkv/expkv.dtx181
-rw-r--r--Master/texmf-dist/tex/context/third/expkv/t-expkv.tex44
-rw-r--r--Master/texmf-dist/tex/generic/expkv/expkv.tex110
-rw-r--r--Master/texmf-dist/tex/latex/expkv/expkv.sty1
6 files changed, 230 insertions, 108 deletions
diff --git a/Master/texmf-dist/doc/latex/expkv/README.md b/Master/texmf-dist/doc/latex/expkv/README.md
index 8c241c42170..ccfa3194b3a 100644
--- a/Master/texmf-dist/doc/latex/expkv/README.md
+++ b/Master/texmf-dist/doc/latex/expkv/README.md
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# expkv -- an expandable key=val implementation
-Version 2021-07-15 v1.9
+Version 2021-09-20 v1.9a
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
diff --git a/Master/texmf-dist/doc/latex/expkv/expkv.pdf b/Master/texmf-dist/doc/latex/expkv/expkv.pdf
index 59012eccd11..2da6f6dada9 100644
--- a/Master/texmf-dist/doc/latex/expkv/expkv.pdf
+++ b/Master/texmf-dist/doc/latex/expkv/expkv.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/expkv/expkv.dtx b/Master/texmf-dist/source/latex/expkv/expkv.dtx
index da6fcf2542f..8651ad97a33 100644
--- a/Master/texmf-dist/source/latex/expkv/expkv.dtx
+++ b/Master/texmf-dist/source/latex/expkv/expkv.dtx
@@ -43,6 +43,7 @@ This work consists of the file expkv.dtx
and the derived files expkv.pdf
expkv.sty
expkv.tex
+ t-expkv.tex
\endpreamble
% stop docstrip adding \endinput
@@ -50,6 +51,7 @@ and the derived files expkv.pdf
\endpostamble
\generate{\file{expkv.sty}{\from{expkv.dtx}{pkg}}}
\generate{\file{expkv.tex}{\from{expkv.dtx}{tex}}}
+\generate{\file{t-expkv.tex}{\from{expkv.dtx}{ctx}}}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
@@ -98,7 +100,7 @@ and the derived files expkv.pdf
numexpr,
protected,
}
- ,moretexcs=[5]^^A plain/LaTeX
+ ,moretexcs=[5]^^A plain/LaTeX/ConTeXt
{
approx,
begin,
@@ -112,6 +114,7 @@ and the derived files expkv.pdf
TeX,
textit,texttt,
usepackage,
+ usemodule,
}
,moretexcs=[6]^^A used packages
{
@@ -299,16 +302,25 @@ and the derived files expkv.pdf
\newcommand\val{\meta{value}}
\newcommand\set{\meta{set}}
\hypersetup{linkcolor=red!80!black,urlcolor=purple!80!black}
+\DoNotIndex{\directlua}
\DoNotIndex{\def,\edef,\,,\=,\begingroup,\catcode,\chardef,\csname,\endcsname}
\DoNotIndex{\endgroup,\endinput,\errmessage,\expandafter,\input,\let,\long}
\DoNotIndex{\protected,\ProvidesFile,\ProvidesPackage,\relax,\space}
-\DoNotIndex{\@,\unexpanded,\string,\expanded,\detokenize,\meaning,\lastnamedcs}
-\DoNotIndex{\romannumeral,\z@}
+\DoNotIndex{\^,\@,\unexpanded,\string,\expanded,\detokenize,\meaning}
+\DoNotIndex{\lastnamedcs,\romannumeral,\z@}
+\DoNotIndex{\noexpand,\normalexpanded,\normalunexpanded}
+\DoNotIndex{\par,\protect}
+\DoNotIndex{\unprotect}
+\DoNotIndex{\writestatus}
\DoNotIndex{\ifcsname}
\DoNotIndex{\ifx}
+\DoNotIndex{\iffalse}
+\DoNotIndex{\ifnum}
\DoNotIndex{\else}
\DoNotIndex{\fi}
-\@gobble\fi ^^A ignoring \ifx and \ifcsname, but only one \fi
+\@gobble\fi ^^A ignoring \ifx etc., but only one \fi
+\@gobble\fi ^^A ignoring \ifx etc., but only one \fi
+\@gobble\fi ^^A ignoring \ifx etc., but only one \fi
\@ifdefinable\gobbledocstriptag{\def\gobbledocstriptag#1>{}}
\newcommand*\pmso[1] ^^A poor man's strike out
{^^A
@@ -365,15 +377,19 @@ and the derived files expkv.pdf
% example \pkg{babel} turns characters active for some languages, for instance
% the equal sign is turned active for Turkish.
%
-% \expkv\ is usable as generic code or as a \LaTeX\ package. To use it, just
-% use one of:
+% \expkv\ is usable as generic code, as a \LaTeX\ package or as a \ConTeXt\
+% module. To use it, just use one of:
% \begin{lstlisting}
-% \usepackage{expkv} % LaTeX
% \input expkv % plainTeX
+% \usepackage{expkv} % LaTeX
+% \usemodule[expkv] % ConTeXt
% \end{lstlisting}
-% The \LaTeX\ package doesn't do more than \file{expkv.tex}, except calling
-% |\ProvidesPackage| and setting things up such that \file{expkv.tex} will use
-% |\ProvidesFile|.
+% Both the \LaTeX\ package and the \ConTeXt\ module don't do more than
+% \file{expkv.tex}, except calling |\ProvidesPackage| and setting things up such
+% that \file{expkv.tex} will use |\ProvidesFile|, or printing some status
+% information. The \ConTeXt\ support is not thoroughly tested, though (since I
+% don't use \ConTeXt\ myself I don't know if there are additional pitfalls I
+% wasn't aware of).
%
% In the \expkv\ family are other packages contained which provide additional
% functionality. Those packages currently are:
@@ -410,7 +426,7 @@ and the derived files expkv.pdf
% prefixes allowed for |\let| can prefix those with ``|let|'' in their name,
% accordingly. Neither \set\ nor \key\ are allowed to be empty for new keys.
% \set\ will be used as is inside of |\csname ...\endcsname| and \key\ will get
-% |\detokenize|d.
+% |\detokenize|d. Also \set\ should not contain an explicit |\par| token.
%
% \begin{function}{\ekvdef}
% \begin{syntax}
@@ -919,6 +935,11 @@ and the derived files expkv.pdf
% \end{verbatim}
% Any clean up has to be done by you, |\ekverr| will expand to nothing after
% throwing the error message.
+%
+% In \ConTeXt\ this macro works differently. While still being fully expandable,
+% it doesn't have the character count limitation and doesn't impose restrictions
+% on \meta{package}. It will not display the additional text and adding line
+% breaks is not possible.
% \example Say we set up a small calculation which works with user input. In our
% calculation we need a division, so have to watch out for division by zero. If
% we detect such a case we throw an error and do the recovery by using the
@@ -926,7 +947,7 @@ and the derived files expkv.pdf
% \begin{lstlisting}
% \newcommand*\mydivision[2]
% {%
-% \number\numexpr
+% \the\numexpr
% \ifnum\numexpr#2=0 % space here on purpose
% \ekverr{my}{division by 0. Setting result to 2147483647.}%
% 2147483647%
@@ -1562,6 +1583,27 @@ and the derived files expkv.pdf
% \gobbledocstriptag
%</pkg>
%^^A=<<
+%^^A the ConTeXt module >>=
+% \subsection{The \ConTeXt\ module}
+% This is pretty straight forward, we just have to change the error throwing
+% mechanism for \ConTeXt\ (the approach taken for plain and \LaTeX\ breaks in
+% \ConTeXt, effectively breaking \ConTeXt, dropping you in an interactive \TeX\
+% session with almost no means of escape).
+% \gobbledocstriptag
+%<*ctx>
+% \begin{macrocode}
+\writestatus{loading}{ConTeXt User Module / expkv}
+\unprotect
+\input expkv.tex
+\long\def\ekv@err@collect#1\par#2%
+ {\directlua{tex.error[[\detokenize{#2} Error: #1]]}}
+\writestatus{loading}
+ {ConTeXt User Module / expkv / Version \ekvVersion\space loaded}
+\protect\endinput
+% \end{macrocode}
+% \gobbledocstriptag
+%</ctx>
+%^^A=<<
%^^A main file >>=
% \subsection{The Generic Code}
% The rest of this implementation will be the generic code.
@@ -1584,17 +1626,30 @@ and the derived files expkv.pdf
\expandafter
\endgroup
\ifx\ekvtmpa\ekvtmpb
+ \expandafter\let\csname ekv@expanded\endcsname\expanded
+ \expandafter\let\csname ekv@unexpanded\endcsname\unexpanded
\else
- \errmessage{expkv Error: e-TeX and \noexpand\expanded required}
- \expandafter\endinput
+ \begingroup
+ \edef\ekvtmpa{\string\expanded}
+ \edef\ekvtmpb{\meaning\normalexpanded}
+ \expandafter
+ \endgroup
+ \ifx\ekvtmpa\ekvtmpb
+ \expandafter\let\csname ekv@expanded\endcsname\normalexpanded
+ \expandafter\let\csname ekv@unexpanded\endcsname\normalunexpanded
+ \else
+ \errmessage
+ {expkv Error: e-TeX and the \noexpand\expanded primitive required}%
+ \expandafter\endinput
+ \fi
\fi
% \end{macrocode}
%
% \begin{macro}{\ekvVersion,\ekvDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvVersion{1.9}
-\def\ekvDate{2021-07-15}
+\def\ekvVersion{1.9a}
+\def\ekvDate{2021-09-20}
% \end{macrocode}
% \end{macro}
%
@@ -1731,7 +1786,7 @@ and the derived files expkv.pdf
% \begin{macrocode}
\ekv@if@lastnamedcs
{%
- \def\ekv@ifdefined#1{\ifcsname#1\endcsname\ekv@ifdef@\fi\@secondoftwo}
+ \long\def\ekv@ifdefined#1{\ifcsname#1\endcsname\ekv@ifdef@\fi\@secondoftwo}
\def\ekv@ifdef@\fi\@secondoftwo
{%
\fi
@@ -1742,7 +1797,7 @@ and the derived files expkv.pdf
}
}
{%
- \def\ekv@ifdefined#1%
+ \long\def\ekv@ifdefined#1%
{%
\ifcsname#1\endcsname\ekv@ifdef@\fi\ekv@ifdef@false#1\endcsname\relax
\ekv@fi@secondoftwo
@@ -1853,7 +1908,7 @@ and the derived files expkv.pdf
}%
}
\expandafter\ekv@csv@loop\expandafter{\ekv@strip{#2}}
-\long\def\ekv@csv@loop@do#1#2{\unexpanded{#2{#1}}\ekv@csv@loop{#2}\ekv@mark}
+\long\def\ekv@csv@loop@do#1#2{\ekv@unexpanded{#2{#1}}\ekv@csv@loop{#2}\ekv@mark}
\def\ekv@csv@loop@end#1%
{%
\long\def\ekv@csv@loop@end
@@ -1875,13 +1930,13 @@ and the derived files expkv.pdf
% The keys will all follow the same naming scheme, so we define it here.
% \begin{macrocode}
\def\ekv@name@set#1{ekv#1(}
-\def\ekv@name@key#1{#1)}
+\long\def\ekv@name@key#1{#1)}
\edef\ekv@name
{%
- \unexpanded\expandafter{\ekv@name@set{#1}}%
- \unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
+ \ekv@unexpanded\expandafter{\ekv@name@set{#1}}%
+ \ekv@unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
}
-\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
+\long\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
% \end{macrocode}
% \end{macro}
%
@@ -1908,15 +1963,15 @@ and the derived files expkv.pdf
% \begin{macrocode}
\edef\ekv@checkvalid
{%
- \unexpanded\expandafter{\ekv@ifempty{#1}}%
- \unexpanded
+ \ekv@unexpanded\expandafter{\ekv@ifempty{#1}}%
+ \ekv@unexpanded
{{%
\def\ekv@tmp{}%
\errmessage{expkv Error: empty set name not allowed}%
}}%
{%
- \unexpanded\expandafter{\ekv@ifempty{#2}}%
- \unexpanded
+ \ekv@unexpanded\expandafter{\ekv@ifempty{#2}}%
+ \ekv@unexpanded
{%
{%
\def\ekv@tmp{}%
@@ -1925,7 +1980,7 @@ and the derived files expkv.pdf
\@secondoftwo
}%
}%
- \unexpanded{\@gobble}%
+ \ekv@unexpanded{\@gobble}%
}
\ekv@exparg{\protected\def\ekv@checkvalid#1#2}{\ekv@checkvalid}%
% \end{macrocode}
@@ -1934,9 +1989,9 @@ and the derived files expkv.pdf
% \begin{macro}{\ekvifdefined,\ekvifdefinedNoVal}
% And provide user-level macros to test whether a key is defined.
% \begin{macrocode}
-\ekv@expargtwice{\def\ekvifdefined#1#2}%
+\ekv@expargtwice{\long\def\ekvifdefined#1#2}%
{\expandafter\ekv@ifdefined\expandafter{\ekv@name{#1}{#2}}}
-\ekv@expargtwice{\def\ekvifdefinedNoVal#1#2}%
+\ekv@expargtwice{\long\def\ekvifdefinedNoVal#1#2}%
{\expandafter\ekv@ifdefined\expandafter{\ekv@name{#1}{#2}N}}
% \end{macrocode}
% \end{macro}
@@ -1955,9 +2010,9 @@ and the derived files expkv.pdf
{#1{\expandafter\def\csname#2\endcsname####1{##3}#3}}%
\protected\long\def\ekvdefNoVal##1##2##3%
{#1{\expandafter\def\csname#2N\endcsname{##3}#3}}%
- \protected\def\ekvlet##1##2##3%
+ \protected\long\def\ekvlet##1##2##3%
{#1{\expandafter\let\csname#2\endcsname##3#3}}%
- \protected\def\ekvletNoVal##1##2##3%
+ \protected\long\def\ekvletNoVal##1##2##3%
{#1{\expandafter\let\csname#2N\endcsname##3#3}}%
\ekv@expargtwice{\protected\long\def\ekvdefunknown##1##2}%
{%
@@ -1981,7 +2036,7 @@ and the derived files expkv.pdf
}%
{\ekv@zero\ekv@checkvalid{##1}.}%
}%
- \protected\def\ekvletkv##1##2##3##4%
+ \protected\long\def\ekvletkv##1##2##3##4%
{%
#1%
{%
@@ -1990,7 +2045,7 @@ and the derived files expkv.pdf
#3%
}%
}%
- \protected\def\ekvletkvNoVal##1##2##3##4%
+ \protected\long\def\ekvletkvNoVal##1##2##3##4%
{%
#1%
{%
@@ -2002,13 +2057,13 @@ and the derived files expkv.pdf
}
\edef\ekvdefNoVal
{%
- {\unexpanded\expandafter{\ekv@checkvalid{#1}{#2}}}%
- {\unexpanded\expandafter{\ekv@name{#1}{#2}}}%
+ {\ekv@unexpanded\expandafter{\ekv@checkvalid{#1}{#2}}}%
+ {\ekv@unexpanded\expandafter{\ekv@name{#1}{#2}}}%
{%
- \unexpanded{\expandafter\ekv@defsetmacro\csname}%
- \unexpanded\expandafter{\ekv@undefined@set{#1}\endcsname{#1}}%
+ \ekv@unexpanded{\expandafter\ekv@defsetmacro\csname}%
+ \ekv@unexpanded\expandafter{\ekv@undefined@set{#1}\endcsname{#1}}%
}%
- {\unexpanded\expandafter{\ekv@name{#3}{#4}}}%
+ {\ekv@unexpanded\expandafter{\ekv@name{#3}{#4}}}%
}
\expandafter\ekvdef\ekvdefNoVal
% \end{macrocode}
@@ -2047,7 +2102,7 @@ and the derived files expkv.pdf
\edef\ekv@tmp
{%
\ekvcsvloop#1{#6}%
- \unexpanded{#2}%
+ \ekv@unexpanded{#2}%
{\ekvcsvloop{}{#5,#6}}%
}%
\ekv@expargtwice
@@ -2092,7 +2147,7 @@ and the derived files expkv.pdf
{%
\ifcsname#2\endcsname\ekv@redirect@kv@a\fi\@gobble{##1}%
##4{##1}{##2}%
- }
+ }%
\def\ekv@redirect@kv@a\fi\@gobble
{\fi\expandafter\ekv@redirect@kv@b\lastnamedcs}%
}
@@ -2111,17 +2166,17 @@ and the derived files expkv.pdf
\ifcsname#2\endcsname\ekv@redirect@kv@a\fi\ekv@redirect@kv@a@
#2\endcsname{##1}%
##4{##1}{##2}%
- }
+ }%
\long\def\ekv@redirect@kv@a@#4\endcsname##3{}%
\def\ekv@redirect@kv@a\fi\ekv@redirect@kv@a@
{\fi\expandafter\ekv@redirect@kv@b\csname}%
- }
+ }%
}
% \end{macrocode}
% The key name given to this loop will already be |\detokenize|d by |\ekvset|,
% so we can safely remove the |\detokenize| here for some performance gain.
% \begin{macrocode}
-\def\ekv@redirect@kv#1\detokenize#2#3\ekv@stop{\unexpanded{#1#2#3}}
+\def\ekv@redirect@kv#1\detokenize#2#3\ekv@stop{\ekv@unexpanded{#1#2#3}}
\edef\ekv@redirect@kv
{%
{\expandafter\ekv@redirect@kv\ekv@name{#2}{#1}N\ekv@stop}%
@@ -2158,12 +2213,12 @@ and the derived files expkv.pdf
% \begin{macrocode}
\edef\ekv@defsetmacro
{%
- \unexpanded{\ifx#1\relax\edef#1##1}%
+ \ekv@unexpanded{\ifx#1\relax\edef#1##1}%
{%
- \unexpanded\expandafter{\ekv@name@set{#2}}%
- \unexpanded\expandafter{\ekv@name@key{##1}}%
+ \ekv@unexpanded\expandafter{\ekv@name@set{#2}}%
+ \ekv@unexpanded\expandafter{\ekv@name@key{##1}}%
}%
- \unexpanded{\fi}%
+ \ekv@unexpanded{\fi}%
}
\ekv@exparg{\protected\def\ekv@defsetmacro#1#2}{\ekv@defsetmacro}
% \end{macrocode}
@@ -2341,12 +2396,12 @@ and the derived files expkv.pdf
% \begin{macrocode}
\edef\ekv@set@noeq
{%
- \unexpanded
+ \ekv@unexpanded
{%
\ekv@ifblank@##1\ekv@nil\ekv@ifempty@B\ekv@set@was@blank
\ekv@ifempty@A\ekv@ifempty@B
}%
- \unexpanded\expandafter
+ \ekv@unexpanded\expandafter
{\ekv@strip{##1}{\expandafter\ekv@set@key\detokenize}\ekv@mark}%
}
\ekv@exparg
@@ -2398,12 +2453,15 @@ and the derived files expkv.pdf
% macro, that has the same scope as |\keyval_parse:NNn| from \pkg{expl3}.
% This is pretty analogue to the |\ekvset| implementation, we just put an
% |\unexpanded| here and there instead of other macros to stop the |\expanded|
-% on our output. The |\unexpanded\expanded{{...}}| ensures that the material is
-% in an alignment safe group at all time, and that it doesn't expand any further
-% in an |\edef| or |\expanded| context.
+% on our output. The |\unexpanded\expanded{{...}}| ensures that the material
+% is in an alignment safe group at all time, and that it doesn't expand any
+% further in an |\edef| or |\expanded| context.
% \begin{macrocode}
\long\def\ekvparse##1##2##3%
- {\unexpanded\expanded{{\ekv@parse{##1}{##2}\ekv@mark##3#1\ekv@stop#1}}}
+ {%
+ \ekv@unexpanded\ekv@expanded
+ {{\ekv@parse{##1}{##2}\ekv@mark##3#1\ekv@stop#1}}%
+ }
% \end{macrocode}
% \end{macro}
%
@@ -2485,12 +2543,12 @@ and the derived files expkv.pdf
% \begin{macrocode}
\edef\ekv@parse@noeq
{%
- \unexpanded
+ \ekv@unexpanded
{%
\ekv@ifblank@##1\ekv@nil\ekv@ifempty@B\ekv@parse@was@blank
\ekv@ifempty@A\ekv@ifempty@B
}%
- \unexpanded\expandafter{\ekv@strip{##1}\ekv@parse@key}%
+ \ekv@unexpanded\expandafter{\ekv@strip{##1}\ekv@parse@key}%
}
\ekv@exparg
{%
@@ -2521,7 +2579,7 @@ and the derived files expkv.pdf
{\ekv@strip{##2}\ekv@parse@pair@{##1}}
\long\def\ekv@parse@pair@##1##2##3##4%
{%
- \unexpanded{##4{##2}{##1}}%
+ \ekv@unexpanded{##4{##2}{##1}}%
\ekv@parse@other{##3}{##4}%
}
% \end{macrocode}
@@ -2531,7 +2589,7 @@ and the derived files expkv.pdf
% \begin{macrocode}
\long\def\ekv@parse@key##1##2%
{%
- \unexpanded{##2{##1}}%
+ \ekv@unexpanded{##2{##1}}%
\ekv@parse@other{##2}%
}
% \end{macrocode}
@@ -2552,8 +2610,8 @@ and the derived files expkv.pdf
% \begin{macrocode}
\edef\ekvsetSneaked
{%
- \unexpanded{\ekvsneak{#2}}%
- \unexpanded\expandafter{\ekvset{#1}{#3}}%
+ \ekv@unexpanded{\ekvsneak{#2}}%
+ \ekv@unexpanded\expandafter{\ekvset{#1}{#3}}%
}
\ekv@expargtwice{\long\def\ekvsetSneaked#1#2#3}{\ekvsetSneaked}
% \end{macrocode}
@@ -2891,7 +2949,8 @@ and the derived files expkv.pdf
\ekv@exparg{\long\def\ekv@err@common@#1`#2' #3.#4#5}%
{\ekv@err{#4 `#5' in set `#2'}}
\ekv@exparg{\long\def\ekv@err@unknown#1}{\ekv@err@common{unknown key}{#1}}
-\ekv@exparg{\long\def\ekv@err@noarg #1}{\ekv@err@common{unwanted value for}{#1}}
+\ekv@exparg{\long\def\ekv@err@noarg #1}
+ {\ekv@err@common{unwanted value for}{#1}}
\ekv@exparg{\long\def\ekv@err@reqval #1}{\ekv@err@common{missing value for}{#1}}
\ekv@exparg{\long\def\ekv@err@redirect@kv@notfound#1#2#3\ekv@stop}%
{\ekv@err{no key `#2' in sets #3}}
diff --git a/Master/texmf-dist/tex/context/third/expkv/t-expkv.tex b/Master/texmf-dist/tex/context/third/expkv/t-expkv.tex
new file mode 100644
index 00000000000..9d6a8fc86ee
--- /dev/null
+++ b/Master/texmf-dist/tex/context/third/expkv/t-expkv.tex
@@ -0,0 +1,44 @@
+%%
+%% This is file `t-expkv.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% expkv.dtx (with options: `ctx')
+%%
+%% --------------------------------------------------------------
+%% expkv -- an expandable key=val implementation
+%% E-mail: jspratte@yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%%
+%% Copyright (C) 2020-2021 Jonathan P. Spratte
+%%
+%% This work may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
+%% (at your option) any later version. The latest version of this license is in
+%% the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status) by
+%% Jonathan P. Spratte.
+%%
+%% This work consists of the file expkv.dtx
+%% and the derived files expkv.pdf
+%% expkv.sty
+%% expkv.tex
+%% t-expkv.tex
+%%
+\writestatus{loading}{ConTeXt User Module / expkv}
+\unprotect
+\input expkv.tex
+\long\def\ekv@err@collect#1\par#2%
+ {\directlua{tex.error[[\detokenize{#2} Error: #1]]}}
+\writestatus{loading}
+ {ConTeXt User Module / expkv / Version \ekvVersion\space loaded}
+\protect\endinput
+%%
+%%
+%% End of file `t-expkv.tex'.
diff --git a/Master/texmf-dist/tex/generic/expkv/expkv.tex b/Master/texmf-dist/tex/generic/expkv/expkv.tex
index 16dd65d3e2f..6e342c32ef7 100644
--- a/Master/texmf-dist/tex/generic/expkv/expkv.tex
+++ b/Master/texmf-dist/tex/generic/expkv/expkv.tex
@@ -29,6 +29,7 @@
%% and the derived files expkv.pdf
%% expkv.sty
%% expkv.tex
+%% t-expkv.tex
%%
\expandafter\ifx\csname ekvVersion\endcsname\relax
\else
@@ -40,12 +41,25 @@
\expandafter
\endgroup
\ifx\ekvtmpa\ekvtmpb
+ \expandafter\let\csname ekv@expanded\endcsname\expanded
+ \expandafter\let\csname ekv@unexpanded\endcsname\unexpanded
\else
- \errmessage{expkv Error: e-TeX and \noexpand\expanded required}
- \expandafter\endinput
+ \begingroup
+ \edef\ekvtmpa{\string\expanded}
+ \edef\ekvtmpb{\meaning\normalexpanded}
+ \expandafter
+ \endgroup
+ \ifx\ekvtmpa\ekvtmpb
+ \expandafter\let\csname ekv@expanded\endcsname\normalexpanded
+ \expandafter\let\csname ekv@unexpanded\endcsname\normalunexpanded
+ \else
+ \errmessage
+ {expkv Error: e-TeX and the \noexpand\expanded primitive required}%
+ \expandafter\endinput
+ \fi
\fi
-\def\ekvVersion{1.9}
-\def\ekvDate{2021-07-15}
+\def\ekvVersion{1.9a}
+\def\ekvDate{2021-09-20}
\csname ekv@tmp\endcsname
\expandafter\chardef\csname ekv@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -94,7 +108,7 @@
\long\def\ekv@ifblank@\ekv@mark#1{\ekv@ifempty@\ekv@ifempty@A}
\ekv@if@lastnamedcs
{%
- \def\ekv@ifdefined#1{\ifcsname#1\endcsname\ekv@ifdef@\fi\@secondoftwo}
+ \long\def\ekv@ifdefined#1{\ifcsname#1\endcsname\ekv@ifdef@\fi\@secondoftwo}
\def\ekv@ifdef@\fi\@secondoftwo
{%
\fi
@@ -105,7 +119,7 @@
}
}
{%
- \def\ekv@ifdefined#1%
+ \long\def\ekv@ifdefined#1%
{%
\ifcsname#1\endcsname\ekv@ifdef@\fi\ekv@ifdef@false#1\endcsname\relax
\ekv@fi@secondoftwo
@@ -164,7 +178,7 @@
}%
}
\expandafter\ekv@csv@loop\expandafter{\ekv@strip{#2}}
-\long\def\ekv@csv@loop@do#1#2{\unexpanded{#2{#1}}\ekv@csv@loop{#2}\ekv@mark}
+\long\def\ekv@csv@loop@do#1#2{\ekv@unexpanded{#2{#1}}\ekv@csv@loop{#2}\ekv@mark}
\def\ekv@csv@loop@end#1%
{%
\long\def\ekv@csv@loop@end
@@ -180,25 +194,25 @@
\ekv@strip{\ekv@mark#1}\ekv@csv@loop@do#2%
{\ekv@csv@loop{#2}\ekv@mark}
\def\ekv@name@set#1{ekv#1(}
-\def\ekv@name@key#1{#1)}
+\long\def\ekv@name@key#1{#1)}
\edef\ekv@name
{%
- \unexpanded\expandafter{\ekv@name@set{#1}}%
- \unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
+ \ekv@unexpanded\expandafter{\ekv@name@set{#1}}%
+ \ekv@unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
}
-\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
+\long\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
\def\ekv@undefined@set#1{! expkv Error: Set `#1' undefined.}
\edef\ekv@checkvalid
{%
- \unexpanded\expandafter{\ekv@ifempty{#1}}%
- \unexpanded
+ \ekv@unexpanded\expandafter{\ekv@ifempty{#1}}%
+ \ekv@unexpanded
{{%
\def\ekv@tmp{}%
\errmessage{expkv Error: empty set name not allowed}%
}}%
{%
- \unexpanded\expandafter{\ekv@ifempty{#2}}%
- \unexpanded
+ \ekv@unexpanded\expandafter{\ekv@ifempty{#2}}%
+ \ekv@unexpanded
{%
{%
\def\ekv@tmp{}%
@@ -207,12 +221,12 @@
\@secondoftwo
}%
}%
- \unexpanded{\@gobble}%
+ \ekv@unexpanded{\@gobble}%
}
\ekv@exparg{\protected\def\ekv@checkvalid#1#2}{\ekv@checkvalid}%
-\ekv@expargtwice{\def\ekvifdefined#1#2}%
+\ekv@expargtwice{\long\def\ekvifdefined#1#2}%
{\expandafter\ekv@ifdefined\expandafter{\ekv@name{#1}{#2}}}
-\ekv@expargtwice{\def\ekvifdefinedNoVal#1#2}%
+\ekv@expargtwice{\long\def\ekvifdefinedNoVal#1#2}%
{\expandafter\ekv@ifdefined\expandafter{\ekv@name{#1}{#2}N}}
\def\ekvdef#1#2#3#4%
{%
@@ -220,9 +234,9 @@
{#1{\expandafter\def\csname#2\endcsname####1{##3}#3}}%
\protected\long\def\ekvdefNoVal##1##2##3%
{#1{\expandafter\def\csname#2N\endcsname{##3}#3}}%
- \protected\def\ekvlet##1##2##3%
+ \protected\long\def\ekvlet##1##2##3%
{#1{\expandafter\let\csname#2\endcsname##3#3}}%
- \protected\def\ekvletNoVal##1##2##3%
+ \protected\long\def\ekvletNoVal##1##2##3%
{#1{\expandafter\let\csname#2N\endcsname##3#3}}%
\ekv@expargtwice{\protected\long\def\ekvdefunknown##1##2}%
{%
@@ -246,7 +260,7 @@
}%
{\ekv@zero\ekv@checkvalid{##1}.}%
}%
- \protected\def\ekvletkv##1##2##3##4%
+ \protected\long\def\ekvletkv##1##2##3##4%
{%
#1%
{%
@@ -255,7 +269,7 @@
#3%
}%
}%
- \protected\def\ekvletkvNoVal##1##2##3##4%
+ \protected\long\def\ekvletkvNoVal##1##2##3##4%
{%
#1%
{%
@@ -267,13 +281,13 @@
}
\edef\ekvdefNoVal
{%
- {\unexpanded\expandafter{\ekv@checkvalid{#1}{#2}}}%
- {\unexpanded\expandafter{\ekv@name{#1}{#2}}}%
+ {\ekv@unexpanded\expandafter{\ekv@checkvalid{#1}{#2}}}%
+ {\ekv@unexpanded\expandafter{\ekv@name{#1}{#2}}}%
{%
- \unexpanded{\expandafter\ekv@defsetmacro\csname}%
- \unexpanded\expandafter{\ekv@undefined@set{#1}\endcsname{#1}}%
+ \ekv@unexpanded{\expandafter\ekv@defsetmacro\csname}%
+ \ekv@unexpanded\expandafter{\ekv@undefined@set{#1}\endcsname{#1}}%
}%
- {\unexpanded\expandafter{\ekv@name{#3}{#4}}}%
+ {\ekv@unexpanded\expandafter{\ekv@name{#3}{#4}}}%
}
\expandafter\ekvdef\ekvdefNoVal
\protected\def\ekvredirectunknown
@@ -298,7 +312,7 @@
\edef\ekv@tmp
{%
\ekvcsvloop#1{#6}%
- \unexpanded{#2}%
+ \ekv@unexpanded{#2}%
{\ekvcsvloop{}{#5,#6}}%
}%
\ekv@expargtwice
@@ -321,7 +335,7 @@
{%
\ifcsname#2\endcsname\ekv@redirect@kv@a\fi\@gobble{##1}%
##4{##1}{##2}%
- }
+ }%
\def\ekv@redirect@kv@a\fi\@gobble
{\fi\expandafter\ekv@redirect@kv@b\lastnamedcs}%
}
@@ -340,13 +354,13 @@
\ifcsname#2\endcsname\ekv@redirect@kv@a\fi\ekv@redirect@kv@a@
#2\endcsname{##1}%
##4{##1}{##2}%
- }
+ }%
\long\def\ekv@redirect@kv@a@#4\endcsname##3{}%
\def\ekv@redirect@kv@a\fi\ekv@redirect@kv@a@
{\fi\expandafter\ekv@redirect@kv@b\csname}%
- }
+ }%
}
-\def\ekv@redirect@kv#1\detokenize#2#3\ekv@stop{\unexpanded{#1#2#3}}
+\def\ekv@redirect@kv#1\detokenize#2#3\ekv@stop{\ekv@unexpanded{#1#2#3}}
\edef\ekv@redirect@kv
{%
{\expandafter\ekv@redirect@kv\ekv@name{#2}{#1}N\ekv@stop}%
@@ -365,12 +379,12 @@
\long\def\ekv@redirect@kv@d#1#2#3\ekv@stop{#1{#2}}
\edef\ekv@defsetmacro
{%
- \unexpanded{\ifx#1\relax\edef#1##1}%
+ \ekv@unexpanded{\ifx#1\relax\edef#1##1}%
{%
- \unexpanded\expandafter{\ekv@name@set{#2}}%
- \unexpanded\expandafter{\ekv@name@key{##1}}%
+ \ekv@unexpanded\expandafter{\ekv@name@set{#2}}%
+ \ekv@unexpanded\expandafter{\ekv@name@key{##1}}%
}%
- \unexpanded{\fi}%
+ \ekv@unexpanded{\fi}%
}
\ekv@exparg{\protected\def\ekv@defsetmacro#1#2}{\ekv@defsetmacro}
\ekv@expargtwice{\def\ekvifdefinedset#1}%
@@ -432,12 +446,12 @@
{\ekv@strip{##1}{\expandafter\ekv@set@pair\detokenize}\ekv@mark##2\ekv@nil}
\edef\ekv@set@noeq
{%
- \unexpanded
+ \ekv@unexpanded
{%
\ekv@ifblank@##1\ekv@nil\ekv@ifempty@B\ekv@set@was@blank
\ekv@ifempty@A\ekv@ifempty@B
}%
- \unexpanded\expandafter
+ \ekv@unexpanded\expandafter
{\ekv@strip{##1}{\expandafter\ekv@set@key\detokenize}\ekv@mark}%
}
\ekv@exparg
@@ -461,7 +475,10 @@
\long\def\ekvsneak##1##2\ekv@stop#1##3{##2\ekv@stop#1{##3##1}}
\long\def\ekvsneakPre##1##2\ekv@stop#1##3{##2\ekv@stop#1{##1##3}}
\long\def\ekvparse##1##2##3%
- {\unexpanded\expanded{{\ekv@parse{##1}{##2}\ekv@mark##3#1\ekv@stop#1}}}
+ {%
+ \ekv@unexpanded\ekv@expanded
+ {{\ekv@parse{##1}{##2}\ekv@mark##3#1\ekv@stop#1}}%
+ }
\long\def\ekv@parse##1##2##3#1%
{%
\ekv@gobble@from@mark@to@stop##3\ekv@endparse\ekv@stop
@@ -508,12 +525,12 @@
{\ekv@strip{##1}\ekv@parse@pair##2}
\edef\ekv@parse@noeq
{%
- \unexpanded
+ \ekv@unexpanded
{%
\ekv@ifblank@##1\ekv@nil\ekv@ifempty@B\ekv@parse@was@blank
\ekv@ifempty@A\ekv@ifempty@B
}%
- \unexpanded\expandafter{\ekv@strip{##1}\ekv@parse@key}%
+ \ekv@unexpanded\expandafter{\ekv@strip{##1}\ekv@parse@key}%
}
\ekv@exparg
{%
@@ -534,12 +551,12 @@
{\ekv@strip{##2}\ekv@parse@pair@{##1}}
\long\def\ekv@parse@pair@##1##2##3##4%
{%
- \unexpanded{##4{##2}{##1}}%
+ \ekv@unexpanded{##4{##2}{##1}}%
\ekv@parse@other{##3}{##4}%
}
\long\def\ekv@parse@key##1##2%
{%
- \unexpanded{##2{##1}}%
+ \ekv@unexpanded{##2{##1}}%
\ekv@parse@other{##2}%
}
}
@@ -548,8 +565,8 @@
\ekvset,=
\edef\ekvsetSneaked
{%
- \unexpanded{\ekvsneak{#2}}%
- \unexpanded\expandafter{\ekvset{#1}{#3}}%
+ \ekv@unexpanded{\ekvsneak{#2}}%
+ \ekv@unexpanded\expandafter{\ekvset{#1}{#3}}%
}
\ekv@expargtwice{\long\def\ekvsetSneaked#1#2#3}{\ekvsetSneaked}
\ekv@exparg{\def\ekvchangeset#1}%
@@ -739,7 +756,8 @@
\ekv@exparg{\long\def\ekv@err@common@#1`#2' #3.#4#5}%
{\ekv@err{#4 `#5' in set `#2'}}
\ekv@exparg{\long\def\ekv@err@unknown#1}{\ekv@err@common{unknown key}{#1}}
-\ekv@exparg{\long\def\ekv@err@noarg #1}{\ekv@err@common{unwanted value for}{#1}}
+\ekv@exparg{\long\def\ekv@err@noarg #1}
+ {\ekv@err@common{unwanted value for}{#1}}
\ekv@exparg{\long\def\ekv@err@reqval #1}{\ekv@err@common{missing value for}{#1}}
\ekv@exparg{\long\def\ekv@err@redirect@kv@notfound#1#2#3\ekv@stop}%
{\ekv@err{no key `#2' in sets #3}}
diff --git a/Master/texmf-dist/tex/latex/expkv/expkv.sty b/Master/texmf-dist/tex/latex/expkv/expkv.sty
index 0d6911afc2c..6a708146d2e 100644
--- a/Master/texmf-dist/tex/latex/expkv/expkv.sty
+++ b/Master/texmf-dist/tex/latex/expkv/expkv.sty
@@ -29,6 +29,7 @@
%% and the derived files expkv.pdf
%% expkv.sty
%% expkv.tex
+%% t-expkv.tex
%%
\def\ekv@tmp
{%