Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
- X-seq: zsh-workers 39499
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
- Date: Thu, 29 Sep 2016 15:58:51 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=X+3DbrwPgW3qdXKvTILAo9vuV9y9tnHTNS3hLXKeFxQ=; b=h5XZTXsweZjTUk7zxpVSiHtq6DHD9PyoVaJVci8WjDbCcq3OIWL2BNBqiWInUXcnzQ rF6+DZCbbCLrEf33fCCFZu/n/xZxF4/qEicqLpkmtUUPOrOzB309jqpV0h+nSSVDxve6 d9Ook2O/xeeMXX3g7/0V5TeRbCpnMILz6XWU4WcY2jwewLDB3iGOASYCNpv+p8HDHBku QqY2UngSEUXq80WEjKAC/sPlbqGRWfBEXTThYDl9Cbp8hI4Nd2V2qcTsRo/mqH8QqC3h bfOZn4EaDKkFItUD0T4jx3qxBJC+0zx4pCQyPbEIcm3UjOPUiHjl/Z8S6fXgpK/cMBox CW6g==
- In-reply-to: <160929001004.ZM27686@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCXq6jQe2gF-Hb4UFBx7UXxRE=3_8Z2Oyq-H6d0LoNLAA@mail.gmail.com> <160929001004.ZM27686@torch.brasslantern.com>
On 29 September 2016 at 09:10, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 27, 12:07am, Sebastian Gniazdowski wrote:
> }
> } eval "function $func {
> } local FPATH="$PLUGIN_DIR":"${FPATH}"
> } builtin autoload -X ${opts[*]}
> } }"
> }
> } What I astonishingly realized today is that functions autoloaded this
> } way can further use autoload builtin purely normally. FPATH visible
> } from the specially-autoloaded function is modified, has the required
> } added component, and builtin autoload works as expected (even with
> } <5.1 Zsh, it has a more specific manual autoload stub).
>
> This will be the case as long as the autoload command AND the first
> run of the normally-autoloaded function BOTH happen during the FIRST
> run of the "specially-loaded" function.
Now I can easily parse what you wrote (the call stacks were heavy)
after I've added fprintf() to builtin.c / typeset_single. Indeed, it
is called before first run of special-autoloaded functions. On second
run there's no "local FPATH" being run, and further-autoloaded
functions are not found. I simplified my test case and just run uizcm
twice. During second run new autoload functions aren't resolved. Turns
out a normal fpath-extending loading support is needed for Zplugin,
unless a creative solution is found
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author