zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
Date: Fri, 30 Sep 2016 06:49:41 +0000	[thread overview]
Message-ID: <20160930064941.GA23665@fujitsu.shahaf.local2> (raw)
In-Reply-To: <160929145022.ZM12459@torch.brasslantern.com>

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.
> 


  parent reply	other threads:[~2016-09-30  7:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 22:07 Sebastian Gniazdowski
2016-09-27  7:05 ` Daniel Shahaf
2016-09-27  7:54   ` Sebastian Gniazdowski
2016-09-29  7:10 ` Bart Schaefer
2016-09-29  9:42   ` Sebastian Gniazdowski
2016-09-29 10:05     ` Sebastian Gniazdowski
2016-09-29 13:58   ` Sebastian Gniazdowski
2016-09-29 21:50     ` Bart Schaefer
2016-09-30  6:03       ` Sebastian Gniazdowski
2016-09-30 15:31         ` Bart Schaefer
2016-09-30 17:41           ` Sebastian Gniazdowski
2016-09-30 17:53             ` Sebastian Gniazdowski
2016-09-30 20:13             ` Bart Schaefer
2016-09-30  6:49       ` Daniel Shahaf [this message]
2016-09-30 18:16         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160930064941.GA23665@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).