From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1762 invoked by alias); 30 Sep 2016 07:03:24 -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: 39511 Received: (qmail 26583 invoked from network); 30 Sep 2016 07:03:23 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.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(66.111.4.25):SA:0(0.0/5.0):. Processed in 0.598128 secs); 30 Sep 2016 07:03:23 -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: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=w8l1o6lqd4RkyO87H+3sL+B4/4I=; b=FL+MY5 P78JqELn+9chayGv3rHbMDCPUx0iY8EILsdKcCI0cOWFN+I1TlyqbFeIn+YQT4/7 pCUn8pqDY34RUYtTQJKtsx73XKPtAJdbI7PNvcunr97w8FdXVYx+PmcECM4zY7oh vJnVWE4kESEOpLsJ/bwqhvz/uTwT0t1w0QCG4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=w8l1o6lqd4RkyO87H+3sL+B4/4I=; b=ceasq kTcAbo46fqCoxYURQiJb7AK9gruhmRmQYKtD+k8Fb+9q8a0yolPZ2+8Kp86+vmNE wHRcpys2AHpNtorwI0w71kiPTIBPq1QqIC+Tmo3UW/36+fpGWspSxZsTF8BRH0y5 YELBln0pOI254gq3W1v9k1ZxlB4rT8N60cStO0= X-Sasl-enc: 2Htuq+lceuqQVw1M2FewvTjUgvGpHvSN4QQ8RraqfYbw 1475218267 Date: Fri, 30 Sep 2016 06:49:41 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug Message-ID: <20160930064941.GA23665@fujitsu.shahaf.local2> References: <160929001004.ZM27686@torch.brasslantern.com> <160929145022.ZM12459@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160929145022.ZM12459@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Thu, Sep 29, 2016 at 14:50:22 -0700: > On Sep 29, 3:58pm, Sebastian Gniazdowski wrote: > } > } Turns out a normal fpath-extending loading support is needed for > } Zplugin, unless a creative solution is found > > Your autoload wrapper that sets up the "local FPATH" needs to store > the FPATH value for each module somewhere, e.g., in a has indexed > on the module name, and then recall that every time another autoload > occurs from inside a function that was loaded from that module. Would it work to declare FPATH as a private in the wrapper? (Using zsh/param/private) Sebastian said on IRC it wouldn't work but I don't see why. > Whether it's possible to find that the name of the module at the > necessary time, is a harder question. In 5.3 "whence -v" will > reliably give you the path from which the function was loaded, but > it may not in earlier versions. >