From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18104 invoked by alias); 17 Jan 2017 22:31:09 -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: 40376 Received: (qmail 18165 invoked from network); 17 Jan 2017 22:31:09 -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.7/5.0):. Processed in 1.69777 secs); 17 Jan 2017 22:31:09 -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.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-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= X-ME-Sender: X-Sasl-enc: j9XLZ+7BGI92GnFgCiCflwQf61ANe247bXZPy1+elST6 1484691686 Date: Tue, 17 Jan 2017 22:17:54 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: PATCH: autoload with explicit path Message-ID: <20170117221754.GA14818@fujitsu.shahaf.local2> References: <20161211221844.5e51affe@ntlworld.com> <161212080550.ZM935@torch.brasslantern.com> <20161212163124.6654f077@pwslap01u.europe.root.pri> <20170110193102.7725620a@ntlworld.com> <20170117183606.5d1db3de@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170117183606.5d1db3de@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.23 (2014-03-12) 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.)