From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14581 invoked from network); 30 Apr 2003 13:52:15 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 30 Apr 2003 13:52:15 -0000 Received: (qmail 6265 invoked by alias); 30 Apr 2003 13:52:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18487 Received: (qmail 6254 invoked from network); 30 Apr 2003 13:52:10 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 30 Apr 2003 13:52:10 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 30 Apr 2003 13:52:10 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Wed, 30 Apr 2003 15:01:31 +0100 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id JWCPXRBH; Wed, 30 Apr 2003 14:50:25 +0100 To: zsh-workers@sunsite.dk Subject: Re: current CVS test failure In-reply-to: "Oliver Kiddle"'s message of "Wed, 30 Apr 2003 15:39:07 +0200." <7469.1051709947@gmcs3.logica.co.uk> Date: Wed, 30 Apr 2003 14:52:07 +0100 Message-ID: <23086.1051710727@csr.com> From: Peter Stephenson Oliver Kiddle wrote: > The test is doing _arguments '-+o'. Because there are no other > (non-option) things being completed, it adds the -o and +o regardless > of the prefix. In _describe, I can't know if _arguments is completing > other things so I can't think of any easy solution other than checking > prefix-needed manually in any other function using _describe -o. how about adding another option to _describe e.g. -O which works the same but doesn't test prefix-needed and only gets called from _arguments? Index: Completion/Base/Utility/_arguments =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v retrieving revision 1.14 diff -u -r1.14 _arguments --- Completion/Base/Utility/_arguments 23 May 2002 12:20:15 -0000 1.14 +++ Completion/Base/Utility/_arguments 30 Apr 2003 13:51:27 -0000 @@ -387,7 +387,7 @@ tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" ) tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) - _describe -o option \ + _describe -O option \ tmp1 tmp2 -Q -S '' -- \ tmp3 -Q @@ -399,7 +399,7 @@ single=yes else next=( "$next[@]" "$odirect[@]" ) - _describe -o option \ + _describe -O option \ next -Q -M "$matcher" -- \ direct -QS '' -M "$matcher" -- \ equal -QqS= -M "$matcher" Index: Completion/Base/Utility/_describe =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_describe,v retrieving revision 1.14 diff -u -r1.14 _describe --- Completion/Base/Utility/_describe 22 Apr 2003 12:33:08 -0000 1.14 +++ Completion/Base/Utility/_describe 30 Apr 2003 13:51:27 -0000 @@ -2,7 +2,7 @@ # This can be used to add options or values with descriptions as matches. -local _opt _expl _tmpm _tmpd _mlen +local _opt _expl _tmpm _tmpd _mlen _noprefix local _type=values _descr _ret=1 _showd _nm _hide _args _grp _sep local csl="$compstate[list]" csl2 local _oargv _argv _new _strs _mats _opts _i _try=0 @@ -12,6 +12,10 @@ if [[ "$1" = -o ]]; then _type=options shift +elif [[ "$1" = -O ]]; then + _type=options + _noprefix=1 + shift elif [[ "$1" = -t ]]; then _type="$2" shift 2 @@ -20,7 +24,7 @@ shift fi -[[ "$_type" = options && ! -prefix [-+]* ]] && \ +[[ "$_type$_noprefix" = options && ! -prefix [-+]* ]] && \ zstyle -T ":completion:${curcontext}:options" prefix-needed && return 1 -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************