From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9397 invoked from network); 27 Jul 2000 07:17:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jul 2000 07:17:26 -0000 Received: (qmail 4640 invoked by alias); 27 Jul 2000 07:17:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12394 Received: (qmail 4581 invoked from network); 27 Jul 2000 07:17:06 -0000 Date: Thu, 27 Jul 2000 09:17:03 +0200 (MET DST) Message-Id: <200007270717.JAA15601@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Adam Spiers's message of Wed, 26 Jul 2000 21:24:48 +0100 Subject: PATCH: Re: problem with _arguments Adam Spiers wrote: > I'm trying to write a very simple completion for a function, with the > following requirements: > > - the function has one optional option '-l' with no parameter > - the first parameter can't be completed > - subsequent parameters are files > > AFAICS from the docs, the completion function should be something > like: > > _foo () { > _arguments \ > '-l[message for option]' \ > ':description for first param: ' \ > '*:description for files:_files' > } > > But with the latest CVS: > > $ foo - > $ foo - > ---- description for first param > > What am I doing wrong, or is it a bug? Au, verflucht. _main_complete forced listing when a _message was added and there were less than two matches. Unfortunately, it forced message-only listing, so the option just wasn't shown. The patch will make it show the message and the option, which is what should have been done before. If this is good or if it should only complete the option is a different question. Hm. Hm? Bye Sven Index: Completion/Core/_main_complete =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v retrieving revision 1.37 diff -u -r1.37 _main_complete --- Completion/Core/_main_complete 2000/07/13 11:04:00 1.37 +++ Completion/Core/_main_complete 2000/07/27 07:16:39 @@ -266,7 +266,7 @@ fi elif [[ nm -le 1 && -n "$_comp_mesg" ]]; then compstate[insert]='' - compstate[list]='list force messages' + compstate[list]='list force' elif [[ nm -eq 0 && -z "$_comp_mesg" && $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] && zstyle -s ":completion:${curcontext}:warnings" format format; then -- Sven Wischnowsky wischnow@informatik.hu-berlin.de