I'm sure if you're reading this question you are already familiar with my love for pgfkeys
. However, it is absolutely impossible to debug: \tracingmacros
is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using \def
: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how \pgfk@try
or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation: \tracingmacros=1
and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing pgfkeys
into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
.show value
and so forth? You want to "watch it in action"?\def\a#1{\b#1} \def\b#1{\c#1} \def\c#1{d#1}
and called\a{x}
;\tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.pgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.