From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28028 invoked from network); 13 Jul 2000 11:01:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Jul 2000 11:01:43 -0000 Received: (qmail 18477 invoked by alias); 13 Jul 2000 11:01:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12241 Received: (qmail 18470 invoked from network); 13 Jul 2000 11:01:30 -0000 Date: Thu, 13 Jul 2000 13:01:24 +0200 (MET DST) Message-Id: <200007131101.NAA23190@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 13 Jul 2000 19:36:50 +0900 Subject: PATCH: Re: diff completion problem. Tanaka Akira wrote: > Z(2):akr@flux% Src/zsh -f > flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst > flux% zstyle '*:descriptions' format '%d' > flux% diff -ur > new file > CVS/ LICENCE _w3m config.sub* > ChangeLog META-FAQ acconfig.h configure* > ... > > Hm. zsh completes files as new file. It should be `original file'. Whoa. How did that survive? Wrong return value in the function testing for multiple single-letter options in the same string. That stuff in _main_complete tries to do the right thing when a completion function uses _message, i.e. it stops trying other completers and doesn't print the warnings. Sorry for putting this in the same patch. Bye Sven Index: Completion/Core/_main_complete =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v retrieving revision 1.36 diff -u -r1.36 _main_complete --- Completion/Core/_main_complete 2000/07/12 09:25:18 1.36 +++ Completion/Core/_main_complete 2000/07/13 10:59:26 @@ -156,6 +156,8 @@ fi (( _matcher_num++ )) done + [[ -n "$_comp_mesg" ]] && break + (( _completer_num++ )) done @@ -265,7 +267,7 @@ elif [[ nm -le 1 && -n "$_comp_mesg" ]]; then compstate[insert]='' compstate[list]='list force messages' -elif [[ nm -eq 0 && +elif [[ nm -eq 0 && -z "$_comp_mesg" && $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] && zstyle -s ":completion:${curcontext}:warnings" format format; then Index: Src/Zle/computil.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v retrieving revision 1.36 diff -u -r1.36 computil.c --- Src/Zle/computil.c 2000/06/26 08:36:43 1.36 +++ Src/Zle/computil.c 2000/07/13 10:59:38 @@ -1088,7 +1088,7 @@ static Caopt ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp) { - Caopt p; + Caopt p, pp = NULL; char pre = *line++; LinkList l = NULL; @@ -1112,11 +1112,12 @@ } } else if (!p || (p && !p->active)) return NULL; + pp = p; p = NULL; } - if (p && end) + if (pp && end) *end = line; - return p; + return pp; } /* Return the n'th argument definition. */ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de