From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2426 invoked from network); 17 Apr 2004 21:02:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Apr 2004 21:02:54 -0000 Received: (qmail 15325 invoked by alias); 17 Apr 2004 21:02:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19790 Received: (qmail 15289 invoked from network); 17 Apr 2004 21:02:49 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Apr 2004 21:02:49 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Apr 2004 21:2:49 -0000 Received: (qmail 26933 invoked from network); 17 Apr 2004 21:02:49 -0000 Received: from d287e.d.pppool.de (HELO athlon) (80.184.40.126) by a.mx.sunsite.dk with SMTP; 17 Apr 2004 21:02:02 -0000 Received: from opk by athlon with esmtp (masqmail 0.2.20) id 1BEx3V-2xP-00 for ; Sat, 17 Apr 2004 23:08:53 +0200 In-reply-to: <1040413053246.ZM20004@candle.brasslantern.com> From: Oliver Kiddle References: <1040410174430.ZM10891@candle.brasslantern.com> <1170.1081778412@athlon> <040412085942.ZM19035@candle.brasslantern.com> <3571.1081806187@athlon> <1040413053246.ZM20004@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: While we're on the subject of zcompile ... Date: Sat, 17 Apr 2004 23:08:53 +0200 Message-ID: <11370.1082236133@athlon> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.0 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.0 On 13 Apr, Bart wrote: > > I find the behavior of "zcompile -a" (with no arguments) to be extremely > annoying. There should be a way to say "dump all the functions you can, > and ignore the ones that are already loaded or can't be loaded" rather > than having it die entirely (blowing away the dump done so far) the first > time it encounters an un-dumpable function. It is annoying. I'd have thought it would make sense if `zcompile -c' alone only attempted to dump loaded functions and `zcompile -a' only attempted to dump not-loaded functions. Errors for functions which fail to load are more reasonable, though. > The questions are whether it's cur_add_func() that should be taught to > ignore the error, or build_cur_dump(), and whether it should happen any > time there are no arguments, or there should be a flag to cause errors > to be ignored. I'd vote for it happening any time. The zcompile completion was not completing functions after -a and is missing the fact that -k and -z options can be used more than once between listed functions so below is an update. This also avoids the irritating double filename completion. Oliver --- Completion/Zsh/Command/_zcompile 2001-04-02 13:32:47.000000000 +0200 +++ Completion/Zsh/Command/_zcompile 2004-04-17 23:03:57.000000000 +0200 @@ -3,23 +3,26 @@ local state line expl curcontext="$curcontext" ret=1 typeset -A opt_args -_arguments -C -s -A "-*" -S \ - '(-t -c -m -a)-U[don'\''t expand aliases]' \ +_arguments -C -s \ + "(-t -c -m -a)-U[don't expand aliases]" \ '(-t -M)-R[mark as read]' \ '(-t -R)-M[mark as mapped]' \ - '(-t -c -z -m -a)-k[ksh-style autoloading]' \ - '(-t -c -k -m -a)-z[zsh-style autoloading]' \ + '(-t -c -m -a)*-k[ksh-style autoloading]' \ + '(-t -c -m -a)*-z[zsh-style autoloading]' \ '(-t -U -z -k)-c[currently defined functions]' \ '(-t -U -z -k)-m[use names as patterns]' \ '(-t -U -z -k)-a[write autoload functions]' \ '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \ - ':zwc file:_files' \ + '(-M -R -U -a -c -m -t):file:->file' \ '*:function:->function' && ret=0 -if (( $+opt_args[-c] )); then +if [[ $state = function && -n $opt_args[(i)-[ac]] ]]; then _wanted functions expl 'function to write' compadd -k functions && ret=0 +elif [[ -n $opt_args[(i)-[tca]] ]]; then + _description files expl 'zwc file' + _files -g '*.zwc(-.)' "$expl[@]" && ret=0 else - _description files expl 'zsh source file' + _description files expl 'file' _files "$expl[@]" && ret=0 fi