From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8321 invoked from network); 18 Oct 1999 09:17:10 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Oct 1999 09:17:10 -0000 Received: (qmail 20643 invoked by alias); 18 Oct 1999 09:17:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8316 Received: (qmail 20636 invoked from network); 18 Oct 1999 09:17:03 -0000 Date: Mon, 18 Oct 1999 11:16:58 +0200 (MET DST) Message-Id: <199910180916.LAA25903@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 16 Oct 1999 13:47:29 +0900 Subject: Re: PATCH: _archie Tanaka Akira wrote: > I wrote a completion function for _archie. > > But it has a problem. > > Z:akr@is27e1u11% Src/zsh -f > is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst > is27e1u11% compconf group_matches=yes message_format='%d' description_format='%d' > is27e1u11% compconf describe_options=yes describe_values=yes option_prefix=yes > is27e1u11% archie - > > -> > > is27e1u11% archie - > string > > Why aren't descriptions of options displayed? Combination of `computil' not reporting that options are allowed at that position and a bit of stupidity in `_arguments'. You are writing a lot of interesting completion functions, very nice, thank you. And before I forget to mention it... if someone wonders why I changed `_dvi' to use `_arguments' a while ago, but didn't change `_ps' and `_pspdf' and why I added `_yp', but not `_nis' (for the NIS+ commands): it's because I don't have many of the commands mentioned in `_ps' and `_pspdf' and we don't have NIS+ installed here, so I couldn't test a completion function for it. So if someone finds the time... Bye Sven diff -u oldsrc/Zle/computil.c Src/Zle/computil.c --- oldsrc/Zle/computil.c Mon Oct 18 11:10:39 1999 +++ Src/Zle/computil.c Mon Oct 18 11:10:52 1999 @@ -976,13 +976,13 @@ else state.curopt = NULL; } else { - state.opt = (line[0] && line[1]); + state.opt = (line[0] ? (line[1] ? 2 : 1) : 0); state.arg = 1; state.curopt = NULL; } pe = NULL; - if (state.opt && (state.curopt = ca_get_opt(d, line, 0, &pe))) { + if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe))) { ddef = state.def = state.curopt->args; doff = pe - line; state.optbeg = state.argbeg = state.inopt = cur; @@ -1009,7 +1009,7 @@ } if (!state.def) state.curopt = NULL; - } else if (state.opt && d->single && + } else if (state.opt == 2 && d->single && (state.curopt = ca_get_sopt(d, line, 0, &pe))) { char *p; Caopt tmpopt; diff -u oldcompletion/Base/_arguments Completion/Base/_arguments --- oldcompletion/Base/_arguments Mon Oct 18 09:48:45 1999 +++ Completion/Base/_arguments Mon Oct 18 11:11:27 1999 @@ -190,7 +190,6 @@ [[ -n "$matched" ]] && compadd -n -Q -S '' -s "$SUFFIX" - "$PREFIX" _message "$descr" - break elif [[ "$action" = \(\(*\)\) ]]; then -- Sven Wischnowsky wischnow@informatik.hu-berlin.de