diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex | 544 |
1 files changed, 308 insertions, 236 deletions
diff --git a/Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex b/Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex index 709b36b5496..9c517aa289a 100644 --- a/Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex +++ b/Master/texmf-dist/tex/latex/skeyval/skeyval-core.tex @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'skeyval-core.tex', version 1.2, 2013/02/10. % +% This is file 'skeyval-core.tex', version 1.3, 2013/05/15. % % % % This package and accompanying files may be distributed and/or % % modified under the conditions of the LaTeX Project Public License, % @@ -18,10 +18,11 @@ % The following files constitute the skeyval bundle and must be % % distributed as a whole: % % % -% readme, skeyval.sty, skeyval-core.tex, skeyval-for.tex, % +% README, skeyval.sty, skeyval-core.tex, skeyval-for.tex, % % skeyval-view.sty, skeyval-ltxpatch.sty, skeyval-ltxcmds.tex, % % skeyval-pstkey.sty, skeyval-pstkey.tex, skeyval-testclass.cls, % -% and skeyval-testpkg.sty. % +% skeyval-testpkg.sty, skeyval-pokayoke1, skeyval-pokayoke2, % +% skeyval-view-pokayoke1. % % % % Copyright (c) 2010-2013 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% @@ -87,13 +88,13 @@ \newif\ifskv@tempst \ifx\ProvidesFile\@undefined \skv@latexfalse - \message{File 'skeyval-core.tex' 2013/02/10 v1.2: + \message{File 'skeyval-core.tex' 2013/05/15 v1.3: Core of 'skeyval' key-value parser (AM)} \input skeyval-ltxcmds \else \skv@latextrue \ProvidesFile{skeyval-core.tex} - [2013/02/10 v1.2 Base file of skeyval package (AM)] + [2013/05/15 v1.3 Base file of skeyval package (AM)] \@addtofilelist{skeyval-core.tex} \long\def\@nodocument#1{% \@latex@error{'#1' appeared\on@line\space without @@ -207,13 +208,14 @@ }% } \let\skvnewregisters\skvnewregister -\skvnewregisters\toks{\skv@toksa,\skv@toksb} +\skvnewregisters\toks{\skv@temptoks,\skv@toksa} % Sometimes we change \bgroup temporarily to avoid \futurelet confusing % it with explicit \bgroup character. The change does confuse \skvifnextchar % if we used \bgroup in \skvifnextchar. Hence let us use \skv@orig@bgroup % in \skvifnextchar: \let\skv@orig@bgroup\bgroup +\let\skv@orig@egroup\egroup \def\reserved@a#1{% \def\skvifnextisouter{% @@ -264,7 +266,7 @@ }{% % Test for \egroup, so that, eg, {\loggingall\LoadClass{article}} % doesn't fail because of the closing brace: - \skvsimpleifnextchar\egroup{% + \skvsimpleifnextchar\skv@orig@egroup{% \skvsimpleifnextchar{#1}{#2}{#3}% }{% \skvifnextisouter{% @@ -430,6 +432,9 @@ \skvnewdef\skvafterelseii#1\else#2\fi{\fi#2} \skvnewdef*\skv@simplearg{##1} \skvnewlet\skvsanitizemacro\@onelevel@sanitize +% \skvaddtotoks{<token register>}{<token to add>} +\skvrobustdef*\skvaddtotoks#1#2{#1\expandafter{\the#1#2}} +\skvrobustdef*\skvoaddtotoks#1#2{#1\expandafter{\the\expandafter#1#2}} \skvrobustdef*\skv@usetempst#1#2{% \edef#2{\skvifdefboolTF{skv@tempst}\skvexpandonce\unexpanded{#1}}% } @@ -668,14 +673,27 @@ \skv@err{Invalid boolean value '#1'; expected 'true' or 'false'}\skv@ehd } +% Switches have values of either 00 or 01. + +% \skvifknobTF, unlike \skvifswitchTF, is for use with plain switches, +% ie, switches that have no separate namespace. +\skvnewdef*\skvifknobTF#1{% + \if\@nameuse{#1}\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} +\skvnewdef*\skvifknobFT#1{% + \if\@nameuse{#1}\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi +} % Switches and toggles have separate namespaces. -\skvrobustdef*\skvnewswitch#1{% - \skvifcsdefTF{skv@switch@#1}{% - \skv@err{Switch '\detokenize{#1}' already exists}\skv@ehd - }{% - \skvcsdef{skv@switch@#1}{01}% +\skvrobustdef*\skvnewswitches#1{% + \skvcommaloop{#1}\skv@prova{% + \skvifcsdefTF{skv@switch@\skv@prova}{% + \skv@err{Switch '\skvoxdetok\skv@prova' already exists}\skv@ehd + }{% + \skvcsdef{skv@switch@\skv@prova}{01}% + }% }% } +\skvnewlet\skvnewswitch\skvnewswitches \skvnewdef*\skvifswitchTF#1{% \if \skvifcsdefTF{skv@switch@#1}{% @@ -704,13 +722,19 @@ }% } \skvrobustdef*\skvnewtog#1{% - \skvifcsdefTF{skv@toggle@#1}{% - \skv@err{Switch '\detokenize{#1}' already exists}\skv@ehd - }{% - \skvcslet{skv@toggle@#1}\@secondoftwo + \skvcommaloop{#1}\skv@prova{% + \skvifcsdefTF{skv@toggle@\skv@prova}{% + \skv@err{Switch '\skvoxdetok\skv@prova' already exists}\skv@ehd + }{% + \skvcslet{skv@toggle@\skv@prova}\@secondoftwo + }% + }% +} +\skvrobustdef*\skvdeftog#1{% + \skvcommaloop{#1}\skv@prova{% + \skvcslet{skv@toggle@\skv@prova}\@secondoftwo }% } -\skvrobustdef*\skvdeftog#1{\skvcslet{skv@toggle@#1}\@secondoftwo} \skvnewdef*\skviftogTF#1{% \skvifcsdefTF{skv@toggle@#1}{% \csname skv@toggle@#1\endcsname @@ -734,14 +758,7 @@ \skv@err{No toggle '\detokenize{#1}'}\skv@ehd }% } - -% plasw=plain switch (ie, 00 or 01). -\skvnewdef*\skvifplaswTF#1{% - \if#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi -} -\skvnewdef*\skvifplaswFT#1{% - \if#1\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi -} +% Allow 'f' to stop the search for number: \skvnewdef\skvifcondTF#1\fi{% \csname @#1first\else second\fi oftwo\endcsname } @@ -1239,7 +1256,39 @@ }% } \skvrobustdef*\skvifmacroFT#1{\skvifmacroTF{#1}\@secondoftwo\@firstoftwo} - +% Note: If there're more than 1 alpha/Alpha character, both \skvifloweralpha +% and \skvifupperalpha will return false. Hence double (or more) aphabetic +% characters can't be auto-completed by \skvautocompletelist. +\skvnewdef*\skvifloweralpha#1{% + \skvifblankTF{#1}{% + \@secondoftwo + }{% + \skvifntypeTF{#1}{% + \skvifnumTF`#1>96{% + \skvifnumTF`#1<123{\@firstoftwo}{\@secondoftwo}% + }{% + \@secondoftwo + }% + }{% + \@secondoftwo + }% + }% +} +\skvnewdef*\skvifupperalpha#1{% + \skvifblankTF{#1}{% + \@secondoftwo + }{% + \skvifntypeTF{#1}{% + \skvifnumTF`#1>64{% + \skvifnumTF`#1<91{\@firstoftwo}{\@secondoftwo}% + }{% + \@secondoftwo + }% + }{% + \@secondoftwo + }% + }% +} % If there is a digit present in #1: \skvnewdef*\skvifdigitpresentTF#1{% \skvifcondTF\if0\skvifblankTF{#1}{1}{\skv@ifdigitpresent#1\skv@nnil}\fi @@ -1383,26 +1432,6 @@ \fi } -% Test if a token #1 can be assigned to a \dimendef'd register. We assume -% that #1 isn't a complicated expression and isn't padded with trailing -% \relax's. A complicated expression will be something like -% -% 2pt+3ex-(3pt/4+1.45cc*3) -% -% which is much harder to parse and decide on. -% -% Examples: -% -% \skvifdimensionable{01}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{01pt}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{01abpt}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable\paperwidth{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{\skip0}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{1.2pt}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{1.2\relax pt}{\def\x{T}}{\def\x{F}} -% \skvifdimensionable{1pt\relax\skvrelax}{\def\x{T}}{\def\x{F}} -% - \skvnewregister\bool{\ifskv@isinteger} % In case the argument of \skvifintegerTF containes \numexpr: @@ -1435,6 +1464,26 @@ }% } \skvrobustdef\skvoifinteger{\skvexpbracenext\skvifintegerTF} + +% Test if a token #1 can be assigned to a \dimendef'd register. We assume +% that #1 isn't a complicated expression and isn't padded with trailing +% \relax's. A complicated expression will be something like +% +% 2pt+3ex-(3pt/4+1.45cc*3) +% +% which is much harder to parse and decide on. +% +% Examples: +% +% \skvifdimensionable{01}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{01pt}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{01abpt}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable\paperwidth{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{\skip0}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{1.2pt}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{1.2\relax pt}{\def\x{T}}{\def\x{F}} +% \skvifdimensionable{1pt\relax\skvrelax}{\def\x{T}}{\def\x{F}} +% \skvrobustdef\skvifdimensionable#1{% \def\skv@dimunit{}% % Does 'pt' mean 0pt or 1pt? Make it an invalid input: @@ -1609,11 +1658,11 @@ % The following \relax will not be cat-12, so it won't appear in #2: \def\skv@trim@a{% \skvxifinTF{\detokenize{#1}\relax}{\skvoxdetok{#2}\relax}{% - \def\skv@trim@b####1#1\normal@nil{% + \def\skv@trim@b####1#1\skv@normal@nil{% \edef#2{\unexpanded{####1}}% \skv@trim@a }% - \expandafter\skv@trim@b#2\normal@nil + \expandafter\skv@trim@b#2\skv@normal@nil }{}% }% \skv@trim@a @@ -1633,13 +1682,13 @@ % \edef\x{\skvtsvnormalize{ x y {z}}} \skvnewdef*\skvtsvnormalize#1{% \unexpanded\expandafter - {\romannumeral-`\q\skv@tsvnormalize.#1 \normal@nil}% + {\romannumeral-`\q\skv@tsvnormalize.#1 \skv@normal@nil}% } -\skvnewdef*\skv@tsvnormalize#1 #2\normal@nil{% +\skvnewdef*\skv@tsvnormalize#1 #2\skv@normal@nil{% \skvifblankTF{#2} {\expandafter\expandafter\expandafter\space \expandafter\noexpand\@gobble#1} - {\skv@tsvnormalize#1#2\normal@nil}% + {\skv@tsvnormalize#1#2\skv@normal@nil}% } @@ -1654,7 +1703,7 @@ }% \skv@prova csv\skvcsvnormalize kv\skvkvnormalize#1\skv@nnil\skv@nil } -\skvnewswitch{inkv} +\skvnewdef*\skv@switch@inkv{01} % \skvcsvnormalize[<parser>]<listcmd> \skvrobustdef*\skvcsvnormalize{\skv@testopt\skv@csvnormalize,} \skvrobustdef*\skv@csvnormalize[#1]#2{% @@ -1691,12 +1740,12 @@ % a trailing space or <parser> in #1. We remove the trailing space % with \skvtrimspace. \edef#1{\expandafter\skv@normalizelist\expandafter{#1\skv@kvguard}}% - \def\skv@kvnorm##1\skv@kvguard##2\normal@nil{% - \skv@parserequalerr##1##2,=\normal@nil + \def\skv@kvnorm##1\skv@kvguard##2\skv@normal@nil{% + \skv@parserequalerr##1##2,=\skv@normal@nil \edef#1{\skvtrimspace{##1##2}}% \skvtrimlastparser{,}#1% }% - \expandafter\skv@kvnorm#1\normal@nil + \expandafter\skv@kvnorm#1\skv@normal@nil \skvaftergroupdef#1\endgroup } @@ -1708,85 +1757,85 @@ \lowercase{\endgroup \def\skv@normalizelist##1{% \unexpanded\expandafter{\romannumeral-`\q - \skv@activeparser#1##1#1~\normal@nil}% + \skv@activeparser#1##1#1~\skv@normal@nil}% }% - \def\skv@activeparser##1~##2\normal@nil{% + \def\skv@activeparser##1~##2\skv@normal@nil{% \skvifblankTF{##2}{% \skvifdefswitchTF{inkv}{% - \skv@activeequal##1!\normal@nil + \skv@activeequal##1!\skv@normal@nil }{% - \skv@spaceparser##1 #1\normal@nil + \skv@spaceparser##1 #1\skv@normal@nil }% }{% - \skv@activeparser##1#1##2\normal@nil + \skv@activeparser##1#1##2\skv@normal@nil }% }% - \def\skv@activeequal##1!##2\normal@nil{% + \def\skv@activeequal##1!##2\skv@normal@nil{% \skvifblankTF{##2}{% - \skv@spaceparser##1 #1\normal@nil + \skv@spaceparser##1 #1\skv@normal@nil }{% - \skv@activeequal##1=##2\normal@nil + \skv@activeequal##1=##2\skv@normal@nil }% }% }% - \def\skv@spaceparser##1 #1##2\normal@nil{% + \def\skv@spaceparser##1 #1##2\skv@normal@nil{% \skvifblankTF{##2}{% - \skv@parserspace##1#1 \normal@nil + \skv@parserspace##1#1 \skv@normal@nil }{% - \skv@spaceparser##1#1##2\normal@nil + \skv@spaceparser##1#1##2\skv@normal@nil }% }% - \def\skv@parserspace##1#1 ##2\normal@nil{% + \def\skv@parserspace##1#1 ##2\skv@normal@nil{% \skvifblankTF{##2}{% \skvifdefswitchTF{inkv}{% - \skv@spaceequal##1 =\normal@nil + \skv@spaceequal##1 =\skv@normal@nil }{% - \skv@doubleparser##1#1#1\normal@nil + \skv@doubleparser##1#1#1\skv@normal@nil }% }{% - \skv@parserspace##1#1##2\normal@nil + \skv@parserspace##1#1##2\skv@normal@nil }% }% - \def\skv@spaceequal##1 =##2\normal@nil{% + \def\skv@spaceequal##1 =##2\skv@normal@nil{% \skvifblankTF{##2}{% - \skv@equalspace##1= \normal@nil + \skv@equalspace##1= \skv@normal@nil }{% - \skv@spaceequal##1=##2\normal@nil + \skv@spaceequal##1=##2\skv@normal@nil }% }% - \def\skv@equalspace##1= ##2\normal@nil{% + \def\skv@equalspace##1= ##2\skv@normal@nil{% \skvifblankTF{##2}{% - \skv@doubleparser##1#1#1\normal@nil + \skv@doubleparser##1#1#1\skv@normal@nil }{% - \skv@equalspace##1=##2\normal@nil + \skv@equalspace##1=##2\skv@normal@nil }% }% - \def\skv@doubleparser##1#1#1##2\normal@nil{% + \def\skv@doubleparser##1#1#1##2\skv@normal@nil{% \skvifblankTF{##2}{% \skvifdefswitchTF{inkv}{% - \skv@doubleequal##1==\normal@nil + \skv@doubleequal##1==\skv@normal@nil }{% \skvifblankTF{##1}{}{% - \skv@remleadparser##1\normal@nil + \skv@remleadparser##1\skv@normal@nil }% }% }{% - \skv@doubleparser##1#1##2\normal@nil + \skv@doubleparser##1#1##2\skv@normal@nil }% }% - \def\skv@doubleequal##1==##2\normal@nil{% + \def\skv@doubleequal##1==##2\skv@normal@nil{% \skvifblankTF{##2}{% \skvifblankTF{##1}{}{% - \skv@remleadparser##1\normal@nil + \skv@remleadparser##1\skv@normal@nil }% }{% - \skv@doubleequal##1=##2\normal@nil + \skv@doubleequal##1=##2\skv@normal@nil }% }% - \def\skv@remleadparser#1##1\normal@nil{% + \def\skv@remleadparser#1##1\skv@normal@nil{% \expandafter\space\noexpand##1% }% - \def\skv@parserequalerr##1#1=##2\normal@nil{% + \def\skv@parserequalerr##1#1=##2\skv@normal@nil{% \skvifblankTF{##2}{}{% \skv@err{There is '#1=' in your key-value list}\skv@ehd }% @@ -1794,33 +1843,39 @@ } \endgroup -% Special slash normalizer, which doesn't replace double slashes with -% single slash, because a double slash might mean an intentionally +% Define a special parser normalizer that doesn't replace double parsers +% with single parser, because a double parser might mean an intentionally % missing token/property of a key: \begingroup -\catcode`\~=13 \uccode`\~=`\/ -\uppercase{\endgroup - \skvnewdef\skvkeepdoubleslashnormalize#1{% - \unexpanded\expandafter{\romannumeral-`\q - \skv@activeslash#1~\normal@nil}% +\catcode`\~=13 +\skvrobustgdef*\skvdefinekeepdoubleparsernormalizer#1#2{% + \begingroup + \uccode`\~=`#1 + \uppercase{\endgroup + \long\def#2##1{% + \unexpanded\expandafter{\romannumeral-`\q + \skv@keepdouble@activeparser##1~\skv@normal@nil}% + }% + \long\def\skv@keepdouble@activeparser##1~##2\skv@normal@nil{% + \skvifblankTF{##2} + {\skv@keepdouble@spaceparser##1 #1\skv@normal@nil} + {\skv@keepdouble@activeparser##1#1##2\skv@normal@nil}% + }% }% - \skvnewdef\skv@activeslash#1~#2\normal@nil{% - \skvifblankTF{#2} - {\skv@spaceslash#1 /\normal@nil} - {\skv@activeslash#1/#2\normal@nil}% + \long\def\skv@keepdouble@spaceparser##1 #1##2\skv@normal@nil{% + \skvifblankTF{##2} + {\skv@keepdouble@parserspace##1#1 \skv@normal@nil} + {\skv@keepdouble@spaceparser##1#1##2\skv@normal@nil}% + }% + \long\def\skv@keepdouble@parserspace##1#1 ##2\skv@normal@nil{% + \skvifblankTF{##2} + {\skvifblankTF{##1}{}{\expandafter\space\noexpand##1}} + {\skv@keepdouble@parserspace##1#1##2\skv@normal@nil}% }% } -\skvnewdef\skv@spaceslash#1 /#2\normal@nil{% - \skvifblankTF{#2} - {\skv@slashspace#1/ \normal@nil} - {\skv@spaceslash#1/#2\normal@nil}% -} -\skvnewdef\skv@slashspace#1/ #2\normal@nil{% - \skvifblankTF{#2} - {\skvifblankTF{#1}{}{\expandafter\space\noexpand#1}} - {\skv@slashspace#1/#2\normal@nil}% -} +\endgroup +\skvdefinekeepdoubleparsernormalizer{/}\skvkeepdoubleslashnormalize % \skvmacnormalize[<parser>]<listcmd> \skvrobustdef*\skvmacnormalize{\skv@testopt\skv@macnormalize,} @@ -1833,27 +1888,30 @@ % This is for normalizing lists like {x\\ y\\\\ z}, where \\ is % a control sequence. Such parsers may be commands but we don't % expect them to be active characters. +% % Example: +% % \skvsetupmacroparsernormalizer{\\} % \edef\x{\skvmacroparsernormalize{x\\ y\\\\ z}} +% \skvrobustdef*\skvsetupmacroparsernormalizer#1{% \long\def\skvmacroparsernormalize##1{% \unexpanded\expandafter{\romannumeral-`\q - \skv@mac@spaceparser##1 #1\normal@nil}% + \skv@mac@spaceparser##1 #1\skv@normal@nil}% }% - \long\def\skv@mac@spaceparser##1 #1##2\normal@nil{% + \long\def\skv@mac@spaceparser##1 #1##2\skv@normal@nil{% \skvifblankTF{##2} - {\skv@mac@parserspace##1#1 \normal@nil} - {\skv@mac@spaceparser##1#1##2\normal@nil}% + {\skv@mac@parserspace##1#1 \skv@normal@nil} + {\skv@mac@spaceparser##1#1##2\skv@normal@nil}% }% - \long\def\skv@mac@parserspace##1#1 ##2\normal@nil{% + \long\def\skv@mac@parserspace##1#1 ##2\skv@normal@nil{% \skvifblankTF{##2} - {\skv@mac@doubleparser##1#1#1\normal@nil} - {\skv@mac@parserspace##1#1##2\normal@nil}% + {\skv@mac@doubleparser##1#1#1\skv@normal@nil} + {\skv@mac@parserspace##1#1##2\skv@normal@nil}% }% - \long\def\skv@mac@doubleparser##1#1#1##2\normal@nil{% + \long\def\skv@mac@doubleparser##1#1#1##2\skv@normal@nil{% \skvifblankTF{##2}{ ##1} - {\skv@mac@doubleparser##1#1##2\normal@nil}% + {\skv@mac@doubleparser##1#1##2\skv@normal@nil}% }% } % \skvletmanytocmd{<cmd list>}{<cmd>} @@ -2036,8 +2094,8 @@ % \skvnewbools[skv@]{% inclass,inset,viarootofsetkeys,processvalueaslist,st,cl,pl,kf,inpox,inopt,% - inprepo,tracingkeys,swa,swb,verbose,intry,insa,success,inoptionsec,% - inreservedhandler,ignorepointers% + inprepo,tracingkeys,tempsw,swa,verbose,intry,insa,success,inoptionsec,% + inreservedhandler,ignorepointers,addslots@appending% } \skvnewbools{indirectkeys} @@ -2095,8 +2153,8 @@ % A fast key parsing scheme originally designed for \newforeach loop. % -% \quickkeys.define{<family>}[<hp>]{<list>} -% \quickkeys.set{<family>}[<na>]{<kvlist>} +% \skvquickkeys.define{<family>}[<hp>]{<list>} +% \skvquickkeys.set{<family>}[<na>]{<kvlist>} % % 1. Quickly define and set command/store keys. % 2. Pointers aren't used here, to speed up parsing. Use other key @@ -2118,7 +2176,7 @@ % The default parser is semicolon (;). % % Example: -% \quickkeys.define{fam}[mp@]{% +% \skvquickkeys.define{fam}[mp@]{% % keya/true/\def\x##1{#1*##1}/true,false; % keyb; % keyc,keyd/aaa+bbb/\def\x##1{#1*##1*#2}/.na/#1+#2; @@ -2188,7 +2246,7 @@ } \skvrobustdef*\skvsetquickkeysparser{\def\skv@qkeysparser} \skvsetquickkeysparser{;} -\skvrobustdef*\quickkeys#1#{% +\skvrobustdef*\skvquickkeys#1#{% \edef\skv@tempa{\skvtrimspace{#1}}% \skvxifstrcmpTF{\skvexpandonce\skv@tempa}{.define}{% \begingroup\endlinechar\m@ne @@ -2200,7 +2258,7 @@ \skvxifstrcmpTF{\skvexpandonce\skv@tempa}{.preset}{% \skv@presetquickkeys }{% - \skv@err{Unknown task for \string\quickkeys}\skv@ehd + \skv@err{Unknown task for \string\skvquickkeys}\skv@ehd }% }% }% @@ -2239,7 +2297,7 @@ }% } -% \quickkeys.preset{<family>}{<kvlist>} +% \skvquickkeys.preset{<family>}{<kvlist>} % \skvrobustdef*\skv@presetquickkeys#1#2{% \edef\skv@prova{\unexpanded{#2}}% @@ -2249,7 +2307,7 @@ \skvnewnumbers[skv@]{setqkeysdepth} -% \quickkeys.set{<family>}[<na>]{<kvlist>} +% \skvquickkeys.set{<family>}[<na>]{<kvlist>} \skvrobustdef*\skv@setquickkeys#1{\skv@testopt{\skv@setquickkeys@a{#1}}{}} \skvrobustdef*\skv@setquickkeys@a#1[#2]#3{% @@ -2280,8 +2338,8 @@ \skvletcs\skv@tempval{\skv@qkeysfam/##1/qkeys.val}% \skvletcs\reserved@a{\skv@qkeysfam/##1/qkeys.chc}% \skvifdefTF\reserved@a{% - \skvxifinTF{,\detokenize{##2},}{,\skvoxdetok\reserved@a,}{}{% - \skv@err{Value '\detokenize{##2}' for key '##1' + \skvxifinTF{,\skvoxdetok\skv@tempval,}{,\skvoxdetok\reserved@a,}{}{% + \skv@err{Value '\skvoxdetok\skv@tempval' for key '##1' \MessageBreak is not in prescribed list \MessageBreak '\skvoxdetok\reserved@a'}\skv@ehd }% @@ -2323,16 +2381,16 @@ } \skvnewlet\skv@sav@setquickkeys@a\skv@setquickkeys@a \skvrobustdef*\skv@bad@setquickkeys@a{% - \skv@err{'\string\quickkeys.set' can't be nested in a preset + \skv@err{'\string\skvquickkeys.set' can't be nested in a preset \MessageBreak key's callback: this will cause a cyclic call - \MessageBreak to '\string\quickkeys.set'}\skv@ehd + \MessageBreak to '\string\skvquickkeys.set'}\skv@ehd } -% \skvinitializeqkeys{<fam>}[<na>]{<kvlist>} -\skvrobustdef*\skvinitializeqkeys#1{% - \skv@testopt{\skv@initializeqkeys@a{#1}}{}% +% \skvinitializequickkeys{<fam>}[<na>]{<kvlist>} +\skvrobustdef*\skvinitializequickkeys#1{% + \skv@testopt{\skv@initializequickkeys@a{#1}}{}% } -\skvrobustdef*\skv@initializeqkeys@a#1[#2]#3{% +\skvrobustdef*\skv@initializequickkeys@a#1[#2]#3{% \skvindeftrue \skv@setquickkeys{#1}[#2]{#3}% \skvindeffalse @@ -2575,12 +2633,10 @@ \do\ifindirectkeys\do\ifskvdfk@initialize\do\ifskvdfk@saveinitialvalues }\skv@stackdepthlimit -\skvrobustdef\skvappto#1#2{% - \edef#1{\skvexpandonce{#1}\unexpanded{#2}}% -} -\skvrobustdef\skvgappto#1#2{% - \xdef#1{\skvexpandonce{#1}\unexpanded{#2}}% -} +\skvrobustdef\skvappto#1#2{\edef#1{\skvexpandonce{#1}\unexpanded{#2}}} +\skvrobustdef\skvxappto#1#2{\edef#1{\skvexpandonce{#1}#2}} +\skvrobustdef\skvgappto#1#2{\xdef#1{\skvexpandonce{#1}\unexpanded{#2}}} +\skvrobustdef\skvxgappto#1#2{\xdef#1{\skvexpandonce{#1}#2}} \skvrobustdef\skvappendtomacro{\skv@testst{\skv@appendtomacro{app}{e}}} \skvrobustdef\skvgappendtomacro{\skv@testst{\skv@appendtomacro{app}{x}}} \skvrobustdef\skvprependtomacro{\skv@testst{\skv@appendtomacro{pre}{e}}} @@ -3223,7 +3279,7 @@ % Assign arguments to keys: % -% \skvassignargs[<prefixes>]{<families>}[<expansion.type>]{<keys>}{<arg>} +% \skvassignargs[<prefixes>]{<families>}{<keys>}{.<expansion type>{<arg>}} % % 1. Valid expansion types are .expand once, .expand twice, .expanded. % 2. At set keys (not at define keys), the argument to the listed keys will @@ -3236,40 +3292,52 @@ % % Example: % -% \skvassignargs[KV1,KV2]{fam1,fam2}[.expand once]{keya,keyb}{#1/#2} +% \skvassignargs[KV1,KV2]{fam1,fam2}{keya,keyb}{.expanded{#1/#2}} % % The keys could then be set as % -% \skvsetkeys[KV1]{fam2}{keya=vala/valb} +% \skvsetkeys[KV1]{fam2}{keya=\vala/\valb} % % For each prefix and family, this will define parameterless functions % -% \<prefix>/<family>/<key>.@x1arg. +% \<prefix>/<family>/<key>.@xxarg. % % which will be used at setkeys to define and execute the key's callback. % \skvrobustdef*\skvassignargs{\skv@testopt\skv@assignargs\skvdefaultprefix} -\skvrobustdef*\skv@assignargs[#1]#2{% +\skvrobustdef*\skv@assignargs[#1]#2#3#4{% \begingroup - \skv@testopt{\skv@assignargs@a{#1}{#2}}{^skv^}% -} -\skvrobustdef*\skv@assignargs@a#1#2[#3]#4#5{% - \edef\skv@tempb{\skvtrimspace{#5}}% - \def\skv@tempc{}% - \skvifstrcmpTF{#3}{^skv^}{% - \def\skvexpander{x0}% - }{% - \skv@getexpander@a{#3}\skvexpander + \let\skv@temparg\skv@simplearg + \def\skv@expandertype{x0}% + \edef\skv@tempa{\skvtrimspace{#4}}% + \def\do##1##2{% + \ifx\do##1\else + \skvxifinTF{\detokenize{##1}}{\skvoxdetok\skv@tempa}{% + \def\skv@prova####1##1####2####3\skv@arg@nil{% + \edef\skv@temparg{\unexpanded{####2}}% + \def\skv@expandertype{##2}% + }% + \expandafter\skv@prova\skv@tempa\skv@arg@nil + \def\do####1\do\do{}% + }{}% + \expandafter\do + \fi }% + \do{.unexpanded}{x0}{.expand once}{x1}{.expand twice}{x2}% + {.expanded}{xx}{.expand}{xx}\do\do + \def\skv@tempc{}% + % Loop over prefixes: \skvcommaparse{#1}\skv@tempa{% \skv@makeprefix\skv@tempa + % Loop over families: \skvcommaparse{#2}\skv@tempa{% \skv@makeheader\skv@tempa - \skvcommaparse{#4}\skv@tempa{% + % Loop over keys: + \skvcommaparse{#3}\skv@tempa{% \edef\skv@tempc{% \skvexpandonce\skv@tempc - \skvcsedef{\skv@header\skv@tempa.@\skvexpander arg}{% - \noexpand\unexpanded{\skvexpandonce\skv@tempb}% + \skvcsedef{\skv@header\skv@tempa.@\skv@expandertype arg}{% + \noexpand\unexpanded{\skvexpandonce\skv@temparg}% }% }% }% @@ -3277,37 +3345,15 @@ }% \expandafter\endgroup\skv@tempc } - -% \skv@getexpander@a{<expander.type>}{<return.cmd>} -% -% 1. <return.cmd> will contain one of 'x0', 'x1', 'x2', 'xx', which will be -% saved in a key-dependent macro that represents the key's argument. -% -\skvrobustdef*\skv@getexpander@a#1#2{% - \begingroup - \edef\skv@prova{\skvotrimspace{#1}}% - \def\skv@provb##1{% - \def\skv@provb####1##1####2####3\skv@nil{% - \endgroup - \def#2{####2}% - \ifx#2\@nnil - \skv@err{Unknown expansion type '\detokenize{##1}'}\skv@ehd - \fi - }% - \skv@provb .expand once{x1},.expand twice{x2},.expanded{xx},% - .expand{xx},##1{\@nil}\skv@nil - }% - \expandafter\skv@provb\expandafter{\skv@prova}% -} -% \skv@getexpander@b{<expander.type>} +% \skv@getexpander{<expander.type>} % % 1. <expander.type> is one of 'x0', 'x1', 'x2', 'xx', which had been % saved in a key-dependent macro. % -% 2. \skv@getexpander@b returns macro \skvexpander, which will +% 2. \skv@getexpander returns macro \skvexpander, which will % contain one of \unexpanded, \skvexpandonce, \skvexpandtwice, \@iden. % -\skvrobustdef*\skv@getexpander@b#1{% +\skvrobustdef*\skv@getexpander#1{% \begingroup \edef\skv@prova{\skvtrimspace{#1}}% \def\skv@provb##1{% @@ -3670,13 +3716,13 @@ % % The skeyval package allows holder-macro prefixes {<mp>} for choice keys. % -% \skvchoicekey[<pref>]{<fam>}[<mp>]{<key>}[<bins>]{<choices>} +% \skvchoicekey[<pref>]{<fam>}[<mp>]{<keys>}[<bins>]{<choices>} % [<default>]{<callback>} -% \skvchoicekey+[<pref>]{<fam>}[<mp>]{<key>}[<bins>]{<choices>} +% \skvchoicekey+[<pref>]{<fam>}[<mp>]{<keys>}[<bins>]{<choices>} % [<default>]{<callback>}{<fallback>} -% \skvchoicekey*[<pref>]{<fam>}[<mp>]{<key>}[<bins>]{<choices>} +% \skvchoicekey*[<pref>]{<fam>}[<mp>]{<keys>}[<bins>]{<choices>} % [<default>]{<callback>} -% \skvchoicekey*+[<pref>]{<fam>}[<mp>]{<key>}[<bins>]{<choices>} +% \skvchoicekey*+[<pref>]{<fam>}[<mp>]{<keys>}[<bins>]{<choices>} % [<default>]{<callback>}{<fallback>} % % \skvchoicekeys[KV]{fam}[mp@]{key1,key2}[\val\nr]{% @@ -3715,7 +3761,7 @@ \skvcmdexit\skv@altlista\skvcmdexit\skv@altlistb }% } -% \skv@executechoice{00.or.01}{<currentvalue>}{<altlist>} +% \skv@executechoice{00 or 01}{<currentvalue>}{<altlist>} \skvrobustdef*\skv@executechoice#1#2#3{% \begingroup \if#1\lowercase{\fi @@ -3786,7 +3832,7 @@ \skvrobustdef*\skv@choicekey@c[#1]{% \edef\skv@default{\skvtrimspace{#1}}% % Choice can't have braced values, since that will make matching - % to state pattern difficult: + % to the state pattern difficult or impossible: \skvstripouterbraces{2}\skv@default \skvifdefboolTF{skv@pl}\skv@choicekey@e\skv@choicekey@d } @@ -3816,7 +3862,7 @@ \ifx\skv@bins\@empty\else[\skvxonce\skv@bins]\fi {##1}{\skvxonce\skv@altlista}##2% }% - \skv@toksa\expandafter{\skv@prova{##1}{#1}}% + \skv@temptoks\expandafter{\skv@prova{##1}{#1}}% % Why separate \skv@choicekey@g? It is needed by skeyval-view.sty: \skv@choicekey@g } @@ -3831,7 +3877,7 @@ \fi \skvcsedef{\skv@header\skvcurrentkey.@cbk}{% \skvcslet{\skv@hp\skvcurrentkey}\noexpand\skvcurrentvalue - \the\skv@toksa + \the\skv@temptoks }% }% } @@ -3875,7 +3921,7 @@ % \skv@boolkey@a{<key>}{<mp.key>}{<default>}{<callback>} \skvrobustdef*\skv@boolkey@a#1#2#3#4{% \def\skv@tempa{\skv@boolkey@c{#1}{#2}{#3}}% - \skvifplaswTF\skv@typetogkey{% + \skvifknobTF{skv@typetogkey}{% \expandafter\skv@tempa\expandafter{\expandafter{\expandafter \skv@togkey@settog\expandafter{\skv@zapsw}{#2}\skv@value#4}}% }{% @@ -3887,7 +3933,7 @@ % \skv@boolkey@b{<key>}{<mp.key>}{<default>}{<callback>}{<fallback>} \skvrobustdef*\skv@boolkey@b#1#2#3#4#5{% \def\skv@tempa{\skv@boolkey@c{#1}{#2}{#3}}% - \skvifplaswTF\skv@typetogkey{% + \skvifknobTF{skv@typetogkey}{% \expandafter\skv@tempa\expandafter{\expandafter{\expandafter \skv@togkey@settog\expandafter{\skv@zapsw}{#2}\skv@value#4}{#5}}% }{% @@ -3909,8 +3955,8 @@ \ifskv@pl\noexpand\skv@pltrue\else\noexpand\skv@plfalse\fi \skv@checkchoice[\noexpand\skv@value]{##1}{true,false}##2% }% - \skv@toksa\expandafter{\skv@tempa{##1}{#4}}% - \skvcsedef{\skv@header#1.@cbk}{\the\skv@toksa}% + \skv@temptoks\expandafter{\skv@tempa{##1}{#4}}% + \skvcsedef{\skv@header#1.@cbk}{\the\skv@temptoks}% } % % \skvboolkeys[<pref>]{<fam>}[<mp>]{<keys>}[<defa>]{<callback>} @@ -4168,14 +4214,20 @@ % \skvprependslots[<pref>]{<fam>}{<signal.keys>}{<slots>} % [<signal default>]{<signal callback>} % +% Example: +% +% \skvordkeys[KV]{fam}{keya,keyb}{\def\x##1{#1*##1}} +% \skvappendslots[KV]{fam}{keyd,keye}{keya=.expanded{\vala},keyb=valb} +% [def-d&e]{\def\y##1{#1*##1}} +% % 1. <slots> must pre-exist. If slot key is undefined, then the signal-slot % system isn't useful here since the slot will serve no purpose. % % 2. If desired, use pointers/handlers .expanded, .expand once, .expand twice % on values of <slots>. % -% 3. Here, it helps to consider <keys> as parents (or signals or -% subjects) and <slots> as children (or slots or observers). +% 3. Here, it helps to consider <signal.keys> as parents (or signals/ +% subjects/observables) and <slots> as children (or slots/observers). % % 4. <signal.keys> can't be preset, to avoid cyclic setting of keys. % Consider the following, for a signal key in the preset list: @@ -4186,12 +4238,20 @@ % In the attempt to set a slot key, the preset list (that includes % the signal key) will be instantiated. % -% Example: -% -% \skvordkeys[KV]{fam}{keya,keyb}{\def\x##1{#1*##1}} -% \skvappendslots[KV]{fam}{keyd,keye}{keya=.expanded{\vala},keyb=valb} -% [def-d&e]{\def\y##1{#1*##1}} -% +\AtEndOfPackage{% + \skvnewcastcommands{% + \skvslotkeys=\skvappendslots,\skvstylekeys=\skvappendslots, + \skvprependstyles=\skvprependslots, + \skvappendstylesexpanded=\skvappendslotsexpanded, + \skvprependstylesexpanded=\skvprependslotsexpanded, + \skvaddstyles=\skvaddslots, + \skvobserverkeys=\skvappendslots, + \skvprependobservers=\skvprependslots, + \skvappendobserversexpanded=\skvappendslotsexpanded, + \skvprependobserversexpanded=\skvprependslotsexpanded, + \skvaddobservers=\skvaddslots + }% +} \skvrobustdef*\skvappendslots{% \def\skv@type{app}% \let\skvexpanderpointer\@iden @@ -4261,10 +4321,10 @@ {\skvcurrentfamily}{\skvexpandonce\skv@slotlist}% }% }% - % The signal key might already exists, especially when calling + % The signal key might already exists, especially when using % \skvaddslots: \edef\elt{% - \skvifcsdefTF{\skv@header#1.@cbk} + \skvifcsdefTF{\skv@header#1.@cbk}% {\skvexpandcsonce{\skv@header#1.@cbk}}{}% }% \skvcsedef{\skv@header#1.@cbk}{% @@ -4283,6 +4343,7 @@ % (ie, subject) keys. % % Examples: +% % \skvordkeys[KV]{fam}{keya1,keyb1,keya2,keyb2}{\def\x##1{#1*##1}} % \skvaddslots[KV]{fam}{keyd,keye}{keya1=vala,keyb1=valb} % {keya2=vala,keyb2=.expanded{\valb}}[def-d&e]{\def\y##1{#1*##1}} @@ -4305,22 +4366,16 @@ \skvexpanded{% \skvprependslots[\skvcurrentprefix]{\skvcurrentfamily}% \unexpanded{{#1}{#2}[#4]{#5}}% + % Without \ifskv@addslots@appending, when using \skvaddslots, + % signal keys will otherwise be added in the database twice + % (while treating prepended and appended slots). + \noexpand\skv@addslots@appendingtrue \skvappendslots[\skvcurrentprefix]{\skvcurrentfamily}% \unexpanded{{#1}{#3}[#4]{#5}}% + \noexpand\skv@addslots@appendingfalse }% } -\skvnewcastcommands{% - \skvslotkeys=\skvappendslots,\skvstylekeys=\skvappendslots, - \skvprependstyles=\skvprependslots, - \skvappendstylesexpanded=\skvappendslotsexpanded, - \skvprependstylesexpanded=\skvprependslotsexpanded, - \skvaddstyles=\skvaddslots, - \skvobserverkeys=\skvappendslots, - \skvprependobservers=\skvprependslots, - \skvappendobserversexpanded=\skvappendslotsexpanded, - \skvprependobserversexpanded=\skvprependslotsexpanded, - \skvaddobservers=\skvaddslots -} + % Checking the admissible values of keys: % \skvrobustdef*\skvcheckchoice{\skv@testopta{\skv@testopt\skv@checkchoice{}}} @@ -4356,7 +4411,7 @@ \else \def\skv@tempa{\endgroup\def#1{#2}}% \fi - \skvifinTF{,#2,}{,#3,}{% + \skvxifinTF{,\detokenize{#2},}{,\detokenize{#3},}{% \ifskv@pl \skvappendtomacro\skv@tempa{\@firstoftwo}% \else @@ -4521,9 +4576,15 @@ \skvifcsdefTF{\skvcurrentpath/\skvtrimspace{#1}.@cbk}% } \skvnewlet\skvifkeyoncurrentpathTF\skvifkeyincurrentfamilyTF + % \skvifonekeyinfamilyTF{<prefix>/<family>}{<keys>} +% % Given a list of keys, test if at least one of them is defined. -% Example: \edef\x{\skvifonekeyinfamilyTF{KV/fam}{keya,keyb,keyc}{T}{F}}. +% +% Example: +% +% \edef\x{\skvifonekeyinfamilyTF{KV/fam}{keya,keyb,keyc}{T}{F}}. +% \skvnewdef*\skvifonekeyinfamilyTF#1#2{% \ifnum\numexpr0\skv@ifonekeydef{#1}#2,\@nnil,>\skvz@ \expandafter\@firstoftwo @@ -4546,6 +4607,7 @@ % 1. Get keys defined on the given paths. % 2. Remove any redundant star (*) and plus (+) suffix on % \skvgetdefinedkeys. +% \skvrobustdef*\skvgetdefinedkeys{% \skv@testopta{\skv@testopt\skv@getdefinedkeys\skvdefaultprefix}% } @@ -4713,20 +4775,20 @@ \skvdisabledkeysmessagetype{warn} \skvrobustdef*\skvdisablekeys{% - \def\skv@tempa{\skv@ordkey@a{e}}% + \def\skv@disable@temp{\skv@ordkey@a{e}}% \skv@testoptb\skv@disablekeys } \skvrobustdef*\skvgdisablekeys{% - \def\skv@tempa{\skv@ordkey@a{x}}% + \def\skv@disable@temp{\skv@ordkey@a{x}}% \skv@testoptb\skv@disablekeys } \skvrobustdef*\skv@disablekeys#1{% \skvcommaparse{#1}\skv@prova{% - \skvifcsdefTF{\skv@header\skv@prova.@cbk}{% - \skvifcsdefTF{\skv@header\skv@prova.@defa}{% - \edef\skv@provb{\noexpand\skv@tempa{\skv@prova}[]}% + \skvifnamedefTF{\skv@header\skv@prova.@cbk}{% + \skvifnamedefTF{\skv@header\skv@prova.@defa}{% + \edef\skv@provb{\noexpand\skv@disable@temp{\skv@prova}[]}% }{% - \edef\skv@provb{\noexpand\skv@tempa{\skv@prova}[^skv^]}% + \edef\skv@provb{\noexpand\skv@disable@temp{\skv@prova}[^skv^]}% }% \expandafter\skv@provb\expandafter{\expandafter \skv@disabledkeymsg\expandafter{\skv@prova}}% @@ -4735,6 +4797,7 @@ \MessageBreak couldn't be disabled}\skv@ehd }% }% + \skvundef\skv@disable@temp } % We split xkeyval's \presetkeys (which has both head and tail) into @@ -5215,7 +5278,7 @@ }% % ##1=value: \def\skv@prova##1=##2\skv@setkeys@nil{% - \skvifplaswTF\skv@ispntkey{% + \skvifknobTF{skv@ispntkey}{% % \skv@extractpntkey@atsetkey would have extracted key name and % value for the pntkey. }{% @@ -5240,7 +5303,7 @@ \fi \fi \skvifdefboolTF{skv@processvalueaslist}{% - % You can use the pointer '.process list' on the current value to + % You can use the pointer '.process list', etc, on the current value to % signify that the value be processed as a list, in the % manner of a list key. This scheme is costlier than defining the % key as a listkey, using \skvlistkey, but it is more versatile. @@ -5413,11 +5476,15 @@ }% \skvletcs\skv@callback{\skv@header\skvcurrentkey.@cbk}% \skv@getargpattern + \edef\skv@callback{% + \let\noexpand\this\noexpand\skvcurrentkey + \skvexpandonce\skv@callback + }% % 1. Strip outer braces of \skvcurrentvalue, so that the argument can be % grabbed by the, possibly multi-parametered, callback function. % 2. The argument has been obtained from possible explicit definition % of the argument. But if the obtained argument is simple, then the - % argument in the key's call maybe more complex: + % argument in the key's call may be more complex: \ifx\skv@argpattern\skv@simplearg\else \ifcsname\skv@header\skvcurrentkey.@listkey\endcsname \skv@err{A listkey must have a one-parameter argument}\skv@ehd @@ -5773,7 +5840,7 @@ \edef\skv@itemfour{\unexpanded{##4}}% \edef\skv@itemfive{\unexpanded{##5}}% \edef\skv@itemsix{\unexpanded{##6}}% - \skvifplaswTF\skv@isarg{% + \skvifknobTF{skv@isarg}{% \skvdfk@definearg{##1}{##2}{##3}% }{% \if\skv@checkkeyexist @@ -6102,13 +6169,13 @@ \skvifxTF\skv@provb\@empty{% \def\skv@ival{???}% }{% - \skv@getbasetoks{30}\skv@provb\skv@ival + \skv@getshortformofcontent{30}\skv@provb\skv@ival }% }% \skvaftergroupdef\skv@ival\endgroup } -% \skv@getbasetoks{<nr>}{<toks.cmd>}{<result.cmd>} -\skvrobustdef*\skv@getbasetoks#1#2#3{% +% \skv@getshortformofcontent{<nr>}{<toks.cmd>}{<result.cmd>} +\skvrobustdef*\skv@getshortformofcontent#1#2#3{% \begingroup \edef\skv@prova{\detokenize\expandafter{#2}}% \def#3{}\@tempcnta\skvz@ @@ -6511,7 +6578,7 @@ } % \dirkeys@executechoice{<expansion.type>}{<curr.value>}{<choices.and.cbks>} \skvrobustdef*\dirkeys@executechoice#1#2#3{% - \skv@getexpander@b{#1}% + \skv@getexpander{#1}% \edef\skv@prova{\skvexpander{#2}}% \skvdespacecontent\skv@prova \def\do##1##2##3\skv@nil{% @@ -6570,7 +6637,7 @@ % \skvrobustdef*\dirkeys@saveslots#1#2#3{% \begingroup - \skv@getexpander@b{#3}% + \skv@getexpander{#3}% \def\skv@tempd{}% \edef\skv@tempa{\unexpanded{#1}}% \skvcsvnormalize[/]\skv@tempa @@ -6716,7 +6783,7 @@ % \skvrobustdef*\dirkeys@savestores#1#2{% \begingroup - \skv@getexpander@b{#2}% + \skv@getexpander{#2}% \def\skv@tempd{}% \edef\skv@tempa{\unexpanded{#1}}% \skvcsvnormalize[/]\skv@tempa @@ -7512,17 +7579,19 @@ }% }% } -% \dirkeys@defhandlers{<flag>}{<list>} +% \dirkeys@defhandlers{<flag>}{<kvlist>} % % <flag> indicates if we're in <new> (01) or <define> (00) handler. % +% <kvlist> -> {<handlers-1>}={<defn>},...,{<handlers-n>}={<defn>} +% \skvrobustdef*\dirkeys@defhandlers#1#2{% \begingroup \def\skv@collection{}% \def\skv@param{####1\skvhandlereov}% \def\skv@defhandlers@do##1{% \skv@ensurehandlerdot{##1}% - \skvifplaswTF{#1}{% + \skvifknobTF{#1}{% \dirkeys@defhandlers@aux{##1}% }{% \skvifcsdefTF{dirkeys@handler@##1}{% @@ -7548,6 +7617,7 @@ \skvcmdexit\dirkeys@reservedhandlers }% } +\skvnewlet\dirkeysdefhandlers\dirkeys@defhandlers % \dirkeys@defnarghandlers{<flag>}{<list>} % % Define handlers of more than one argument. This is slightly more @@ -7563,7 +7633,7 @@ \def\skv@prova####1####2\handler@nil{% \edef\skv@param{\skvgenerateparameters{1}{####1}\skvhandlereov}% \edef\skv@body{\unexpanded{####2}}% - \skvifplaswTF{#1}{% + \skvifknobTF{#1}{% \dirkeys@defhandlers@aux{##1}% }{% \skvifcsdefTF{dirkeys@handler@##1}{% @@ -7591,6 +7661,8 @@ \skvcmdexit\dirkeys@reservedhandlers }% } +\skvnewlet\dirkeysdefnarghandlers\dirkeys@defnarghandlers + % \dirkeys@handlerlet{<flag>}{<kvlist>} % % 1. <flag> is either 00 (for define) or 01 (for new handler). @@ -7612,7 +7684,7 @@ \ifx\dirkeys@reservedhandlers\@empty\else,\fi##1% }% \fi - \skvifplaswTF{#1}{}{% + \skvifknobTF{#1}{}{% \skvifnamedefFT{dirkeys@handler@##1}{}{% \skv@err{Handler '##1' arealdy exists}\skv@ehd }% |