From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16568 invoked by alias); 17 Jul 2017 14:04:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41435 Received: (qmail 29490 invoked from network); 17 Jul 2017 14:04:14 -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 5.085685 secs); 17 Jul 2017 14:04:14 -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 (16) Date: Mon, 17 Jul 2017 15:50:58 +0200 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: Subject: Strange or interesting zcompile behavior, for in-loop func defs X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I've added debugging message in execfuncdef(): =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (state->prog->dump =7C=7C =21names) =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (=21names) =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =7D else =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf( stderr, = =22Have dump for: %s, file: %s=5Cn=22, s, state->prog->dump->filename); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fflush( stderr );= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prog->flags =3D E= =46=5FMAP; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 incrdumpcount(sta= te->prog->dump); It outputs: Have dump for: =5Fzsh=5Fhighlight=5Fwidget=5Fzle-isearch-update, file: /U= sers/sgniazdowski/.zplugin/lexicon.zwc The point is: this function is declared in a loop: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if =5B=5B =24cur=5Fwidget =3D=3D zle-* = =5D=5D && =5B=5B -z =24widgets=5B=24cur=5Fwidget=5D =5D=5D; then =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=5Fzsh=5Fhighlight=5Fwidget=5F=24= =7Bcur=5Fwidget=7D() =7B :; =5Fzsh=5Fhighlight =7D I do zcompile lexicon.zwc =7E/.zplugin/lexicon/*, the directory contains = function with the loop. Zcompile apparently picks up above function defin= ition. But from where it gets =24=7Bcur=5Fwidget=7D=3F This is a dynamic = data, established at runtime. The loop: https://github.com/zdharma/fast-syntax-highlighting/blob/07a76cd38123cac2= e76aca35c0258d62b18ab490/fast-syntax-highlighting.plugin.zsh=23L203-L240 -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org