From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29105 invoked from network); 18 Feb 2002 14:25:52 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Feb 2002 14:25:52 -0000 Received: (qmail 16004 invoked by alias); 18 Feb 2002 14:25:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16667 Received: (qmail 15990 invoked from network); 18 Feb 2002 14:25:43 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15473.3753.148162.244070@wischnow.berkom.de> Date: Mon, 18 Feb 2002 15:24:41 +0100 To: zsh-workers@sunsite.dk Subject: Re: false prefix-needed in _arguments In-Reply-To: <20020214150653.26913.qmail@web9303.mail.yahoo.com> References: <20020214150653.26913.qmail@web9303.mail.yahoo.com> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Oliver Kiddle wrote: > The prefix-needed style in _arguments doesn't seem to be working: > > _f() { _arguments '-a' '-b' '1:files:_files' } > zstyle '*' prefix-needed false > compdef _f f > f > > And only files are offered. It should be offering both files and > options. Yes, that was broken... but note taht you also have to set the tag-order style to try options and the argument-completion at the same time, otherwise arguments will always be preferred. Bye Sven Index: Completion/Base/Utility/_arguments =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v retrieving revision 1.10 diff -u -r1.10 _arguments --- Completion/Base/Utility/_arguments 22 Jan 2002 10:22:48 -0000 1.10 +++ Completion/Base/Utility/_arguments 18 Feb 2002 14:24:13 -0000 @@ -331,11 +331,10 @@ fi done fi - if [[ -z "$hasopts" && + if _requested options && + [[ -z "$hasopts" && -z "$matched" && - ( -z "$tried" || -n "$alwopt" ) && ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] && - _requested options && { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then local prevpre="$PREFIX" previpre="$IPREFIX" -- Sven Wischnowsky wischnow@berkom.de