Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Hooking up to function definition via module



Hello,
I would like to receive a callback or something else, when a function is defined. For example, I can detect setopt by wrapping bin_setopt(), like this:

    Builtin bn = (Builtin) builtintab->getnode2(builtintab, "setopt");
    bn->handlerfunc = bin_setopt2;

So in theory I can analyze setopt arguments in bin_setopt2(), record which option is being set, even if it is already set to requested state, then call original bin_setopt().

I think I cannot do something similar with function redefinition/definition, because there isn't a builtin dedicated to this, so I cannot wrap that builtin. But maybe I'm wrong?

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author