Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: autoload with explicit path
- X-seq: zsh-workers 40376
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: autoload with explicit path
- Date: Tue, 17 Jan 2017 22:17:54 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=IudMD/g6VvX9iGefKsAjvlkxihg=; b=G5tgdgXHSlfL8h/KPCgTq 3zBrqjEyAdAboFKzFGwUMm+w70ye3EE9fSwrGT1ZJk40cuxe8kbadZMv8/8RwlcI Ps+euy60FeG8cB7MFW0U3BbzK7w+46jkZHN7jP53PIiQ7kun552vyh85keRJfCYy i7VxpnztCEBW1+1ajbVnsM=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=IudMD/g6VvX9iGefKsAjvlkxihg=; b=pBS/dioNbafmGIEkPbfn TlcQNnOeNCo+K6y0fM2FLWQFm4vZL4pFyO1qBtIp5DYPmIXiCvhort+NkSYI15Tz KgHFoESSSgwV+nd/XiPKn6sLlvaIjJjmbJARqbOMqKPEBuPL9C2p9nKrKKndTtNF ktknXjbRmumcZqJtCGbV8SM=
- In-reply-to: <20170117183606.5d1db3de@pwslap01u.europe.root.pri>
- 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: <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>
Peter Stephenson wrote on Tue, Jan 17, 2017 at 18:36:06 +0000:
> autoload /path/to/foo
> autoload foo
>
> leaves foo marked as to be loaded from /path/to/foo. I should probably
> document this (and that therefore to unmark the path you need to
> unfunction). I think this is the right way of doing it as the explicit
> path should continue to override the more vague autoload with no path
> indicated, and this is safer in case some code decides it needs a
> function and inadvertently resets the path the user carefully decided to
> give the function.
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?
Just removing the $FPATH element containing the former foo/bar would
prevent foo/bar from autoloading functions that are only available in
that $FPATH element. (Which might be the system default $fpath dir)
I wonder if we need «autoload -d /qux foo/bar», or perhaps cause
«autoload /qux/./foo/bar» load a function named "foo/bar" (the idea of
assigning a meaning to /./ elements is borrowed from rsyncd.conf).
(I'm assuming «autoload foo/bar» is a first-class use-case.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author