From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15023 invoked by alias); 18 Apr 2017 08:32:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22680 Received: (qmail 4161 invoked from network); 18 Apr 2017 08:32:30 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 2.17195 secs); 18 Apr 2017 08:32:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (17) Date: Tue, 18 Apr 2017 10:23:46 +0200 From: Sebastian Gniazdowski To: zsh-users@zsh.org Message-ID: Subject: Hooking up to function definition via module X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I would like to receive a callback or something else, when a function is = defined. =46or example, I can detect setopt by wrapping bin=5Fsetopt(), l= ike this: =C2=A0 =C2=A0 Builtin bn =3D (Builtin) builtintab->getnode2(builtintab, =22= setopt=22); =C2=A0 =C2=A0 bn->handlerfunc =3D bin=5Fsetopt2; So in theory I can analyze setopt arguments in bin=5Fsetopt2(), record wh= ich option is being set, even if it is already set to requested state, th= en call original bin=5Fsetopt(). I think I cannot do something similar with function redefinition/definiti= on, because there isn't a builtin dedicated to this, so I cannot wrap tha= t builtin. But maybe I'm wrong=3F --=C2=A0 Sebastian Gniazdowski psprint /at/ zdharma.org