From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25478 invoked by alias); 30 Sep 2016 15:38:18 -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: 39523 Received: (qmail 9426 invoked from network); 30 Sep 2016 15:38:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f54.google.com 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(209.85.220.54):SA:0(0.0/5.0):. Processed in 0.802452 secs); 30 Sep 2016 15:38:18 -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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=HD4Un+/rFlK39vRqkDm34VB7SXOklt28ALMu2aaPTQw=; b=fEpM+/tuqFlTxhfRv8HjaLF/ZNtkYPZ3p1Mpf7D7Qr74aaVQpiFHaa4NjeRFUP5kGU mDDjonx72IbRqWLCyxCoIL6DpIh15RUkCOLOvT9KPzJbx0ZWLbxoQjtXPvzieJdWzVOo GT1iNW0vkFYTxnu2mC+CF37u8XPLLxaitnqKbfLhuuzXKtuDkSE6Xv3jn9CNnEhMmac6 R/nbD3fYWoi/50qbuJDFfwnBqBlVwZDBdZOm4ao1hIwFyCpwm5WVM0y2TdekKP33jrSX DUP4K4F/6n98trWR8FTETP4w1UUZwp2x0IwCUzyv2Fbjij+Uh3kT1sDmaxRJRjradVKw k0Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=HD4Un+/rFlK39vRqkDm34VB7SXOklt28ALMu2aaPTQw=; b=f/LrZ4+HcKPnnPpJv7J8RWXfH+ocyvjuJnnnQadkpkp7E9mjSw29dP5IeZ8Jr0olRS dCNb1rO3+kSf9hfRz3hWxE6zKixyEBWg7GJgXKEP3OYxRXu3bG1iVD9GL+frneZGRFn1 xhqy+r1RD7jqi9n+zqyi3s6lzPgdFdxHi+SVjesC5Rz33Wql/+LZZ5wKJwasUK8uZB1Z osHYpCVSYU3F1BidRZjmTCeer+4uE1CIPARc1F1odpu8AzG56HSWAwJBQdD0R8rqf9Lf sE0xBW8n0wpt35xUWAngpxOAHFWNFSviCE+Bm/tPpr0Mar+IZr3sSElbUspOtpbCANDl FnVQ== X-Gm-Message-State: AA6/9Rna13KrB5stNxXthh0gkLBQSj9nR2MSSn4PuzKXtbk56DXXlijULnzKFbX1An4FXA== X-Received: by 10.66.218.39 with SMTP id pd7mr12712666pac.9.1475249442031; Fri, 30 Sep 2016 08:30:42 -0700 (PDT) From: Bart Schaefer Message-Id: <160930083101.ZM16318@torch.brasslantern.com> Date: Fri, 30 Sep 2016 08:31:01 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug" (Sep 30, 8:03am) References: <160929001004.ZM27686@torch.brasslantern.com> <160929145022.ZM12459@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 30, 8:03am, Sebastian Gniazdowski wrote: } Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, } } > Your autoload wrapper that sets up the "local FPATH" needs to store } > the FPATH value for each module somewhere } } This would lead to aliases? The autoloaded function would have to have } "autoload" calls translated into "zplg_autoload" calls. [...] } I could also make autoload wrapper continuously active in Zsh session } but that doesn't look nice to me. The wrapper would have to change so that it does the full monty only when called in a known module context. (Which returns to the question of whether that can be discovered at the right time.) } Having fpath-extending loading support in place doesn't mean that } clean-FPATH goal will not be reached. It's your software, make the design decision that you think best! } Btw. I've stumbled upon following code in execcmd / exec.c:3054: } } } else if (is_shfunc || type == WC_AUTOFN) { } Shfunc shf; } if (is_shfunc) } shf = (Shfunc)hn; } else { } shf = loadautofn(state->prog->shf, 1, 0); } } Is this the place where autoload-marked functions are differentiated } from manual-autoload-stub functions? It's the place where already-defined functions (stub or otherwise) are differentiated from autoloads that still need to be pulled in.