From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16943 invoked by alias); 14 Sep 2015 02:38:11 -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: 20556 Received: (qmail 15119 invoked from network); 14 Sep 2015 02:38:10 -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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=tjF58Ee+eNxoIHqxbgppgPQqeCWE3fcFveM1oqvghV0=; b=KywkzikQwAIpszAK1LKaYhqXPVA0G/fNvrPnrGGul6DPmuGCTZAVZqly3458CAFbNZ VU7h5YJsbUtEf/h4Uzn1Ho/tePB2jZ85FLM18O2EJQsUzDpPgx5j4DIfCpajKOwZ76JG bAqr+IyKFmaS6LIUFAvpT7eXDUWBjAVh6mfUt2dPmO6NzvVeJlZihhjwOqkyvlk6aO+D p6kdeftSRIEhkwNfK8wY83BdIPJF/z7HwSeq+7yWVVfL6y2LVQ4iwS8zfowju144uU+7 h8YTxigeNYkSHfIP1myDOtSIy7Mw1dmWKnL4VKYiYjujGfgmz0jq+2OSKbCNQx1E0dWM YM9Q== X-Gm-Message-State: ALoCoQlQFc8maT1vrvLjLPQL2k9xcbRJ18JPIlnudmFMkQrsYa7ssVyONY/Wi/08M4xe4qaBnVIy X-Received: by 10.202.81.75 with SMTP id f72mr7704332oib.45.1442198286389; Sun, 13 Sep 2015 19:38:06 -0700 (PDT) From: Bart Schaefer Message-Id: <150913193803.ZM25193@torch.brasslantern.com> Date: Sun, 13 Sep 2015 19:38:03 -0700 In-Reply-To: <55F62DA2.9090908@eastlink.ca> Comments: In reply to Ray Andrews "Re: autoload" (Sep 13, 7:14pm) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: autoload MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 13, 7:14pm, Ray Andrews wrote: } } Tightening up my understanding of this a bit ... } } > autoload $^fpath/*(N-.:t) } ... works fine, but what does the caret do? 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. } Also I think I recognize the '(N-.:t)' as a globbing modifier, and I } know the '.' and } the ':t' but I can't find any info on the 'N-' (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. } autoload /usr/local/share/zsh/site-functions/n-*(N-.:t) Well, yes, but that only autoloads Sebastian's navigation functions (and any others whose names happen to start with "n-"). } Interesting that autoload must have the } path stripped off for it. Why wouldn't it know to do that automatically? You don't autoload from a location, you autoload a name and the fpath is searched for it. It would be misleading for autoload to discard a directory which is passed to it in favor of one that appears earlier in the fpath array, so you have to explicitly do so if that's what you intend. (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.)