From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22971 invoked by alias); 12 Sep 2015 23:43:44 -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: 20547 Received: (qmail 3538 invoked from network); 12 Sep 2015 23:43:43 -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=qDbQsdxEhHJWG3qr1fJOS3We3AyTh7XGiZq/n+6WITY=; b=KERQiZhd4CoPHG9YqTHHhPRZR7G22yzt+ANsY/zZckyv5/E573GydMbSW4ki0kNMoy HBtmz6BijyfgWHjcdoshrRXLhTd1Ljxf5QEFxe9Pc6kYUEE1mD2TSPKaQEWOy24XcGbf 4kH/6zfuwMQhfVUiil7IucWcW/ASDV3Fsz/JnUkMnFa5nn1gw/6DlFK+wCTVs0HfLk9U PQh3tFpKn+QSfzw2H8Mmm7AdaPHvWJU/nO68k+85FVTvWLbB9qyocXXM1nY9bfn0+XP/ zr5sKERXW38fplezy58FeDvzoNk1o09PbbjsQJ0M0TtWFdkQ/VPsOxXqQ9IGz/O8aa1u 3+ZQ== X-Gm-Message-State: ALoCoQkExUuA6s8Txav2kXwGEZM/PYqkfISD+F+HfVfF3sT3BYMpmn37wVwhnI30Av6G9sEtNKU+ X-Received: by 10.60.37.106 with SMTP id x10mr4892534oej.69.1442101421158; Sat, 12 Sep 2015 16:43:41 -0700 (PDT) From: Bart Schaefer Message-Id: <150912164339.ZM26555@torch.brasslantern.com> Date: Sat, 12 Sep 2015 16:43:39 -0700 In-Reply-To: <55F4AF59.70606@eastlink.ca> Comments: In reply to Ray Andrews "Re: Announce of Zsh Navigation Tools" (Sep 12, 4:03pm) References: <55F465E6.1040405@eastlink.ca> <2125131442086868@web14o.yandex.ru> <55F4930A.40608@eastlink.ca> <150912151040.ZM12254@torch.brasslantern.com> <55F4AF59.70606@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Announce of Zsh Navigation Tools MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 4:03pm, Ray Andrews wrote: } } immediately makes me want do something like this: } } for aa in /aWorking/Zsh/Source/*; do autoload $aa; done } } ... remembering of course that things need to be rewritten to look like } scripts. As long as there is only one function per file, you don't need to rewrite them, just use ...; do autoload -k $aa; done The "ksh-style" of autoloading is to have one complete function definition in each file, including the "() { ... }" or "function { ... }" or whatever wrapping syntax. (Ksh does it this way because the syntax used to declare the function has an effect on its semantics.) } BTW, looking at $fpath, it sure is laborious. Do we, could we have some } sort of automatic subdirectory inclusion? I'm not sure what you mean by this, that is, are you trying to build up the value of $fpath or are you trying to find all the files in $fpath to autoload them? If you're running an installed zsh, of course, then $fpath should have all the necessary directories already (except e.g. personal ones in your home dir). If you're asking about constructing $fpath for a zsh build tree, then it should suffice to do: fpath=( $build_dir/Completion/**/*(/) $build_dir/Functions/**/*(/) $fpath ) where you will need to define $build_dir appropriately, maybe it is $PWD. Just be careful that you get the order right with respect to the default $fpath -- the default should come FIRST if you are running an installed shell. If you're asking about autoloading everything after $fpath has been defined, then this should work for the default paths: autoload $^fpath/*(N-.:t) However, as I said you may want to add -k for your personal files, which would need a second autoload command. Some people also prefer to throw a (*) into the glob flags so as to only autoload files that have been marked executable. Putting this together, something like: build_fpath=( $build_dir/Completion/**/*(/) $build_dir/Functions/**/*(/) ) my_fpath=( ~/zsh_functions/**/*(/) and so on ) autoload $^fpath/*(N-.:t) autoload $^build_fpath/*(N-.:t) autoload $^my_fpath/*(N-.:t) fpath=( $my_fpath $build_fpath $fpath ) -- Barton E. Schaefer