From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17256 invoked from network); 17 Jul 2008 00:55:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Jul 2008 00:55:56 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 92912 invoked from network); 17 Jul 2008 00:55:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jul 2008 00:55:52 -0000 Received: (qmail 9887 invoked by alias); 17 Jul 2008 00:55:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25288 Received: (qmail 9875 invoked from network); 17 Jul 2008 00:55:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Jul 2008 00:55:50 -0000 Received: from mx.spodhuis.org (redoubt.spodhuis.org [193.202.115.177]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 261A880525AB for ; Thu, 17 Jul 2008 02:55:46 +0200 (CEST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=d200803; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=WbyIU+kN+pR3FogR4Mv4PwBATz2MMmS2Vi2fLogocjLkJZ5TpKjyC3iT9SzgMPeTwqvfBdWmsCFGZ4BQYRn+vSwPZlYV7USpDatrvC1fWv4aakccCrv9HvEjUHCrYTG4gL/PDwX2V3HiRLC5HwSC/XCtNIv8xb6EJRhtEfIE8zw=; Received: by smtp.spodhuis.org with local id 1KJHmX-000A4j-D4; Thu, 17 Jul 2008 00:55:41 +0000 Date: Wed, 16 Jul 2008 17:55:41 -0700 From: Phil Pennock To: Richard Hartmann Cc: Zsh hackers list Subject: Re: Feature suggestion for autoload Message-ID: <20080717005541.GA38626@redoubt.spodhuis.org> Mail-Followup-To: Richard Hartmann , Zsh hackers list References: <2d460de70807151010m344b9a7dmeaca569f538b51c8@mail.gmail.com> <080715183948.ZM10577@torch.brasslantern.com> <2d460de70807161644u483c2c33l53734590710102d6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d460de70807161644u483c2c33l53734590710102d6@mail.gmail.com> X-Virus-Scanned: ClamAV 0.92.1/7731/Thu Jul 17 02:00:00 2008 on bifrost X-Virus-Status: Clean On 2008-07-17 at 01:44 +0200, Richard Hartmann wrote: > What I meant was 'autoload every file you find in fpath'. That suggestion > is moot now, though. While it may be moot, this might be helpful anyway. You might want to look at the demonstration start-up files supplied with zsh. StartupFiles/ sub-directory of the source, no idea what any given distribution does with them. The provided example to do just this is: ----------------------------8< cut here >8------------------------------ # Autoload all shell functions from all directories in $fpath (following # symlinks) that have the executable bit on (the executable bit is not # necessary, but gives you an easy way to stop the autoloading of a # particular shell function). $fpath should not be empty for this to work. for func in $^fpath/*(N-.x:t); autoload $func ----------------------------8< cut here >8------------------------------ My preferred OS (FreeBSD) happens to not preserve executability on the zsh-supplied files for the Port, so I end up with: autoload ${^fpath}/*(N-.:t) typeset -U fpath fpath=(~/bin/zsh-funcs $fpath) set -A _foo ~/bin/zsh-funcs/*(N-.x:t) [[ ${#_foo} -gt 0 ]] && autoload $_foo unset _foo Just two examples. -Phil