From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2609 invoked by alias); 15 Sep 2015 16:18:27 -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: 20565 Received: (qmail 6057 invoked from network); 15 Sep 2015 16:18:25 -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=XqQIf2Mky6v53ckUBHyIcw==:117 a=XqQIf2Mky6v53ckUBHyIcw==:17 a=N659UExz7-8A:10 a=UsaxdeaqH_grAdwzg7sA:9 a=pILNOxqGKmIA:10 Message-id: <55F844CD.9030004@eastlink.ca> Date: Tue, 15 Sep 2015 09:18: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: <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> <150913193803.ZM25193@torch.brasslantern.com> <55F6403A.1000401@eastlink.ca> <150914132113.ZM26035@torch.brasslantern.com> <55F786EC.2080007@eastlink.ca> <150914204803.ZM26255@torch.brasslantern.com> In-reply-to: <150914204803.ZM26255@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 09/14/2015 08:48 PM, Bart Schaefer wrote: > On Sep 14, 7:48pm, Ray Andrews wrote: > } > } One more thing if you would Bart: get me started with combining zcompile > } with autoload as you mentioned. It sounds like a good idea but I can't > } find anything on it. Thanks, I'll throw myself at it. This sounds like very satisfying stuff for philosophical reasons--I prefer directness over convenience most of the time and an explicit statement of where functions actually are turns my crank. That's the reason I liked: autoload /usr/local/share/zsh/site-functions/n-*(N-.:t) ... because it's explicit. Alas it turns out to be disharmonious with the nature of the thing, like teaching a cat to fetch. > Finally, for Ray, you can for example replace your entire $fpath with > a single ZWC file: Marvelous: 6 HP-w5--5-Debian1 /aWorking/Zsh 2$ echo $fpath /usr/local/share/zsh/site-functions /usr/share/zsh/vendor-functions /usr/share/zsh/vendor-completions /usr/share/zsh/functions/Calendar /usr/share/zsh/functions/Chpwd /usr/share/zsh/functions/Completion /usr/share/zsh/functions/Completion/AIX /usr/share/zsh/functions/Completion/BSD /usr/share/zsh/functions/Completion/Base /usr/share/zsh/functions/Completion/Cygwin /usr/share/zsh/functions/Completion/Darwin /usr/share/zsh/functions/Completion/Debian /usr/share/zsh/functions/Completion/Linux /usr/share/zsh/functions/Completion/Mandriva /usr/share/zsh/functions/Completion/Redhat /usr/share/zsh/functions/Completion/Solaris /usr/share/zsh/functions/Completion/Unix /usr/share/zsh/functions/Completion/X /usr/share/zsh/functions/Completion/Zsh /usr/share/zsh/functions/Completion/openSUSE /usr/share/zsh/functions/Exceptions /usr/share/zsh/functions/MIME /usr/share/zsh/functions/Misc /usr/share/zsh/functions/Newuser /usr/share/zsh/functions/Prompts /usr/share/zsh/functions/TCP /usr/share/zsh/functions/VCS_Info /usr/share/zsh/functions/VCS_Info/Backends /usr/share/zsh/functions/Zftp /usr/share/zsh/functions/Zle ... is deeply disturbing on principal, I don't want my shell searching the world for my functions, I want it to *know* where they are and $fpath is a study in obfuscation. It is information that subtracts from knowledge. > > # Assume starting here with the default $fpath > zsh_default_functions=~/.zsh-default-functions.zwc > if ! zcompile -t $zsh_default_functions >&/dev/null > then > # File is missing or out of date. Rebuild it. > # Removes the file if any function cannot be compiled. > zcompile $zsh_default_functions $^fpath/*(N.:A) > fi > if [[ -f $zsh_default_functions ]] > then > fpath=( $zsh_default_functions ) > autoload -w $zsh_default_functions > fi > > Deep magic ... Arigato sensei