From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4577 invoked by alias); 20 Sep 2015 01:28:30 -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: 20605 Received: (qmail 3845 invoked from network); 20 Sep 2015 01:28:27 -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=T/C1EZ6Q c=1 sm=1 tr=0 a=Qosx6O6xXGET3N4RHWVm7w==:117 a=Qosx6O6xXGET3N4RHWVm7w==:17 a=N659UExz7-8A:10 a=MLPBSgAzpYwNC-O-wssA:9 a=pILNOxqGKmIA:10 Message-id: <55FE04AD.1070304@eastlink.ca> Date: Sat, 19 Sep 2015 17:58:21 -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: <55FAE223.2080502@eastlink.ca> <150917103419.ZM10067@torch.brasslantern.com> <150918171441.ZM27212@torch.brasslantern.com> <55FD7982.9030505@eastlink.ca> <150919092922.ZM28214@torch.brasslantern.com> <55FDA5D3.9020304@eastlink.ca> <150919142243.ZM23634@torch.brasslantern.com> In-reply-to: <150919142243.ZM23634@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 09/19/2015 02:22 PM, Bart Schaefer wrote: > As I've pointed out, these are exactly the same as > > zcompile /Functions/Functions.zwc /Functions/* > FPATH=/Functions/Functions.zwc autoload +X -w /Functions/Functions.zwc > > Although the better practice would be to do > > zcompile /Functions.zwc /Functions/* > FPATH=/Functions.zwc autoload +X -w /Functions.zwc By gum it works if you get it exactly right: -"zcompile ... (N-.:t)" ... or it barfs if there's a directory on the same path. Fussy fussy. -"autoload +X -w ..." works with Sebastian's, but not with mine (which are all functions). -"autoload -w ..." works with mine but not Sebastian's. -"source miscfunctions" *before* calling an autoloaded function to have it work the first time. -Append new dirs to FPATH or other things break. > if not because of the way fpath is searched, then for the same reason that > you shouldn't do > > tar -c /Functions/Functions.tar /Functions/* ... and most importantly, follow this advice, or if you rerun zcompile where there's already a .zwc, it rather dumbly tries to eat it's own tail and build itself into itself and nothing works. I guess the zcompile of my dreams would be able to process both scripts and functions in one go, and be able to see the functions in 'miscfunctions' regardless of the filename, and not try to digest existing .zwc's, and not worry about directories. And the autoload of my dreams would be able to pass all of it back every time. Best to leave it to zsh internals it's too fragile for anything else. Apologies to the list for all this.