From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3740 invoked from network); 5 Dec 2003 10:21:18 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Dec 2003 10:21:18 -0000 Received: (qmail 12654 invoked by alias); 5 Dec 2003 10:20:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19276 Received: (qmail 12638 invoked from network); 5 Dec 2003 10:20:54 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Dec 2003 10:20:54 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Dec 2003 10:20:54 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-8.tower-36.messagelabs.com!1070619652!2298932 X-StarScan-Version: 5.1.13; banners=-,-,- Received: (qmail 12327 invoked from network); 5 Dec 2003 10:20:52 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-8.tower-36.messagelabs.com with SMTP; 5 Dec 2003 10:20:52 -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 hB5AKpuB007622 for ; Fri, 5 Dec 2003 10:20:52 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 hB5AOn202217 for ; Fri, 5 Dec 2003 11:24:49 +0100 X-VirusChecked: Checked X-StarScan-Version: 5.1.13; banners=.,-,- From: Oliver Kiddle To: zsh-workers@sunsite.dk Subject: PATCH: choice of completers from _prefix Date: Fri, 05 Dec 2003 11:24:49 +0100 Message-ID: <2212.1070619889@gmcs3.local> When _prefix was changed to do better looping over completers, _completer_num was declared local at the top and used for the looping. Unfortunately, _main_complete's _completer_num is used below this point to work out a completer list for when the style lookup fails. The result is _prefix defaulting to all completers following the last _prefix instead of those before the current. The simple fix below is to move the local declaration. Oliver Index: Completion/Base/Completer/_prefix =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_prefix,v retrieving revision 1.3 diff -u -r1.3 _prefix --- Completion/Base/Completer/_prefix 9 Jul 2003 15:53:25 -0000 1.3 +++ Completion/Base/Completer/_prefix 5 Dec 2003 10:14:27 -0000 @@ -5,7 +5,7 @@ [[ _matcher_num -gt 1 || -z "$SUFFIX" ]] && return 1 local comp curcontext="$curcontext" tmp suf="$SUFFIX" \ - _completer _completer_num \ + _completer \ _matcher _c_matcher _matchers _matcher_num zstyle -a ":completion:${curcontext}:" completer comp || @@ -18,7 +18,7 @@ fi SUFFIX='' -_completer_num=1 +local _completer_num=1 for tmp in "$comp[@]"; do if [[ "$tmp" = *:-* ]]; then