Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Hooking up to function definition via module
- X-seq: zsh-users 22680
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Hooking up to function definition via module
- Date: Tue, 18 Apr 2017 10:23:46 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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