From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6130 invoked from network); 13 Sep 1999 11:57:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Sep 1999 11:57:18 -0000 Received: (qmail 8657 invoked by alias); 13 Sep 1999 11:57:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7801 Received: (qmail 8650 invoked from network); 13 Sep 1999 11:57:04 -0000 Date: Mon, 13 Sep 1999 13:56:58 +0200 (MET DST) Message-Id: <199909131156.NAA21019@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 10 Sep 1999 00:44:34 +0900 Subject: Re: Silly questions about _arguments & Co (and probably bugs) Tanaka Akira wrote: > I think `compconf option_prefix=all' is useful. (Btw, the value of option_prefix isn't used any more -- only whether it's empty or not.) > And, I found another problem. `patch -f' does not show list of > completion candidates. However completion itself works well. > > ... > > So, I think this is the problem of `_display'. Almost. There were two problems: with single-letter options PREFIX/SUFFIX weren't cleared before `_display' was called (so that (almost) no option matched) and the return value of `_display' wasn't used to find out that `_arguments' should create the list itself. Bye Sven diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments --- oldcompletion/Base/_arguments Mon Sep 13 13:13:10 1999 +++ Completion/Base/_arguments Mon Sep 13 13:51:43 1999 @@ -822,12 +822,17 @@ if [[ -n "$sopts" && -n "$PREFIX" && "$PREFIX" = [-+]${~soptseq}[$sopts] ]]; then if [[ "$PREFIX" = [-+]${~soptseq1} ]]; then - if [[ -n "$compconfig[describe_options]" && - "$compconfig[describe_options]" != *\!${cmd}* ]]; then - _display tmp odescr - else - tmp="( ${(j: :)${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=} )" + local dpre="$PREFIX" dsuf="$SUFFIX" + + PREFIX='' + SUFFIX='' + if [[ -z "$compconfig[describe_options]" || + "$compconfig[describe_options]" = *\!${cmd}* ]] || + ! _display tmp odescr; then + tmp=( "${dpre[1]}${(@o)^${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=}" ) fi + PREFIX="$dpre" + SUFFIX="$dsuf" compadd "$expl[@]" -Q -M 'r:|[_-]=* r:|=*' -y tmp - \ "${PREFIX}${(@k)^opts[(I)${PREFIX[1]}?]#?}" \ "${PREFIX}${(@k)^dopts[(I)${PREFIX[1]}?]#?}" \ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de