From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7851 invoked by alias); 14 Sep 2015 03:34:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20557 Received: (qmail 415 invoked from network); 14 Sep 2015 03:34:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=WjPuXXxkKUzWj4DQY7DNGQ==:117 a=WjPuXXxkKUzWj4DQY7DNGQ==:17 a=N659UExz7-8A:10 a=awkzoRJ7DjlNZWZgN-IA:9 a=pILNOxqGKmIA:10 Message-id: <55F6403A.1000401@eastlink.ca> Date: Sun, 13 Sep 2015 20:34:18 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: autoload References: <55F465E6.1040405@eastlink.ca> <2125131442086868@web14o.yandex.ru> <55F4930A.40608@eastlink.ca> <150912151040.ZM12254@torch.brasslantern.com> <55F4AF59.70606@eastlink.ca> <150912164339.ZM26555@torch.brasslantern.com> <55F62DA2.9090908@eastlink.ca> <150913193803.ZM25193@torch.brasslantern.com> In-reply-to: <150913193803.ZM25193@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 09/13/2015 07:38 PM, Bart Schaefer wrote: > Would it make more sense written like ${^fpath} ? It's the operator > that causes an array (a b c) to expand to e.g. a/* b/* c/* instead of > to a b c/* -- cf. the rc_expand_param setopt. Yikes, that's brand new to me, I only know the caret as negation. So this is a feature specific--it seems--to getting useful path expansion. Just echoing some dirs, I get the point loud and clear. That's powerful. > (N) means nonomatch, so empty directories disappear from the result > instead of causing a globbing error. (-) is follow symlinks, so that > combined with (N) any dangling symlinks also disappear. These both are > documented in the "Glob Qualifiers" subsection of the manual. Nuts, I scanned that page top to bottom looking at random, and there it is near the very bottom. 'NULL_GLOB' it says. Thanks for the explanation. > Well, yes, but that only autoloads Sebastian's navigation functions > (and any others whose names happen to start with "n-"). Of course, I'm just experimenting for now. Getting the feel ... > You don't autoload from a location, you autoload a name and the fpath > is searched for it. Ah! ... I'm subconsciously thinking in terms of finding commands. No! autoload /usr/local/share/zsh/site-functions/n-*(N-.:t) ... is a kind of trick--we are grabbing the names of files and using them as the names of functions to be found later, but we are NOT actually passing definitions. Yes? autoload n-list n-cd n-env n-kill n-panelize n-options n-aliases n-functions n-history n-preview ... is actually more 'honest' since all autoload really knows at that point is names. Definitions will be retrieved later. Yes? > (zcompile on the other hand DOES load from locations rather than from > a path search, so if you use zcompile + autoload -w you get the path > stripping.) > Sounds like a good idea, would that not be preferable? Why not prime the pump with both the name and the location? I'm over my head of course, but it seems that the '(...(N-.:t)' style command could notify autoload of both name and location in one go thus obviating the need to rummage through $fpath. As always, if that's not done there will be a good reason.