Skip to content

Commit

Permalink
Fix bug in \pgfkeysedef #306
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Dec 24, 2018
1 parent 29f9bd2 commit ac33f7e
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions generic/pgf/utilities/pgfkeys.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


% Guard against reading twice
\ifx\pgfkeysloaded\pgfutil@undefined
\ifx\pgfkeysloaded\undefined
\let\pgfkeysloaded=\relax
\else
\expandafter\endinput
Expand Down Expand Up @@ -76,7 +76,11 @@
\pgfkeys@temptoks{#2}\expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}%
}


\long\def\pgfkeyssetevalue#1#2{%
\pgfkeys@temptoks={#2}%
\pgfkeys@temptoks=\scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}%
\expandafter\edef\csname pgfk@#1\expandafter\endcsname\expandafter{\the\pgfkeys@temptoks}%
}

% Add text to a key at the end
%
Expand Down Expand Up @@ -608,7 +612,7 @@
\long\def\pgfkeysedef#1#2{%
\long\edef\pgfkeys@temp##1\pgfeov{#2}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
\pgfkeyssetvalue{#1/.@body}{#2}%
\pgfkeyssetevalue{#1/.@body}{#2}%
}


Expand All @@ -633,11 +637,12 @@
\pgfkeyssetvalue{#1/.@args}{#2\pgfeov}%
\pgfkeyssetvalue{#1/.@body}{#3}%
}

\long\def\pgfkeysedefargs#1#2#3{%
\long\edef\pgfkeys@temp#2\pgfeov{#3}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
\pgfkeyssetvalue{#1/.@args}{#2\pgfeov}%
\pgfkeyssetvalue{#1/.@body}{#3}%
\pgfkeyssetevalue{#1/.@body}{#3}%
}

% Like \pgfkeysdefargs, but `#2' is an integer denoting the expected
Expand Down Expand Up @@ -677,10 +682,10 @@
% {2}
% }
% ->defargs: 1=`1', 2=`2'
%--------------------------------------------------
\long\def\pgfkeysdefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\def}}%
\long\def\pgfkeysedefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\edef}}%
\long\def\pgfkeysdefnargs@#1#2#3#4{%
% --------------------------------------------------
\long\def\pgfkeysdefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\def}{\pgfkeyssetvalue}}%
\long\def\pgfkeysedefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\edef}{\pgfkeyssetevalue}}%
\long\def\pgfkeysdefnargs@#1#2#3#4#5{%
\ifcase#2\relax
\pgfkeyssetvalue{#1/.@args}{}%
\or
Expand Down Expand Up @@ -714,11 +719,9 @@
\edef\pgfkeys@tempargs{\noexpand\pgfkeysvalueof{#1/.@@body}}%
\def\pgfkeys@temp{\pgfkeysdef{#1}}%
\expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}%
\pgfkeyssetvalue{#1/.@body}{#3}%
#5{#1/.@body}{#3}%
}



% Defining a key command

\pgfkeysdef{/handlers/.code}{\pgfkeysdef{\pgfkeyscurrentpath}{#1}}
Expand Down

0 comments on commit ac33f7e

Please sign in to comment.