summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/expkv-cs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-29 21:28:43 +0000
committerKarl Berry <karl@freefriends.org>2020-04-29 21:28:43 +0000
commit0307bcecd0d6d579124ad1b8b89540665854d665 (patch)
treeeea906cb8a965cf559c717423b578e115f375be6 /Master/texmf-dist/source/latex/expkv-cs
parente1dbb2cbe7bf41890a5bd4b7e79421725e7b3938 (diff)
expkv-cs (29apr20)
git-svn-id: svn://tug.org/texlive/trunk@54939 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/expkv-cs')
-rw-r--r--Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx52
1 files changed, 46 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx b/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
index c5325faee52..fe782e6d947 100644
--- a/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
+++ b/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
@@ -766,8 +766,8 @@ and the derived files expkv-cs.pdf
% \begin{macro}{\ekvcVersion,\ekvcDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvcVersion{0.2}
-\def\ekvcDate{2020-04-05}
+\def\ekvcVersion{0.3}
+\def\ekvcDate{2020-04-29}
% \end{macrocode}
% \end{macro}
%
@@ -804,6 +804,34 @@ and the derived files expkv-cs.pdf
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[internal]
+% {
+% \ekvc@ekvset@per@expander,
+% \ekvc@ekvset@per@expander@a,
+% \ekvc@ekvset@per@expander@b
+% }
+% This macro expands |\ekvset| twice so that the first two steps of expansion
+% don't have to be made every time the \expkvc\ macros are used. We have to do
+% a little magic trick to get the macro parameter |#1| for the macro
+% definition this is used in, even though we're calling |\unexpanded|. We do
+% that by splitting the expanded |\ekvset| at some marks and place |##1| in
+% between.
+% \begin{macrocode}
+\def\ekvc@ekvset@pre@expander#1%
+ {%
+ \expandafter\ekvc@ekvset@pre@expander@a\ekvset{#1}\ekvc@stop\ekvc@stop
+ }
+\def\ekvc@ekvset@pre@expander@a
+ {%
+ \expandafter\ekvc@ekvset@pre@expander@b
+ }
+\def\ekvc@ekvset@pre@expander@b#1\ekvc@stop#2\ekvc@stop
+ {%
+ \unexpanded{#1}##1\unexpanded{#2}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ekvcSplitAndForward}
% The first user macro we want to set up can be reused for
% \cs[no-index]{ekvcSplit}. We'll split this one up so that the test whether
@@ -831,7 +859,7 @@ and the derived files expkv-cs.pdf
\ekvc@SetupSplitKeys{#3}%
\ekvc@any@long\edef#1##1%
{%
- \unexpanded{\ekvset}{\ekvc@set}{##1}%
+ \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}%
\unexpanded\expandafter
{\csname ekvc@split@\the\ekvc@keycount\endcsname}%
\unexpanded\expandafter{\ekvc@initials{}#2}%
@@ -1047,7 +1075,7 @@ and the derived files expkv-cs.pdf
\ekvc@SetupHashKeys{#3}%
\ekvc@any@long\edef#1##1%
{%
- \unexpanded{\ekvset}{\ekvc@set}{##1}%
+ \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}%
\unexpanded{\ekvc@hash@pack@argument}%
\unexpanded\expandafter{\ekvc@initials\ekvc@stop#2}%
}%
@@ -1386,7 +1414,11 @@ and the derived files expkv-cs.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ekvc@t@meta, \ekvc@t@nmeta, \ekvc@type@meta}
+% \begin{macro}[internal]
+% {
+% \ekvc@t@meta, \ekvc@t@nmeta,
+% \ekvc@type@meta, \ekvc@type@meta@a, \ekvc@type@meta@b
+% }
% The |meta| and |nmeta| key types use a nested |\ekvset| to set other keys in
% the same macro's \set.
% \begin{macrocode}
@@ -1403,9 +1435,17 @@ and the derived files expkv-cs.pdf
}
\protected\long\def\ekvc@type@meta#1#2#3#4#5#6%
{%
- #2\def\ekvc@tmp#3{\ekvset{#1}{#6}}%
+ \expandafter\ekvc@type@meta@a\expandafter{\ekvset{#1}{#6}}{#2}{#3}%
#4\ekvc@set{#5}\ekvc@tmp
}
+\protected\def\ekvc@type@meta@a
+ {%
+ \expandafter\ekvc@type@meta@b\expandafter
+ }
+\protected\long\def\ekvc@type@meta@b#1#2#3%
+ {%
+ #2\def\ekvc@tmp#3{#1}%
+ }
% \end{macrocode}
% \end{macro}
%