diff options
author | Karl Berry <karl@freefriends.org> | 2020-11-23 22:01:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-11-23 22:01:18 +0000 |
commit | c23682f2c0c9d6928d1a2d9f362b8b7ed708fb72 (patch) | |
tree | 480e773e9958e03b19a9237fd47282c94481e6eb /Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex | |
parent | 754f20ecc77875061dd95322eca1dd3e9f453b18 (diff) |
pgf (23nov20)
git-svn-id: svn://tug.org/texlive/trunk@56989 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex index e32745317c5..db89141aca1 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex @@ -178,7 +178,13 @@ % % \pgfkeysifdefined{/tikz/length}{key exists}{does not exist} -\long\def\pgfkeysifdefined#1#2#3{\ifcsname pgfk@#1\endcsname#2\else#3\fi} +\long\def\pgfkeysifdefined#1{% + \ifcsname pgfk@#1\endcsname + \expandafter\pgfkeys@firstoftwo + \else + \expandafter\pgfkeys@secondoftwo + \fi +} % Tests whether a key is assignable. For standard keys which just % store their value, this is identical to \pgfkeysifdefined. @@ -749,7 +755,7 @@ {% \pgfkeysgetvalue{\pgfkeyscurrentpath/.@args}{\pgfkeys@tempargs}% \pgfkeysgetvalue{\pgfkeyscurrentpath/.@body}{\pgfkeys@tempbody}% - \def\pgfkeys@marshal{\expandafter\gdef\expandafter\pgfkeys@global@temp\pgfkeys@tempargs}% + \def\pgfkeys@marshal{\expandafter\long\expandafter\gdef\expandafter\pgfkeys@global@temp\pgfkeys@tempargs}% \expandafter\pgfkeys@marshal\expandafter{\pgfkeys@tempbody}% }% \pgfkeysifdefined{\pgfkeyscurrentpath/.@@body}{% @@ -799,11 +805,7 @@ % Defining a value -\pgfkeys{/handlers/.initial/.code=% - \pgfkeyslet{\pgfkeyscurrentpath/.@cmd}\undefined - \pgfkeyslet{\pgfkeyscurrentpath/.@args}\undefined - \pgfkeyssetvalue{\pgfkeyscurrentpath}{#1}% -} +\pgfkeys{/handlers/.initial/.code=\pgfkeyssetvalue{\pgfkeyscurrentpath}{#1}} \pgfkeys{/handlers/.add/.code 2 args=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{#2}} \pgfkeys{/handlers/.prefix/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{#1}{}} \pgfkeys{/handlers/.append/.code=\pgfkeysaddvalue{\pgfkeyscurrentpath}{}{#1}} @@ -1039,50 +1041,50 @@ \pgfkeys{ /errors/boolean expected/.code 2 args=% - { - \toks1={#1} - \toks2={#2} + {% + \toks1={#1}% + \toks2={#2}% \pgfkeys@error{% Boolean parameter of key '\the\toks1' must be 'true' or 'false', not '\the\toks2'. I am going to ignore it% - } + }% }, /errors/value required/.code 2 args=% - { - \toks1={#1} + {% + \toks1={#1}% \pgfkeys@error{% The key '\the\toks1' requires a value. I am going to ignore this key% - } + }% }, /errors/value forbidden/.code 2 args=% - { - \toks1={#1} - \toks2={#2} + {% + \toks1={#1}% + \toks2={#2}% \pgfkeys@error{% You may not specify a value for the key '\the\toks1'. I am going to ignore the value '\the\toks2' that you provided% - } + }% }, /errors/unknown choice value/.code 2 args=% - { - \toks1={#1} - \toks2={#2} + {% + \toks1={#1}% + \toks2={#2}% \pgfkeys@error{% Choice '\the\toks2' unknown in choice key '\the\toks1'. I am going to ignore this key% - } + }% }, /errors/unknown key/.code 2 args=% - { - \toks1={#1} - \toks2={#2} + {% + \toks1={#1}% + \toks2={#2}% \def\pgf@temp{#2}% \pgfkeys@error{% I do not know the key '\the\toks1'\ifx\pgf@temp\pgfkeysnovalue@text\space\else, to which you passed '\the\toks2', \fi and I am going to ignore it. Perhaps you misspelled it% - } + }% } } |