-
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: add shortcuts to uninstallcommands #1160
Open
hmenke
wants to merge
7
commits into
pgf-tikz:master
Choose a base branch
from
hmenke:shortcuts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
53beee1
fix: add shortcuts to uninstallcommands
hmenke c137091
fixup! fix: add shortcuts to uninstallcommands
muzimuzhi 76d708c
fixup! fix: add shortcuts to uninstallcommands
muzimuzhi a26ef26
fixup! fix: add shortcuts to uninstallcommands
muzimuzhi d39c2a4
fixup! fix: add shortcuts to uninstallcommands
muzimuzhi e26218b
fixup! fix: add shortcuts to uninstallcommands
muzimuzhi 2f09b26
feat: allow simple picture nesting
muzimuzhi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
\documentclass{minimal} | ||
\input{pgf-regression-test} | ||
|
||
\RequirePackage{tikz} | ||
|
||
\begin{document} | ||
|
||
\START | ||
|
||
\def\myspecialsauce{\node{specialsauce}} | ||
|
||
\protected\long\def\ASSERTEQUAL#1#2{% | ||
\ifx#1#2\TRUE\else\FALSE\fi | ||
} | ||
\let\UNDEFINED\undefined | ||
\def\specialsauceOUTER{outer definition} | ||
|
||
|
||
\BEGINTEST{\tikzaddtikzonlycommandshortcutlet, undefined} | ||
\tikzaddtikzonlycommandshortcutlet{\specialsauce}{\myspecialsauce} | ||
\begin{tikzpicture} | ||
\specialsauce; | ||
\node at (0,1) {\ASSERTEQUAL\specialsauce\UNDEFINED}; | ||
\end{tikzpicture} | ||
\ENDTEST | ||
|
||
\BEGINTEST{\tikzaddtikzonlycommandshortcutlet, defined} | ||
\let\specialsauce\specialsauceOUTER | ||
\tikzaddtikzonlycommandshortcutlet{\specialsauce}{\myspecialsauce} | ||
\begin{tikzpicture} | ||
\specialsauce; | ||
\node at (0,1) {\ASSERTEQUAL\specialsauce\specialsauceOUTER}; | ||
\end{tikzpicture} | ||
\ENDTEST | ||
|
||
\BEGINTEST{\tikzaddtikzonlycommandshortcutdef, undefined} | ||
\tikzaddtikzonlycommandshortcutdef{\specialsauce}{\myspecialsauce} | ||
\begin{tikzpicture} | ||
\specialsauce; | ||
\node at (0,1) {\ASSERTEQUAL\specialsauce\UNDEFINED}; | ||
\end{tikzpicture} | ||
\ENDTEST | ||
|
||
\BEGINTEST{\tikzaddtikzonlycommandshortcutdef, defined} | ||
\let\specialsauce\specialsauceOUTER | ||
\tikzaddtikzonlycommandshortcutdef{\specialsauce}{\myspecialsauce} | ||
\begin{tikzpicture} | ||
\specialsauce; | ||
\node at (0,1) {\ASSERTEQUAL\specialsauce\specialsauceOUTER}; | ||
\end{tikzpicture} | ||
\ENDTEST | ||
|
||
\END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
This is a generated file for the l3build validation system. | ||
Don't change this file in any respect. | ||
============================================================ | ||
TEST 1: \tikzaddtikzonlycommandshortcutlet , undefined | ||
============================================================ | ||
TRUE | ||
============================================================ | ||
============================================================ | ||
TEST 2: \tikzaddtikzonlycommandshortcutlet , defined | ||
============================================================ | ||
TRUE | ||
============================================================ | ||
============================================================ | ||
TEST 3: \tikzaddtikzonlycommandshortcutdef , undefined | ||
============================================================ | ||
TRUE | ||
============================================================ | ||
============================================================ | ||
TEST 4: \tikzaddtikzonlycommandshortcutdef , defined | ||
============================================================ | ||
TRUE | ||
============================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This won't work because now
\ifdefined
is executed at the point where\tikzaddtikzonlycommandshortcutlet
is used. However at this point#2
might not be defined yet, so code like this will restore the wrong thingThere 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.
\ifdefined
always acts on#1
so when#2
is defined is irrelevant here and I suppose you want to sayOr maybe you noticed in the patch to uninstallcommands, we should check if
\tikz@orig#1
is defined.Anyway I find it suffices to just construct cs from
\csname tikz@orig ...\endcsname
before adding it to installcommands/uninstallcommands.