diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty | 424 |
1 files changed, 256 insertions, 168 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty b/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty index d047ec0b90e..7223aaba413 100644 --- a/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty +++ b/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty @@ -1,6 +1,6 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% % % -% This is file 'pathkeys.sty', version 0.0.2, October 2011. % +% This is file 'pathkeys.sty', version 0.0.3, December 2011. % % % % This package and accompanying files may be distributed and/or % % modified under the conditions of the LaTeX Project Public License, % @@ -21,24 +21,39 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \@ifpackageloaded{ltxkeys}{% - \@ifpackagelater{ltxkeys}{2011/10/22}{}{% + \@ifpackagelater{ltxkeys}{2011/12/10}{}{% \@latex@error{Loaded version of ltxkeys package is not current}\@ehc }% }{% - \RequirePackage{ltxkeys}[2011/10/22]% + \RequirePackage{ltxkeys}[2011/12/10]% } \UseNormalCatcodes -\StyleFilePurpose{A robust and fast key-value parser (AM)} +\StyleFilePurpose{A robust 'path' key-value parser (AM)} \StyleFileRCSInfo -$Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ +$Id: pathkeys.sty,v 0.0.3 2011/12/17 09:00:00 Ahmed Musa Exp $ \ProvidesPackage{pathkeys}[\StyleFileInfo] -\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\NeedsTeXFormat{LaTeX2e}[2011/06/27] \SetStyleFileMessages[pathkeys@]{info}{warn}{err} -\newvariables{count}[pathkeys@]{cnta}[\z@pt] -\newvariables{if}[pathkeys@]{chfd}[false] -\newletcs\pathkeys@relax\relax -\new@def\pathkeys@gobbletorelax#1\pathkeys@relax{} +\cptnewvariables{count}[pathkeys@]{cnta}[\z@pt] +\AtEndOfPackage{% + \newletcsset{% + \pathkeyscurrentpath=\pathkeys@currentpath, + \pathkeyspushcurrentpath=\pathkeys@pushcurrentpath, + \pathkeyspopcurrentpath=\pathkeys@popcurrentpath, + \pathkeysusedefaultpath=\pathkeys@usedefaultpath, + \pathkeysstorevalue=\pathkeys@storevalue, + \pathkeysstorevalueof=\pathkeys@storevalue, + \pathkeysval=\pathkeys@getval, + \pathkeysvalueof=\pathkeys@getval, + \pathkeyskeyval=\pathkeys@getkeyval, + \changepath=\defpath, + \pathkeys@c@rrentpath=\pathkeys@defaultpath, + \pathkeysuseshortcmds=\pathkeys@useshortcmds, + \pathkeysmakeshortcmds=\pathkeys@makeshortcmds + }% +} +\cpt@setupsafeactivesedef \robust@def*\pathkeys@getkeypath#1{% \xifinsetTF{:}{\detokenize{#1}}{}{% \pathkeys@err{I can't find ':' in argument of @@ -46,31 +61,31 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ }% \def\reserved@a##1:##2\ltxkeys@nil{% \iflacus##1\dolacus - \pathkeys@err{Nil flag in argument of - \string\pathkeys}\ltxkeys@ehc + \pathkeys@err{Nil flag in argument of \string\pathkeys}\ltxkeys@ehc \fi - \ltxkeys@trimspaces{##1}\key@path + \ltxkeys@trimspaces{##1}\key@path@flag \ltxkeys@trimspaces{##2}\key@list - \csv@@normalize*[/]\key@path - \s@expandarg\pathkeys@getkeyflag\key@path - \csv@@normalize*[/]\key@path - \cptsafeactivesedef\key@path\key@path - \xifstrcmpTF\key@flag{ifkeyonpath}{% - \pathkeys@gobbletorelax - }{% - \pathkeys@listadd*![;]\pathkeys@pathhistory\key@path - }% + \csv@@normalize*[/]\key@path@flag + \s@expandarg\pathkeys@getkeyflag\key@path@flag }% \reserved@a#1\ltxkeys@nil } \robust@def*\pathkeys@getkeyflag#1{% + \ltxkeys@ifoneintokenlist{{define}{declareoptions}}{#1}{% + \pathkeys@g@tkeyflag{#1}% + }{% + \def\onekeytype{}% + \def\key@path@flag{#1}% + }% \def\do##1,##2\ltxkeys@nil{% - \xifinsetTF{\detokenize{##1}\relax}{\detokenize{#1}\relax}{% + \xifinsetTF{\detokenize{##1}\relax}{\cptoxdetok\key@path@flag\relax}{% \def\reserved@a####1##1\relax{% \ltxkeys@trimspaces{##1}\key@flag \ltxkeys@trimspaces{####1}\key@path + \csv@@normalize*[/]\key@path + \cptsafeactivesedef\key@path\key@path }% - \reserved@a#1\relax + \expandafter\reserved@a\key@path@flag\relax }{% \ifnullTF{##2}{% \pathkeys@err{Unknown flag in argument of @@ -80,10 +95,33 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ }% }% }% - \do define,define*,declareoptions,declareoptions*,set,% - executeoptions,processoptions,processoptions*,launch,% - key handler,option handler,ifbool,add value,store value,% - print value,disable,disable*,fdef,ifkeyonpath,\ltxkeys@nil + \do define*,define,declareoptions*,declareoptions,% + preset,preset!,postset,postset!,set*+,set*,set,setrm*+,% + setrm*,setrm,executeoptions,processoptions*,processoptions,% + launch,key handler,option handler,ifbool,add value,store value,% + print value,disable*,disable,ifdef,ifkeyonpath,\ltxkeys@nil +} +\robust@def*\pathkeys@g@tkeyflag#1{% + \xifinsetTF{)\relax}{\detokenize{#1}\relax}{% + \xifinsetTF{(}{\detokenize{#1}}{% + \def\reserved@a##1(##2)##3\ltxkeys@nil{% + \iflacus##3\dolacus + \def\key@path@flag{##1}% + \def\onekeytype{##2}% + \else + \pathkeys@err{Inconsistent path or flag in argument of + \string\pathkeys}{The invalid part is ||\detokenize{##3}||}% + \fi + }% + \reserved@a#1\ltxkeys@nil + }{% + \pathkeys@err{Inconsistent flag in argument of + \string\pathkeys}\ltxkeys@ehc + }% + }{% + \def\onekeytype{}% + \def\key@path@flag{#1}% + }% } \robust@def*\pathkeys@splitpath#1{% \def\main@path{}\def\sub@path{}% @@ -128,104 +166,170 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ \def\reserved@a##1/##2/##3\ltxkeys@nil{% \ltxkeys@trimspaces{##2}\key@name \ltxkeys@ifrejname{% - \pathkeys@err{^^JI can't find key name in attributes of - key in^^J||\detokenize{#1}||^^J}\ltxkeys@ehc + \pathkeys@err{I can't find key name in attributes of + key in ||\detokenize{#1}||}\ltxkeys@ehc }% }% - \reserved@a#1/^?/\ltxkeys@nil + \reserved@a#1/^?^/\ltxkeys@nil }% } \robust@def*\pathkeys@checkifdef{% - \xifinsetTF{,\key@flag,}{,define*,declareoptions*,}{% - \def\ltxkeys@resa{}% - \def\ltxkeys@do##1{% - \pathkeys@getkeyname{##1}% - \ifcsndefTF{pathkeys/curr/\ltxkeys@iffirstnull\main@path/% - \ltxkeys@iffirstnull\sub@path/\key@name - }{% - \edef\ltxkeys@resa{\csliststack,\ltxkeys@resa\key@name}% - }{}% + \def\ltxkeys@resa{}% + \def\ltxkeys@do##1{% + \ltxkeys@ifcsemptyTF\onekeytype{% + \edef\reserved@a{\unexpanded{##1}}% + }{% + \edef\reserved@a{\onekeytype/\unexpanded{##1}}% }% - \cptexpandsecond{\ltxkeys@parse*1}{[\ltxkeys@keyparser]}\key@list - \ifx\ltxkeys@resa\@empty\else - \pathkeys@err{^^JKey names^^J||\ltxkeys@resa||^^J% - in argument of \noexpand\pathkeys are already in - use on path '\key@path'}\ltxkeys@ehc - \fi - }{}% + \cptexpandbracenext\pathkeys@getkeyname\reserved@a + \begingroup + \let\needvalue\cpttrimspace + \let\savevalue\cpttrimspace + \let\usevalue\cpttrimspace + \ifcsndefTF{pathkeys/curr/\ltxkeys@iffirstnull\main@path/% + \ltxkeys@iffirstnull\sub@path/\key@name + }{% + \xdef\ltxkeys@resa{\csliststack,\ltxkeys@resa\key@name}% + }{}% + \endgroup + }% + \cptexpandsecond{\ltxkeys@parse*1}{[\ltxkeys@keyparser]}\key@list + \ifx\ltxkeys@resa\@empty\else + \pathkeys@err{Key names ||\ltxkeys@resa||% + in argument of \noexpand\pathkeys are already in + use on path '\key@path'}\ltxkeys@ehc + \fi } -\cpt@setupsafeactivesedef \robust@def*\pathkeys#1{% - \begintoksgroup \pathkeys@getkeypath{#1}% - \s@expandarg\pathkeys@checkpath\key@path - \s@expandarg\pathkeys@splitpath\key@path - \pathkeys@checkifdef - \pathkeys@relax + \ltxkeys@ifcsemptyTF\key@path{% + \let\key@path\pathkeys@c@rrentpath + }{}% + \pathkeys@addtopathhistory\key@path + \xifinsetTF{,\key@flag,}{,ifdef,ifkeyonpath,}\pathkeys@b\pathkeys@a +} +\robust@def*\pathkeys@a{% + \def\ltxkeys@do##1{% + \def\key@path{##1}% + \pathkeys@checkpath{##1}% + \pathkeys@splitpath{##1}% + \xifinsetTF{,\key@flag,} + {,define,define*,declareoptions,declareoptions*,}{% + \pathkeys@checkifdef + }{}% + \pathkeys@b + }% + \ltxkeys@parse*1[,]\key@path +} +\robust@def*\pathkeys@b{% + \begingroup \let\xp\expandcsonce - \let\elt\ltxkeys@iffirstnull + \let\elta\ltxkeys@iffirstnull + \def\eltb{{\main@path}{\sub@path}{\xp\key@list}}% + \def\eltc{[\main@path]{\sub@path}{\xp\key@list}}% + \def\eltd{pathkeys/curr/\elta\main@path/\elta\sub@path/}% \def\reserved@a##1{% \def\reserved@a####1##1####2####3\ltxkeys@nil{% \defifxTF{####2}\ltxkeys@nil{% + \endgroup \pathkeys@err{Unknown flag '####1' in argument of \string\pathkeys}\ltxkeys@ehc }{% - \cptexpanded{\toks@{####2}}% + \cptexpanded{\endgroup####2}% }% }% - \expandafter\reserved@a\pathkeys@actions##1{\ltxkeys@nil}\ltxkeys@nil + \expandafter\reserved@a\pathkeys@act##1{\ltxkeys@nil}\ltxkeys@nil }% \s@expandarg\reserved@a\key@flag - \endtoksgroup } -\robust@def*\pathkeys@actions{% - define{\pathkeys@defkey\ltxkeys@declarekeys{{\sub@path}}}% - define*{\pathkeys@defkey{\ltxkeys@declarekeys*}{{\sub@path}}}% - declareoptions{\pathkeys@defkey - \ltxkeys@declaremultitypeoptions{<\sub@path>}}% - declareoptions*{\pathkeys@defkey - {\ltxkeys@declaremultitypeoptions*}{<\sub@path>}}% - set{\pathkeys@setkeys{\main@path}{\sub@path}{\xp\key@list}}% - executeoptions{\pathkeys@executeoptions{\main@path}% - {\sub@path}{\xp\key@list}}% - processoptions{\pathkeys@processoptions{\main@path}% - {\sub@path}{\xp\key@list}}% - processoptions*{\pathkeys@processoptions*{\main@path}% - {\sub@path}{\xp\key@list}}% - launch{\ltxkeys@launchkeys[\main@path]{\sub@path}{\xp\key@list}}% - handler{\ltxkeys@unknownkeyhandler[\main@path]% - {\sub@path}{\xp\key@list}}% - key handler{\ltxkeys@unknownkeyhandler[\main@path]% - {\sub@path}{\xp\key@list}}% - option handler{\ltxkeys@unknownoptionhandler[\main@path]% - <\sub@path>{\xp\key@list}}% - ifbool{\noexpand\ifp@thkeys@keyvalTF{\key@list}% - {pathkeys/curr/\elt\main@path/\elt\sub@path/\key@list}}% - add value{\p@thkeys@addtovalue{\xp\key@list}% - {pathkeys/curr/\elt\main@path/\elt\sub@path/}}% - store value{\p@thkeys@storevalue{\xp\key@list}% - {pathkeys/curr/\elt\main@path/\elt\sub@path/}}% - print value{\noexpand\p@thkeys@keyval{\key@list}% - {pathkeys/curr/\elt\main@path/\elt\sub@path/\key@list}}% - disable{\ltxkeys@disablekeys[\main@path]{\sub@path}{\key@list}}% - disable*{\ltxkeys@disablekeys*[\main@path]{\sub@path}{\key@list}}% - ifdef{\noexpand\ifp@thkeys@keydef{\main@path}{\sub@path}{\key@list}}% - ifkeyonpath{\noexpand\ifp@thkeys@onpath{\key@path}{\key@list}}% -} -\robust@def*\pathkeys@setkeys#1#2#3{% - \xifinsetTF{\relax[}{\relax\detokenize{#3}}{% +\robust@def*\pathkeys@act{% + define{\pathkeys@defkey{define}{}}% + define*{\pathkeys@defkey{define}{*}}% + declareoptions{\pathkeys@defkey{declareoptions}{}}% + declareoptions*{\pathkeys@defkey{declareoptions}{*}}% + set{\pathkeys@setkeys{}{}\eltb}% + set*{\pathkeys@setkeys{}{*}\eltb}% + set*+{\pathkeys@setkeys{}{*+}\eltb}% + setrm{\pathkeys@setkeys{rm}{}\eltb}% + setrm*{\pathkeys@setkeys{rm}{*}\eltb}% + setrm*+{\pathkeys@setkeys{rm}{*+}\eltb}% + preset{\pathkeys@presetkeys{pre}{}}% + preset!{\pathkeys@presetkeys{pre}{!}}% + postset{\pathkeys@presetkeys{post}{}}% + postset!{\pathkeys@presetkeys{post}{!}}% + executeoptions{\pathkeys@executeoptions\eltb}% + processoptions{\pathkeys@processoptions{}\eltb}% + processoptions*{\pathkeys@processoptions{*}\eltb}% + launch{\ltxkeys@launchkeys\eltc}% + handler{\ltxkeys@unknownkeyhandler\eltc}% + key handler{\ltxkeys@unknownkeyhandler\eltc}% + option handler{\pathkeys@unknownoptionhandler}% + ifbool{\noexpand\ifp@thkeys@keyvalTF{\key@list}{\eltd\key@list}}% + add value{\p@thkeys@addtovalue{\xp\key@list}{\eltd}}% + store value{\p@thkeys@storevalue{\xp\key@list}{\eltd}}% + print value{\noexpand\p@thkeys@keyval{\key@list}{\eltd\key@list}}% + disable{\ltxkeys@disablekeys\eltc}% + disable*{\ltxkeys@disablekeys*\eltc}% + ifdef{\noexpand\ifp@thkeys@keydef{\key@path}{\key@list}}% + ifkeyonpath{\noexpand\ifp@thkeys@keydef{\key@path}{\key@list}}% +} +\new@def*\pathkeys@defkey#1#2{% + \noexpand\ltxkeys@inkeycmdtrue + \expandafter\noexpand\csname + ltxkeys@% + \cptifcasse\ifstrcmpTF{#1} + {define}{declarekeys} + {declareoptions}{declaremultitypeoptions} + \endif + \endcsname + #2\ltxkeys@ifcsemptyTF\onekeytype{}{(\onekeytype)}[\main@path]% + \cptifcasse\ifstrcmpTF{#1} + {define}{{\sub@path}} + {declareoptions}{<\sub@path>} + \endif + [\eltd]{\expandcsonce\key@list}% + \noexpand\ltxkeys@inkeycmdfalse +} +\new@def*\pathkeys@presetkeys#1#2{% + \noexpandcsn{ltxkeys@#1setkeys}% + #2[\main@path]{\sub@path}{\expandcsonce\key@list}% +} +\robust@def*\pathkeys@setkeys#1#2#3#4#5{% + \edef\ltxkeys@tempa{\noexpandcsn{ltxkeys@set#1keys}#2}% + \def\ltxkeys@tempb##1{% + \iflacus##1\dolacus\else + \ltxkeys@err{Wrong use syntax for flag 'setrm'} + {Only [na] keys are expected in attribute of flag 'setrm'.}% + \fi + }% + \xifinsetTF{\relax[}{\relax\detokenize{#5}}{% \def\reserved@a[##1]##2\ltxkeys@nil{% - \ltxkeys@setkeys[#1]{#2}[##1]{##2}% + \ifstrcmpTF{#1}{rm}{% + \ltxkeys@tempb{##2}% + \ltxkeys@tempa[#3]{#4}[##1]% + }{% + \ltxkeys@tempa[#3]{#4}[##1]{##2}% + }% }% - \reserved@a#3\ltxkeys@nil + \reserved@a#5\ltxkeys@nil }{% - \xifinsetTF{]\relax}{\detokenize{#3}\relax}{% + \xifinsetTF{]\relax}{\detokenize{#5}\relax}{% \def\reserved@a##1[##2]\ltxkeys@nil{% - \ltxkeys@setkeys[#1]{#2}[##2]{##1}% + \ifstrcmpTF{#1}{rm}{% + \ltxkeys@tempb{##1}% + \ltxkeys@tempa[#3]{#4}[##2]% + }{% + \ltxkeys@tempa[#3]{#4}[##2]{##1}% + }% }% - \reserved@a#3\ltxkeys@nil + \reserved@a#5\ltxkeys@nil }{% - \ltxkeys@setkeys[#1]{#2}{#3}% + \ifstrcmpTF{#1}{rm}{% + \ltxkeys@tempb{#5}% + \ltxkeys@tempa[#3]{#4}% + }{% + \ltxkeys@tempa[#3]{#4}{#5}% + }% }% }% } @@ -246,40 +350,35 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ }% }% } -\robust@def*\pathkeys@processoptions{% - \ltxkeys@testst\pathkeys@pr@cessoptions -} -\robust@def*\pathkeys@pr@cessoptions#1#2#3{% - \edef\reserved@e{\ifltxkeys@st*\fi}% - \xifinsetTF{\relax[}{\relax\detokenize{#3}}{% +\robust@def*\pathkeys@processoptions#1#2#3#4{% + \def\ltxkeys@tempb##1{% + \iflacus##1\dolacus\else + \pathkeys@err{Wrong use of 'processoptions' flag in + \string\pathkeys}{The invalid part is '\detokenize{##1}'}% + \fi + }% + \xifinsetTF{\relax[}{\relax\detokenize{#4}}{% \def\reserved@a[##1]##2\ltxkeys@nil{% - \iflacus##2\dolacus\else - \pathkeys@err{Wrong use of 'processoptions' flag in - \string\pathkeys}{The invalid part is '\detokenize{##2}'}% - \fi - \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>[##1]% + \ltxkeys@tempb{##2}% + \ltxkeys@processoptions#1[#2]<#3>[##1]% }% - \reserved@a#3\ltxkeys@nil + \reserved@a#4\ltxkeys@nil }{% - \xifinsetTF{]\relax}{\detokenize{#3}\relax}{% + \xifinsetTF{]\relax}{\detokenize{#4}\relax}{% \def\reserved@a##1[##2]\ltxkeys@nil{% - \iflacus##1\dolacus\else - \pathkeys@err{Wrong use of 'processoptions' flag in - \string\pathkeys}{The invalid part is '\detokenize{##1}'}% - \fi - \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>[##2]% + \ltxkeys@tempb{##1}% + \ltxkeys@processoptions#1[#2]<#3>[##2]% }% - \reserved@a#3\ltxkeys@nil + \reserved@a#4\ltxkeys@nil }{% - \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>% + \ltxkeys@tempb{#4}% + \ltxkeys@processoptions#1[#2]<#3>% }% }% } -\new@def*\pathkeys@defkey#1#2{% - \noexpand\ltxkeys@inkeycmdtrue - #1[\main@path]#2[pathkeys/curr/\elt\main@path/\elt\sub@path/]% - {\expandcsonce\key@list}% - \noexpand\ltxkeys@inkeycmdfalse +\new@def*\pathkeys@unknownoptionhandler{% + \ltxkeys@unknownoptionhandler + [\main@path]<\sub@path>{\xp\key@list}% } \robust@def*\p@thkeys@storevalue#1#2{% \ltxkeys@getlasttoken{#1}% @@ -324,36 +423,25 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ \ifp@thkeys@keyval{#1}{#2}\then\expandafter\iofii\else \expandafter\iiofii\fi } -\new@def*\ifp@thkeys@keydef#1#2#3{% - \begingroup - \pathkeys@chfdfalse - \ifcsndefTF{pathkeys/curr/#1/#2/#3}{% - \pathkeys@chfdtrue - }{% - \ifcsndefTF{#1@#2@#3}{% - \pathkeys@chfdtrue - }{}% - }% - \expandafter\endgroup\ifpathkeys@chfd - \expandafter\iofii\else\expandafter\iiofii\fi -} -\robust@def*\ifp@thkeys@onpath#1#2{% +\robust@def*\ifp@thkeys@keydef#1#2{% \begingroup - \pathkeys@chfdfalse + \def\pathkeys@chfd{01}% \def\ltxkeys@do##1{% \pathkeys@checkpath{##1}% \pathkeys@splitpath{##1}% \let\elt\ltxkeys@iffirstnull \ifcsndefTF{pathkeys/curr/\elt\main@path/\elt\sub@path/#2}{% - \pathkeys@chfdtrue\loopbreak + \def\pathkeys@chfd{00}% + \loopbreak }{% \ifcsndefTF{\main@path @\sub@path @#2}{% - \pathkeys@chfdtrue\loopbreak + \def\pathkeys@chfd{00}% + \loopbreak }{}% }% }% \ltxkeys@parse1[,]{#1}% - \expandafter\endgroup\ifpathkeys@chfd + \expandafter\endgroup\if\pathkeys@chfd \expandafter\iofii\else\expandafter\iiofii\fi } @@ -402,43 +490,47 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ \pathkeys@replaceslash#1@#2\ltxkeys@nil }% } -\newletcs\pathkeys@addcons\@empty -\robust@def*\pathkeys@listadd{% - \cpt@testst{\cpt@testcl{\cpt@testopt\pathkeys@l@stadd,}}% -} -\robust@def*\pathkeys@l@stadd[#1]#2#3{% - \ifcpt@st - \let\pathkeys@addcons\@space - \fi - \ifcpt@cl\global\fi - \edef#2{\csliststack{#1\pathkeys@addcons}#2\expandcsonce{#3}}% - \let\pathkeys@addcons\@empty +\new@def*\pathkeys@pathhistory{} +\robust@def*\pathkeys@addtopathhistory#1{% + \begingroup + \cptsafeactivesedef\reserved@e{#1}% + \def\reserved@f##1{% + \xifinsetTF{;##1;}{;\pathkeys@pathhistory;}{}{% + \xdef\pathkeys@pathhistory{\csliststack;\pathkeys@pathhistory##1}% + }% + }% + \xifinsetTF,\reserved@e{% + \def\ltxkeys@do##1{\reserved@f{##1}}% + \ltxkeys@parse*1[,]\reserved@e + }{% + \reserved@f\reserved@e + }% + \endgroup } \robust@def*\newpath#1#2{% \ifcsndefTF{pathkeys@path@\cpttrimspace{#1}}{% \pathkeys@err{Path '#1' already in use}\@ehc }{% \csn@edef{pathkeys@path@\cpttrimspace{#1}}{\cpttrimspace{#2}}% - \pathkeys@listadd*![;]\pathkeys@pathhistory{#2}% + \pathkeys@addtopathhistory{#2}% }% } \robust@def*\defpath#1#2{% \csn@edef{pathkeys@path@\cpttrimspace{#1}}{\cpttrimspace{#2}}% - \pathkeys@listadd*![;]\pathkeys@pathhistory{#2}% + \pathkeys@addtopathhistory{#2}% } -\newletcs\changepath\defpath \robust@def*\undefpath#1{% \edef\ltxkeys@tempa{\usename{pathkeys@path@\cpttrimspace{#1}}}% \pathkeys@undefpath \undefcsn{pathkeys@path@\cpttrimspace{#1}}% } \robust@def*\pathkeys@undefpath{% - \xifinsetTF\ltxkeys@tempa\pathkeys@pathhistory{% + \xifinsetTF{;\ltxkeys@tempa;}{;\pathkeys@pathhistory;}{% \def\reserved@a##1{% \def\reserved@a####1##1####2\ltxkeys@nil{% \def\pathkeys@pathhistory{####1####2}% - \xifinsetTF{; ;}\pathkeys@pathhistory{% - \def\reserved@a########1; ;########2\ltxkeys@nil{% + \xifinsetTF{;;}\pathkeys@pathhistory{% + \def\reserved@a########1;;########2\ltxkeys@nil{% \def\pathkeys@pathhistory{########1;########2}% }% \expandafter\reserved@a\pathkeys@pathhistory\ltxkeys@nil @@ -466,26 +558,25 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ }% } \new@def*\pathkeys@defaultpath{dft@main/dft@sub} -\newletcs\pathkeys@c@rrentpath\pathkeys@defaultpath \robust@def*\pathkeys@addtodefaultpath#1{% \edef\pathkeys@defaultpath {\expandcsonce\pathkeys@defaultpath/\expandcsonce{#1}}% \csv@@normalize*[/]\pathkeys@defaultpath - \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@defaultpath + \pathkeys@addtopathhistory\pathkeys@defaultpath } \robust@def*\pathkeys@changedefaultpath#1{% \edef\pathkeys@defaultpath{\expandcsonce{#1}}% \csv@@normalize*[/]\pathkeys@defaultpath - \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@defaultpath + \pathkeys@addtopathhistory\pathkeys@defaultpath } \robust@def*\pathkeys@currentpath#1{% \edef\pathkeys@c@rrentpath{\expandcsonce{#1}}% \csv@@normalize*[/]\pathkeys@c@rrentpath - \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath + \pathkeys@addtopathhistory\pathkeys@c@rrentpath } \robust@def*\pathkeys@usedefaultpath{% \let\pathkeys@c@rrentpath\pathkeys@defaultpath - \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath + \pathkeys@addtopathhistory\pathkeys@c@rrentpath } \new@def*\pathkeys@currentpathstack{} \robust@def*\pathkeys@pushcurrentpath{% @@ -501,7 +592,7 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ ##1\gdef\pathkeys@currentpathstack }% \expandafter\reserved@a\pathkeys@currentpathstack - \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath + \pathkeys@addtopathhistory\pathkeys@c@rrentpath } \new@def*\pathkeys@ifnop@th#1/{} \new@def*\pathkeys@ifnopath#1{% @@ -515,7 +606,6 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ \pathkeys@err{Key '\cpttrimspace{#1}' not defined}\ltxkeys@ehc }% } -\newletcs\pathkeyskeyval\pathkeys@getkeyval \new@def*\pathkeys@storevalue#1#2{% \ifescapedTF{#2}{% \edef#2{\unexpanded\expandafter @@ -538,7 +628,6 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ undefinedpathkey% }% } -\newletcs\pathkeysval\pathkeys@getval \new@def*\ifundefinedpathkey{undefinedpathkey\iffalse} \new@def*\ifpathkeysval#1\then{\usename{if\pathkeys@getval{#1}}} \new@def*\ifpathkeysvalTF#1{% @@ -606,7 +695,6 @@ $Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ \pathkeys@warn{Unknown option '\CurrentKey' with value '\InnocentVal' ignored.}% } -%\ltxkeys@executeoptions[KV]<pathkeys>{}\relax \ltxkeys@processoptions*[KV]<pathkeys>\relax \cpt@optioncleanup\ltxkeys@processedoptions |