From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11515 invoked by alias); 3 May 2011 17:42:03 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29143 Received: (qmail 21439 invoked from network); 3 May 2011 17:42:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1fodzTfS/TrTd2RrINzh2rlwo5dQN34Lfe/YzjN3DPI=; b=vSarURjhURf4DV+DTHIXu/Mh1/FEeodkXS4bVrg5HXvuUo1NuarJMvbzppI6QioUbU u4oXQy1Z1lIKV7UEZeju3e60Czep69rCMlQaYcpTI3oFYlKSR7WiWZGqgUmW1+anG+6S qTGE5q3zDqaeDP/D3JYPzEmDfQPMCz943red8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ubAomjutdMcBoKc/X42XfKZQN21eQRN02krzTEYN3cl+iNx/3N0t9cqqDcl/I0IIcF Idi9yBSH7sufCIQ58fhSZHmdvgv/2C5VChj535swCYsw9iD/IZUEwNGnsBkjII974NEm gvoA4pkxxEhZBVNJ//syK1V4Bloyq32g8Nofk= MIME-Version: 1.0 In-Reply-To: <110503080432.ZM15979@torch.brasslantern.com> References: <110428203139.ZM11856@torch.brasslantern.com> <110502184235.ZM14465@torch.brasslantern.com> <110503073902.ZM15889@torch.brasslantern.com> <110503080432.ZM15979@torch.brasslantern.com> Date: Tue, 3 May 2011 20:41:55 +0300 Message-ID: Subject: Re: zle messes up 'words' variable? From: Felipe Contreras To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, May 3, 2011 at 6:04 PM, Bart Schaefer w= rote: > On May 3, =C2=A07:39am, Bart Schaefer wrote: > } > } ... bashcompinit has responsibility > } for loading the bash completion functions in a way that makes them > } compatible. =C2=A0That's not the same as first loading bashcompinit and > } then independently defining a new completion, though I lean toward > } the conclusion that use of the bash-compatible "complete" command is > } probably the correct place to fix this if it can be managed. > > Try this: > > Index: Completion/bashcompinit > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > diff -c -r1.2 bashcompinit > --- Completion/bashcompinit =C2=A0 =C2=A0 22 Jun 2004 07:53:03 -0000 =C2= =A0 =C2=A0 =C2=A01.2 > +++ Completion/bashcompinit =C2=A0 =C2=A0 3 May 2011 15:01:09 -0000 > @@ -120,7 +120,13 @@ > =C2=A0 =C2=A0 =C2=A0 ;; > =C2=A0 =C2=A0 =C2=A0 F) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 COMPREPLY=3D() > - =C2=A0 =C2=A0 =C2=A0 $OPTARG "${words[0]}" "${words[CURRENT-1]}" "${wor= ds[CURRENT-2]}" > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(){ > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set -- "${words[0]}" "${words[CURRENT= -1]}" "${words[CURRENT-2]}" > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# There may be more things we need to= add to this typeset to > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# protect bash functions from compsys= special variable names > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0typeset -h words > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$OPTARG "$@" > + =C2=A0 =C2=A0 =C2=A0 =C2=A0} > =C2=A0 =C2=A0 =C2=A0 =C2=A0results+=3D( "${COMPREPLY[@]}" ) > =C2=A0 =C2=A0 =C2=A0 ;; > =C2=A0 =C2=A0 =C2=A0 G) Yeap, that fixes it :) So I think this should be committed to zsh. Now, that's part a of the probl= em. Part b is how to workaround the issue in the current versions of zsh, which is what the git guys are trying to do: http://article.gmane.org/gmane.comp.version-control.git/172371 I guess simply setting 'typeset -h words' on the top-level function (_git) should do the trick. Cheers. --=20 Felipe Contreras