From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21285 invoked from network); 14 Jan 2004 15:45:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Jan 2004 15:45:46 -0000 Received: (qmail 28931 invoked by alias); 14 Jan 2004 15:45:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19365 Received: (qmail 28901 invoked from network); 14 Jan 2004 15:45:13 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 14 Jan 2004 15:45:13 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 14 Jan 2004 15:45:12 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-11.tower-36.messagelabs.com!1074095108!3126022 X-StarScan-Version: 5.1.15; banners=-,-,- Received: (qmail 23466 invoked from network); 14 Jan 2004 15:45:08 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-11.tower-36.messagelabs.com with SMTP; 14 Jan 2004 15:45:08 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i0EFj7uB002555; Wed, 14 Jan 2004 15:45:07 GMT Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id i0EFnpI04046; Wed, 14 Jan 2004 16:49:51 +0100 cc: zsh-workers@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1040111175159.ZM20622@candle.brasslantern.com> From: Oliver Kiddle References: <1040111175159.ZM20622@candle.brasslantern.com> To: Bart Schaefer Subject: Re: Use of ${words[0]} in completion functions Date: Wed, 14 Jan 2004 16:49:51 +0100 Message-ID: <4044.1074095391@gmcs3.local> On 11 Jan, Bart wrote: > I just noticed that a couple of completion functions use ${words[0]} as > the command name. That's a little misleading -- and maybe even a bug > waiting to happen -- because $_comp_options contains NO_ksharrays, and > neither of these functions resets it. > > Completion/Unix/Type/_perl_modules:33: local perl=${words[0]%doc} perl_modules I'd agree that's potentially misleading. Patch below. > Completion/bashcompinit:123: $OPTARG "${words[0]}" "${words[CURRENT-1]}" "${words[CURRENT-2]}" There is an `emulate -L sh' in the function here so that looks right to me. Oliver Index: Completion/Unix/Type/_perl_modules =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_perl_modules,v retrieving revision 1.2 diff -u -r1.2 _perl_modules --- Completion/Unix/Type/_perl_modules 16 Apr 2002 07:48:46 -0000 1.2 +++ Completion/Unix/Type/_perl_modules 14 Jan 2004 15:40:46 -0000 @@ -30,7 +30,7 @@ _perl_modules_caching_policy fi - local perl=${words[0]%doc} perl_modules + local perl=${words[1]%doc} perl_modules if whence $perl >/dev/null; then perl_modules=_${${perl//[^[:alnum:]]/_}#_}_modules elif (( ${+commands[perl]} )); then