Skip to content
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 wrong key name in unknown decoration option error #1375

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Resolve missing `gnuplot` plots in manual #1238
- Treat varargs for `min()` and `max()` in `luamath` pgf library pgf-tikz/pgfplots#492 #1359
- Fixed support for the `\tikz` command in the `dvisvgm4ht` driver for TeX4ht
- Wrong key name in unknown decoration option error #1082

### Changed

Expand Down
15 changes: 15 additions & 0 deletions testfiles/gh-1082.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\documentclass{minimal}
\input{pgf-regression-test}

\usepackage{tikz}
\usetikzlibrary{decorations}

\START

\BEGINTEST{Unknown decoration option}
\tikzset{
decoration={segment length=5pt, red}
}
\ENDTEST

\END
15 changes: 15 additions & 0 deletions testfiles/gh-1082.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
============================================================
TEST 1: Unknown decoration option
============================================================
! Package pgfkeys Error: I do not know the key '/pgf/decoration/red' and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l. ...}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
============================================================
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@

\tikzset{decorate/.is if=tikz@decoratepath,
/pgf/decoration/name/.store in=\tikz@decoration@name,
/pgf/decoration/.unknown/.code=%
\pgfifdecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
{\pgfifmetadecoration{\pgfkeyscurrentname}{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
% Fully expand `\pgfkeyscurrentname' before being used in first-arg of
% `/errors/unknown key'.
{\pgfkeys{/errors/unknown
key/.expanded={/pgf/decoration/\pgfkeyscurrentname}{\pgfutil@unexpanded{#1}}}}},%
/pgf/decoration/.unknown/.code={%
\pgfifdecoration{\pgfkeyscurrentname}
{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
{\pgfifmetadecoration{\pgfkeyscurrentname}
{\edef\tikz@decoration@name{\pgfkeyscurrentname}}
% expand \pgfkeyscurrentname _before_ it's updated by nested \pgfkeys
{\pgfutil@expanded{\noexpand\pgfkeys{/errors/unknown key=
{/pgf/decoration/\pgfkeyscurrentname}{\pgfutil@unexpanded{#1}}}}}}%
},
/pgf/decoration/raise/.code={\def\tikz@dec@shift{\pgftransformyshift{#1}}\tikz@dec@trans},
/pgf/decoration/mirror/.code={%
\csname if#1\endcsname
Expand Down
4 changes: 3 additions & 1 deletion tex/generic/pgf/utilities/pgfutil-context.def
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@

\def\pgfutil@translate#1{#1} % \translate works very different in ConTeXt

% e-TeX primitives
% e-TeX primitives and beyond

\let\pgfutil@protected\normalprotected
\let\pgfutil@unexpanded\normalunexpanded
% the check for the availability of \expanded primitive is done in pgfkeys
\let\pgfutil@expanded\normalexpanded

\endinput
4 changes: 3 additions & 1 deletion tex/generic/pgf/utilities/pgfutil-latex.def
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@
\def\pgfutil@translate#1{\translate{#1}}
\fi

% e-TeX primitives
% e-TeX primitives and beyond

\let\pgfutil@protected\protected
\let\pgfutil@unexpanded\unexpanded
% the check for the availability of \expanded primitive is done in pgfkeys
\let\pgfutil@expanded\expanded

\endinput
4 changes: 3 additions & 1 deletion tex/generic/pgf/utilities/pgfutil-plain.def
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@

\def\pgfutil@translate#1{#1} % is there a translator package for plain?

% e-TeX primitives
% e-TeX primitives and beyond

\let\pgfutil@protected\protected
\let\pgfutil@unexpanded\unexpanded
% the check for the availability of \expanded primitive is done in pgfkeys
\let\pgfutil@expanded\expanded

\endinput
Loading