From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20931 invoked from network); 27 Jan 2002 19:21:09 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 27 Jan 2002 19:21:09 -0000 Received: (qmail 13397 invoked by alias); 27 Jan 2002 19:21:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16497 Received: (qmail 13380 invoked from network); 27 Jan 2002 19:20:59 -0000 From: "Bart Schaefer" Message-Id: <1020127192054.ZM9204@candle.brasslantern.com> Date: Sun, 27 Jan 2002 19:20:54 +0000 In-Reply-To: <15441.7716.645376.366627@wischnow.berkom.de> Comments: In reply to Sven Wischnowsky "Re: Test failures in artih and arguments" (Jan 25, 9:58am) References: <20020123145155.25539.qmail@web10408.mail.yahoo.com> <15441.7716.645376.366627@wischnow.berkom.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Test failures in artih and arguments MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jan 25, 9:58am, Sven Wischnowsky wrote: } } Felix Rosencrantz wrote: } } > *************** } > *** 1,4 **** } > ! line: {tst -}{} } > ! MESSAGE:{arg} } > ! DESCRIPTION:{option} } > ! NO:{-x} } > --- 1 ---- } > ! line: {tst -x }{} } > Test ./Y03arguments.ztst failed: output differs from expected as shown } } Grrrr... that's a result of the fake style patch. Previously, with a } function containing: } } _argument '-x' ':arg:' } } doing } } foo - } } didn't insert anything and displayed be message `arg'. This isn't quite right -- here's 4.0.4: schaefer[507] zsh -f aztec% autoload -U compinit aztec% compinit -D aztec% compdef _foo foo aztec% _foo() { _arguments -x :arg: } aztec% foo - aztec% foo -x The comptest code sets the `format' style for the `completion:*:messages' and `completion:*:descriptions' contexts. Only with one of those styles set is the `x' NOT inserted; without those styles, it's inserted. It seems to me that the display formatting should not affect what the possible matches are. Was this really intended to depend on the `format' style? } So we now have the problem that in exactly the same case something we } certainly want to have with faked matches conflicts with the behaviour } we wanted there previously (or even now, without faked matches). } } I'm not sure how to solve this. The problem really is that `-' is a valid match, for any arbitrary value of , but of course we can only write code to add or list matches that we know about in advance, not those that can be fabricated interactively. So it seems to me that we need a wildcard indicator of some kind, so that _arguments can add the match `-'. This would allow the `-' to be treated as a prefix of the two matches `-x' and `-'. The list and menu code would then have to special case any match that has in it, omitting it from listings but displaying the description for it (if there is one). However, I don't have any good suggestions on how to chose such that it is guaranteed not to conflict with any possible real match. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net