From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13776 invoked from network); 16 Jul 2008 01:40:13 -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; 16 Jul 2008 01:40:13 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 19049 invoked from network); 16 Jul 2008 01:40:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Jul 2008 01:40:06 -0000 Received: (qmail 4797 invoked by alias); 16 Jul 2008 01:40:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25284 Received: (qmail 4784 invoked from network); 16 Jul 2008 01:40:02 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Jul 2008 01:40:02 -0000 Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by bifrost.dotsrc.org (Postfix) with ESMTP id 74A8380525AB for ; Wed, 16 Jul 2008 03:39:58 +0200 (CEST) Received: from torch.brasslantern.com ([71.121.3.246]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K4200CG2SME0515@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 15 Jul 2008 20:39:51 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m6G1dnqD010579 for ; Tue, 15 Jul 2008 18:39:50 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m6G1dmIK010578 for zsh-workers@sunsite.dk; Tue, 15 Jul 2008 18:39:48 -0700 Date: Tue, 15 Jul 2008 18:39:48 -0700 From: Bart Schaefer Subject: Re: Feature suggestion for autoload In-reply-to: <2d460de70807151010m344b9a7dmeaca569f538b51c8@mail.gmail.com> To: "Zsh hackers list" Message-id: <080715183948.ZM10577@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <2d460de70807151010m344b9a7dmeaca569f538b51c8@mail.gmail.com> Comments: In reply to "Richard Hartmann" "Feature suggestion for autoload" (Jul 15, 7:10pm) X-Virus-Scanned: ClamAV 0.92.1/7721/Tue Jul 15 23:10:03 2008 on bifrost X-Virus-Status: Clean On Jul 15, 7:10pm, Richard Hartmann wrote: } } I just wanted to put some functions in an extra folder & autoload } them, but I don't have my ZSH book here so I could not look up } the snippet to autoload all functions in a directory. Er, how would you do anything *else* to all the files in a directory? OK, so it's not *quite* that easy because you need file base names, but even if you can't remember fpath+=(thedirectory) autoload thedirectory/*(:t) then it still shouldn't be too hard to think of fpath+=(thedirectory) cd thedirectory autoload * cd - Some people make all/only the autoloadable functions executable so that they can use autoload *(*) } This has got me thinking about an extra option for autoload which } allows you to autoload all functions in a directory. "autoload" is just an alias for "typeset -fu" ... I'm excited neither about making it a separate implementation nor about teaching typedef how to read directories. } Additionally, an option to autoload everything it finds could be } useful for some though I doubt I would use it. "Finds" where? Anyway, have a look at the zcompile builtin ... } Another option would be to define an array and load everything } in said array. This could make a long list os autoloads more } readable. Yes, you can certainly do that. There's no practical limit on the number of function names you can pass to a single autoload command.