summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/pgfkeys.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/tex/pgfkeys.code.tex')
-rw-r--r--graphics/pgf/base/tex/pgfkeys.code.tex54
1 files changed, 28 insertions, 26 deletions
diff --git a/graphics/pgf/base/tex/pgfkeys.code.tex b/graphics/pgf/base/tex/pgfkeys.code.tex
index e32745317c..db89141aca 100644
--- a/graphics/pgf/base/tex/pgfkeys.code.tex
+++ b/graphics/pgf/base/tex/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%
- }
+ }%
}
}