From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7833 invoked from network); 26 Apr 2001 17:33:16 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Apr 2001 17:33:16 -0000 Received: (qmail 27580 invoked by alias); 26 Apr 2001 17:33:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14129 Received: (qmail 27567 invoked from network); 26 Apr 2001 17:33:08 -0000 From: "Bart Schaefer" Message-Id: <1010426173236.ZM17775@candle.brasslantern.com> Date: Thu, 26 Apr 2001 17:32:36 +0000 In-Reply-To: <1010426161153.ZM13644@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "PATCH: Re: New style completion bug when ctrl-C pressed" (Apr 26, 4:11pm) References: <1010426161153.ZM13644@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: martin.ebourne@arcordia.com, zsh-workers@sunsite.dk Subject: Re: PATCH: Re: New style completion bug when ctrl-C pressed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 26, 4:11pm, Bart Schaefer wrote: } } Try this. I'm not doing very well with my posted patches the last couple of days. } + trap '[[ -n "$redef" ]] && unfunction compadd' EXIT INT The trap doesn't execute in the local scope, so [[ -n $redef ]] always fails. Try this instead: diff -rux CVS zsh-forge/current/Completion/Base/Completer/_approximate zsh-4.0/Completion/Base/Completer/_approximate --- zsh-forge/current/Completion/Base/Completer/_approximate Mon Apr 2 04:05:44 2001 +++ zsh-4.0/Completion/Base/Completer/_approximate Thu Apr 26 10:31:02 2001 @@ -10,7 +10,7 @@ [[ _matcher_num -gt 1 || "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 -local _comp_correct _correct_expl comax cfgacc redef match +local _comp_correct _correct_expl comax cfgacc match local oldcontext="${curcontext}" opm="$compstate[pattern_match]" if [[ "$1" = -a* ]]; then @@ -48,7 +48,6 @@ # ignored prefix). if (( ! $+functions[compadd] )); then - redef=yes compadd() { [[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 && "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return @@ -61,6 +60,7 @@ # fi builtin compadd "$_correct_expl[@]" "$@" } + trap 'unfunction compadd' EXIT INT fi _comp_correct=1 @@ -92,7 +92,6 @@ [[ "$compstate[list]" != list* ]] && compstate[list]="$compstate[list] force" fi - [[ -n "$redef" ]] && unfunction compadd compstate[pattern_match]="$opm" return 0 @@ -102,7 +101,6 @@ (( _comp_correct++ )) done -[[ -n "$redef" ]] && unfunction compadd compstate[pattern_match]="$opm" return 1 -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net