-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(decorations): expand pgfkeys
internals in error msg
#1083
Conversation
tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
Outdated
Show resolved
Hide resolved
tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
Outdated
Show resolved
Hide resolved
0a974ec
to
7943d07
Compare
Please don't merge. I need check a thing. |
Unfortunately, my last commit 7943d07 is not a solution. Here we face a usage
To continue with \pgfexpl@exp@args@@Ne\pgfkeys{key={arg1}{\unexpanded{arg2}}} Edit: Or, redefine |
Put it into another single key say |
% fully expand \pgfkeyscurrentname before being passed to | ||
% `/errors/unknown key` | ||
{\pgfexpl@exp@args@@Ne\pgfkeys{/errors/unknown | ||
key={/pgf/decoration/\pgfkeyscurrentname}{\unexpanded{#1}}}}},% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need \unexpanded
anyway we are better off using the more idiomatic /.expanded
.
% fully expand \pgfkeyscurrentname before being passed to | |
% `/errors/unknown key` | |
{\pgfexpl@exp@args@@Ne\pgfkeys{/errors/unknown | |
key={/pgf/decoration/\pgfkeyscurrentname}{\unexpanded{#1}}}}},% | |
{\pgfkeys{/errors/unknown | |
key/.expanded={/pgf/decoration/\pgfkeyscurrentname}{\unexpanded{#1}}}}},% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, you're right. Should I remove pgfutil-expl.tex
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please. We can do that later in a more coordinated fashion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunatly,
\pgfexpl@exp@args@@Ne\pgfkeys{key={... \pgfkeyscurrentname ...}}
and\pgfkeys{key/.expanded={... \pgfkeyscurrentname ...}}
are different. In the first case, value of \pgfkeyscurrentname
before this \pgfkeys
is used. While in the second case, value of \pgfkeyscurrentname
is updated to always hold .expanded
, the name of just parsed handler.
This change caused the PR failed to fix the original issue, see also #1082 (comment).
Fully expand `\pgfkeyscurrentname` before being used in first-arg of `/errors/unknown key`. Co-authored-by: Henri Menke <henri@henrimenke.de> Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
97233f2
to
cb21347
Compare
Fixed a raw use of `\unexpanded` introduced in pgf-tikz#1083, commit cb21347 Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Introduced by previous fix pgf-tikz#1083. Signed-off-by: Yukai Chou <muzimuzhi@gmail.com>
Motivation for this change
Implementation note:
Since
\pgfkeyscurrentname
would already been fully expanded in testers\pgfifdecoration
and\pgfifmetadecoration
, fully expansion, compared to one-step expansion, is also safe here.Fixes #1082
Checklist
Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead: