From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7841 invoked from network); 17 Jul 2000 08:04:02 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Jul 2000 08:04:02 -0000 Received: (qmail 14371 invoked by alias); 17 Jul 2000 08:02:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12266 Received: (qmail 14263 invoked from network); 17 Jul 2000 08:01:53 -0000 Date: Mon, 17 Jul 2000 10:01:26 +0200 (MET DST) Message-Id: <200007170801.KAA05649@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 16 Jul 2000 15:23:12 +0900 Subject: PATCH: _arguments (was Re: options are completed for non-option argument.) Tanaka Akira wrote: > Z(2):akr@flux% Src/zsh -f > flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst > flux% _tst () { > function> _arguments -s '-a' '-b' '-c' ':words:compadd - abyyy abzzz' > function> } > flux% tst ab > -a -c > > Options are completed for non-option argument. Oops. Problem with 12241, which should have fixed: Wayne Davison wrote: > I haven't had a chance to look into this yet, but if I type > "perl -cw file" it won't complete the perl script. I have > to type "perl -c -w file", which is a pain. Back to another message from Akira: > Z(2):akr@flux% Src/zsh -f > flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst > flux% _tst () { _arguments '-e::*last:b:' } > flux% tst -e > _arguments:294: command not found: b The syntax is `-e:*last::message:action'. Bye Sven Index: Src/Zle/computil.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v retrieving revision 1.37 diff -u -r1.37 computil.c --- Src/Zle/computil.c 2000/07/13 11:04:00 1.37 +++ Src/Zle/computil.c 2000/07/17 07:49:13 @@ -1112,7 +1112,7 @@ } } else if (!p || (p && !p->active)) return NULL; - pp = p; + pp = (p->name[0] == pre ? p : NULL); p = NULL; } if (pp && end) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de