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

[pgfkeys] Obsolete \pgfkeys@ifcsname and use \ifcsname? #863

Closed
muzimuzhi opened this issue May 25, 2020 · 3 comments
Closed

[pgfkeys] Obsolete \pgfkeys@ifcsname and use \ifcsname? #863

muzimuzhi opened this issue May 25, 2020 · 3 comments

Comments

@muzimuzhi
Copy link
Member

When reading pgfkeys.code.tex, I find the use of \pgfkeys@ifcsname. Considering

  1. There is already a safe guard in pgfkeys.code.tex which requires etex v2.
  2. There is one direct use of \ifcsname in pgfkeys.code.tex.
  3. Another etex primitive \scantokens is directly used (see 187f5f4) and its wrapped name \pgfutil@scantokens is made obsolete.

\ifx\PackageError\undefined
\def\pgfkeys@error#1{\errmessage{Package pgfkeys Error: #1}}%
\else
\def\pgfkeys@error#1{\PackageError{pgfkeys}{#1}{}}%
\fi
\ifx\eTeXrevision\undefined%
\pgfkeys@error{PGF requires etex in extended mode}%
\csname @@end\expandafter\endcsname\expandafter\end%
\fi
\ifnum\eTeXversion<2
\pgfkeys@error{PGF requires etex version 2}%
\csname @@end\expandafter\endcsname\expandafter\end%
\fi
\expandafter\let\expandafter\pgfkeys@ifcsname\csname ifcsname\endcsname%

Can we obsolete \pgfkeys@ifcsname and use \ifcsname directly and consistently? (I should be confident enough to just open a PR. hmmm)

@Mo-Gul Mo-Gul added the pgfkeys label May 25, 2020
@hmenke
Copy link
Member

hmenke commented May 25, 2020

Using \ifcsname everywhere should be fine (probably just forgot that when transitioning to eTeX), \scantokens I'd like to avoid whenever possible, because it has too many gotchas.

hmenke added a commit that referenced this issue May 25, 2020
This was only an alias for \ifcsname anyway and is luckily supported by
all formats (looking at you, ConTeXt).
@hmenke hmenke closed this as completed May 25, 2020
@muzimuzhi
Copy link
Member Author

Thanks.

@hmenke
Copy link
Member

hmenke commented May 26, 2020

Feel free to suggest more eTeX optimizations where you see fit. You can always open a PR. If you check the backlog, you'll see that most of them got accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants