From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26225 invoked from network); 1 Mar 2002 05:07:28 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 1 Mar 2002 05:07:28 -0000 Received: (qmail 22101 invoked by alias); 1 Mar 2002 05:07:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16748 Received: (qmail 22090 invoked from network); 1 Mar 2002 05:07:21 -0000 From: "Bart Schaefer" Message-Id: <1020301050708.ZM17810@candle.brasslantern.com> Date: Fri, 1 Mar 2002 05:07:07 +0000 In-Reply-To: <2301.1014830039@csr.com> Comments: In reply to Peter Stephenson "Completion after zle doesn't work" (Feb 27, 5:13pm) References: <2301.1014830039@csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Completion after zle doesn't work MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 27, 5:13pm, Peter Stephenson wrote: } Subject: Completion after zle doesn't work } } hangs until I type ^C. Unfortunately ^X? does something even more } disastrous (seems to mess up the tty), but I did get a 1/2 MB output The zle completion bug was introduced by Oliver in 16464. There's an infinite loop in _zle: while (( $#state )); do # ... (widget*) _wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0 [[ $st != *function ]] && continue ;& # ^^^^^^^^ Ooops! (function) _wanted -C "$context[1]" functions expl 'widget shell function' \ compadd -k functions && ret=0 ;; # ... esac 16464 removed `local st' but this code is still testing it and looping. I'm not sure exactly what's going on with ^X? there -- it appears that the interrupt is not being handled correctly; you can break out of the loop only when not doing _complete_debug. Anyway, here's the minimalist patch for _zle, but I'm not sure that it couldn't be done more cleanly some other way. Index: _zle =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Command/_zle,v retrieving revision 1.2 diff -c -r1.2 _zle --- _zle 2002/02/04 19:48:20 1.2 +++ _zle 2002/03/01 05:03:51 @@ -46,9 +46,9 @@ ;; (widget*) _wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0 - [[ $st != *function ]] && continue ;& (function) + [[ $state[1] != *function ]] || # Handle fall-through _wanted -C "$context[1]" functions expl 'widget shell function' \ compadd -k functions && ret=0 ;; -- 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