From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2696 invoked from network); 16 Aug 2001 08:06:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Aug 2001 08:06:21 -0000 Received: (qmail 25560 invoked by alias); 16 Aug 2001 08:06:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15638 Received: (qmail 25547 invoked from network); 16 Aug 2001 08:06:13 -0000 From: Sven Wischnowsky Message-ID: <15227.32487.365327.798594@gargle.gargle.HOWL> Date: Thu, 16 Aug 2001 10:05:59 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: zsh-workers@sunsite.dk Subject: PATCH: Re: Correction oddity In-Reply-To: <20010816001649.1729214284@pwstephenson.fsnet.co.uk> References: <20010815235013.940CD14284@pwstephenson.fsnet.co.uk> <20010816001649.1729214284@pwstephenson.fsnet.co.uk> X-Mailer: VM 6.92 under 21.1 (patch 3) "Acadia" XEmacs Lucid Peter Stephenson wrote: > ... > > finds _correct_group is 3; I presume this is the index of the -J or -V > argument in the compadd command, > > compadd -M m:{a-zA-Z}={A-Za-z} -M corrections \ > -X Completing corrections -M r:|[_-]=* r:|=* -D equal - > > and indeed it is that `-M' which should be -J or -V. Unfortunately it > becomes -M because there's no -J or -V in the argument list, and in that > case ${argv[(R)-*[JV]]} returns the first argument --- dunno if that's a > bug, it doesn't seem so hot, but it's presumably not the root bug. > Getting that test to check if the reverse match turned up something > sensible might be a start, but I'm way out of my depth. It's really the root bug. I didn't think of cases where there is no -[JV] passed to compadd. Ahem. Bye Sven Index: Completion/Base/Completer/_approximate =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_approximate,v retrieving revision 1.4 diff -u -r1.4 _approximate --- Completion/Base/Completer/_approximate 2001/08/07 10:38:36 1.4 +++ Completion/Base/Completer/_approximate 2001/08/16 08:03:05 @@ -59,7 +59,8 @@ PREFIX="(#a${_comp_correct})$PREFIX" # fi - (( $_correct_group )) && _correct_expl[_correct_group]=${argv[(R)-*[JV]]} + (( $_correct_group && $argv[(I)-*[JV]] )) && + _correct_expl[_correct_group]=${argv[(R)-*[JV]]} builtin compadd "$_correct_expl[@]" "$@" } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de