Skip to content

Commit

Permalink
Fix '.search also' with /handler config=full or existing
Browse files Browse the repository at this point in the history
Make .expand* keys use relative paths if the original path was relative.

Signed-off-by: Fritz Webering <[email protected]>
  • Loading branch information
fritzw committed Mar 9, 2022
1 parent b79c4c5 commit 61be7cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ lot of contributed changes. Thanks to everyone who volunteered their time!
case the value is undefined instead of a `\relax`ed csname. It has always been
semantically wrong to assign to the result of `\pgfkeysgetvalueof`, but now it
will have undesired side-effects. Therefore this change is breaking.
- If `/handler config=full or existing` is active, `/.style={...}` assignments
can now fail if the style is not found in any `.search also` path. Previously,
the style was always set in the first search path, if it was not found in the
currently active path.

### Added

Expand Down Expand Up @@ -74,6 +78,7 @@ lot of contributed changes. Thanks to everyone who volunteered their time!
- Form-only patterns have no specified color #1122
- Make `graphdrawing` work with `name prefix` and `name suffix` options #1087
- pgfkeys was a bit too relaxed around `\relax` #1132
- Fix `.search also` when `/handler config=full or existing` is active #1143

### Changed

Expand All @@ -90,6 +95,7 @@ lot of contributed changes. Thanks to everyone who volunteered their time!

- 3geek14
- BeneIII
- Fritz Webering
- graue70
- Gábor Braun
- Joel Coffman
Expand Down
8 changes: 7 additions & 1 deletion tex/generic/pgf/utilities/pgfkeys.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,13 @@
\pgfkeys{/handlers/.expand twice/.code=\expandafter\expandafter\expandafter\pgfkeys@exp@call\expandafter\expandafter\expandafter{#1}}
\pgfkeys{/handlers/.expanded/.code=\edef\pgfkeys@temp{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}}

\long\def\pgfkeys@exp@call#1{\pgfkeysalso{\pgfkeyscurrentpath={#1}}}
\long\def\pgfkeys@exp@call#1{%
\ifpgfkeysaddeddefaultpath% If the original key was a relative path, do the expanded assignment also with a relative path
\pgfkeys@pathtoks{}%
\expandafter\pgfkeys@splitter\pgfkeyscurrentkeyRAW//% Removes the /.expand* component of the original relative key.
\fi
\pgfkeysalso{\pgfkeyscurrentpath={#1}}%
}

\def\pgfkeys@mathparse{%
\pgfkeys@ifcsname{pgfmathparse}{%
Expand Down

0 comments on commit 61be7cd

Please sign in to comment.