Peter Stephenson wrote on Wed, 18 Mar 2020 19:53 +0000: > On Wed, 2020-03-18 at 18:30 +0000, Daniel Shahaf wrote: > > How about adding a «function -T f { … }» syntax, that defines a > > function and enables tracing for it simultaneously? > > > > I've often found myself going to the first line of a function, copying > > its name, then going to the closing brace of the function and adding > > a «functions -T $thefunctionsname» statement there, in order to have > > tracing enabled during multiple «zsh -f» runs. > > > > It's backwards incompatible, but not more than «printf -v» was. > > Can't see any objection, and can't see an easy workaround. Thanks for the sanity check, Peter. Patch series attached. The first six patches are no-ops; the functional change is confined to the last three patches. Furthermore, patch #9 changes some of the lines added by patch #8, so y'all may find it easier to review the cumulative diff of those two patches¹ than to review them one by one. Regarding the man page patch, I wanted to have have the documentation of «function» hyperlink directly to the documentation of «typeset» (in the HTML/PDF output formats), but didn't figure out how to do this. > It does work for autoloads --- you can turn on xtrace before the > function is loaded. *nod* «autoload -T foo» and «autoload foo; functions -T foo» both work; however, in my use-cases I'm normally trying to trace a function that's defined in the middle of a *.zsh file that also defines multiple other functions. Cheers, Daniel ¹ For example, using «combinediff <8-9>*» or «git diff HEAD^^».