diff --git a/doc/generic/pgf/CHANGELOG.md b/doc/generic/pgf/CHANGELOG.md index 345ecc3c1..5dfdb3341 100644 --- a/doc/generic/pgf/CHANGELOG.md +++ b/doc/generic/pgf/CHANGELOG.md @@ -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 diff --git a/testfiles/gh-1082.lvt b/testfiles/gh-1082.lvt new file mode 100644 index 000000000..6c5944753 --- /dev/null +++ b/testfiles/gh-1082.lvt @@ -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 diff --git a/testfiles/gh-1082.tlg b/testfiles/gh-1082.tlg new file mode 100644 index 000000000..3b40cd851 --- /dev/null +++ b/testfiles/gh-1082.tlg @@ -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 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. +============================================================ diff --git a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex index bfe8863ef..6714b75d6 100644 --- a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex @@ -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 diff --git a/tex/generic/pgf/utilities/pgfutil-context.def b/tex/generic/pgf/utilities/pgfutil-context.def index 66edb0980..b603f735e 100644 --- a/tex/generic/pgf/utilities/pgfutil-context.def +++ b/tex/generic/pgf/utilities/pgfutil-context.def @@ -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 diff --git a/tex/generic/pgf/utilities/pgfutil-latex.def b/tex/generic/pgf/utilities/pgfutil-latex.def index e88cfb942..94c611b2d 100644 --- a/tex/generic/pgf/utilities/pgfutil-latex.def +++ b/tex/generic/pgf/utilities/pgfutil-latex.def @@ -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 diff --git a/tex/generic/pgf/utilities/pgfutil-plain.def b/tex/generic/pgf/utilities/pgfutil-plain.def index 2d08c5303..68c6bdb0e 100644 --- a/tex/generic/pgf/utilities/pgfutil-plain.def +++ b/tex/generic/pgf/utilities/pgfutil-plain.def @@ -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