From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7609 invoked from network); 14 May 2002 08:06:52 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 May 2002 08:06:52 -0000 Received: (qmail 1585 invoked by alias); 14 May 2002 08:06:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17148 Received: (qmail 1564 invoked from network); 14 May 2002 08:06:38 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15584.50548.695771.69768@wischnow.berkom.de> Date: Tue, 14 May 2002 10:06:12 +0200 To: zsh-workers@sunsite.dk Subject: Re: tag-order problem In-Reply-To: <1021114086.27414.10.camel@localhost.localdomain> References: <1021114086.27414.10.camel@localhost.localdomain> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Borsenkow Andrej wrote: > Just found problem in my _service/_services > > _service calls _services to complete list of available services. Because > _services normally completes both init and xinetd, I presumed I could > limit matches by setting tag-order; in this case: > > zstyle :completion::complete:service:argument-1: tag-order init - > > (meaning - for the first argument of service somplete only tag `init'). > > It did restrict services set to init only - but it also stopped dead > options completion. > > Setting tags to `options init -' does allow options completion - both in > first and second word as well; [...] First, there was a buglet in _arguments that made option completion use a context name containing the `argument-1'. Then there was a buglet in _services because the loop wasn't left when completions were produced. That's the reason why it didn't do what it should without the `-' in tag-order. With the two fixes it now works nicely for me (without `-'). Bye Sven Index: Completion/Base/Utility/_arguments =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v retrieving revision 1.11 diff -u -r1.11 _arguments --- Completion/Base/Utility/_arguments 18 Feb 2002 14:27:38 -0000 1.11 +++ Completion/Base/Utility/_arguments 14 May 2002 08:03:32 -0000 @@ -335,9 +335,11 @@ [[ -z "$hasopts" && -z "$matched" && ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] && - { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || + { ! zstyle -T ":completion:${oldcontext%:*}:options" prefix-needed || [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then - local prevpre="$PREFIX" previpre="$IPREFIX" + local prevpre="$PREFIX" previpre="$IPREFIX" prevcontext="$curcontext" + + curcontext="${oldcontext%:*}:options" hasopts=yes @@ -389,6 +391,7 @@ fi PREFIX="$prevpre" IPREFIX="$previpre" + curcontext="$prevcontext" fi [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break done Index: Completion/Unix/Type/_services =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_services,v retrieving revision 1.1 diff -u -r1.1 _services --- Completion/Unix/Type/_services 8 May 2002 09:18:13 -0000 1.1 +++ Completion/Unix/Type/_services 14 May 2002 08:03:32 -0000 @@ -18,6 +18,7 @@ compadd -a inits && ret=0 _requested xinetd expl 'xinetd services' \ compadd -a xinetds && ret=0 + (( ret )) || break done return $ret -- Sven Wischnowsky wischnow@berkom.de