Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: autoload with explicit path
- X-seq: zsh-workers 40378
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: autoload with explicit path
- Date: Wed, 18 Jan 2017 09:17:17 +0000
- Cms-type: 201P
- In-reply-to: <20170117221754.GA14818@fujitsu.shahaf.local2>
- 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
- Organization: Samsung Cambridge Solution Centre
- References: <20161211221844.5e51affe@ntlworld.com> <CGME20161212160617epcas2p16960e3d95c694147035f760090e6011b@epcas2p1.samsung.com> <161212080550.ZM935@torch.brasslantern.com> <20161212163124.6654f077@pwslap01u.europe.root.pri> <20170110193102.7725620a@ntlworld.com> <20170117183606.5d1db3de@pwslap01u.europe.root.pri> <20170117221754.GA14818@fujitsu.shahaf.local2>
On Tue, 17 Jan 2017 22:17:54 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Suppose $^fpath/foo/bar(N) has two matches, how do I explicitly autoload
> the second one? I.e., how do I disambiguate «autoload foo/bar» (with no
> leading slash) to load a particular copy of foo/bar?
You don't; the mechanism only applies to the last path component so it
will pick the latest version of "bar".
Applying resolution by means of searching along a path is exactly what
the existing $fpath mechanism is for; the new mechanism doesn't replace
that. It gives you direct access to functions if you know for a fact
you always want the files in a particular directory loaded. I'm
guessing this will usually apply to people's own private functions, and
it might in principle apply to an add-on that has its own ideas about
paths. It inevitably won't be a good match for finding / resolving
things that might be anywhere along a path. But we already have a
mechanism for that.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author