In an ideal world latex-ing this document
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pgfkeys{/a/.code=(a)}
\pgfkeys{/a}
\def\b{\pgfkeys{/a}}
\b
\edef\c{\pgfkeys{/a}}
\c
\end{document}
would create a document containg "(a)(a)(a)"... but in the real world the line "\edef\c{\pgfkeys{/a}}" puts PGF in a loop, and if I interrupt pdflatex or lualatex with a C-c I get this message:
! Interruption.
\pgfkeys@parse ...uturelet \pgfkeys@possiblerelax
\pgfkeys@parse@main
l.33 \edef\c{\pgfkeys{/a}
}
?
What is the recommended workaround?
Note: this is a minimal version of this other question: How do I send the result of \pgfkeys to Lua?
\pgfkeysin an\edef. Well, strictly speaking you can, but this will never set the key, because\edefdoesn't perform assignments. – egreg Nov 01 '22 at 09:27