From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16683 invoked from network); 21 Oct 1999 12:42:47 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Oct 1999 12:42:47 -0000 Received: (qmail 13013 invoked by alias); 21 Oct 1999 12:42:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8360 Received: (qmail 13006 invoked from network); 21 Oct 1999 12:42:27 -0000 Date: Thu, 21 Oct 1999 14:42:21 +0200 (MET DST) Message-Id: <199910211242.OAA06593@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 21 Oct 1999 20:28:44 +0900 Subject: Re: PATCH: _archie Tanaka Akira wrote: > Z(2):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 > > (1) archie -O Whoa. I did quite a bit of testing but... > (2) flex -C Oops. This works correctly for me. Hm, what am I doing wrong... (or right) However, I forgot to include a hunk in `_values' for this one. > (3) bison -ba So the argument may come directly after the `-b'... this needed only a fix in `_bison' (since it expected the argument of `-b' to be in the next word it thought that `-ba' wasn't an option string and hence took it for the first and only argument). > (4) bison -Vba - Same reason and fix as for (3), it didn't consider `-Vba' to be an option string. Bye Sven diff -u oldsrc/Zle/computil.c Src/Zle/computil.c --- oldsrc/Zle/computil.c Thu Oct 21 12:31:50 1999 +++ Src/Zle/computil.c Thu Oct 21 14:31:47 1999 @@ -696,7 +696,8 @@ opt->name = ztrdup(name); if (descr) opt->descr = ztrdup(descr); - else if (adpre && oargs && !oargs->next) + else if (adpre && oargs && !oargs->next && + oargs->descr && oargs->descr[0]) opt->descr = tricat(adpre, oargs->descr, adsuf); else opt->descr = NULL; @@ -1118,8 +1119,15 @@ ca_laststate.doff = 0; } else if (cur == compcurrent && !ca_laststate.def) { if ((ca_laststate.def = ddef)) { - ca_laststate.doff = doff; - ca_laststate.opt = 0; + ca_laststate.singles = state.singles; + if (state.curopt && state.curopt->type == CAO_NEXT) { + ca_laststate.ddef = ddef; + ca_laststate.def = NULL; + ca_laststate.opt = 1; + } else { + ca_laststate.doff = doff; + ca_laststate.opt = 0; + } } else { ca_laststate.def = adef; ca_laststate.ddef = NULL; diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments --- oldcompletion/Base/_arguments Thu Oct 21 10:33:22 1999 +++ Completion/Base/_arguments Thu Oct 21 14:38:12 1999 @@ -71,7 +71,7 @@ lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/ --}:#[ ]#-*}//,/ -}}:#[ ]#--*}#*--}%%[, ]*}:#}") +}}:#[ ]#--*}#*--}%%[], ]*}:#}") # Now remove all ignored options ... @@ -227,7 +227,8 @@ if [[ -z "$matched" ]] && comparguments -O next direct odirect equal && - [[ ( ( nm -eq compstate[nmatches] || -n "$noargs" ) && -z "$aret" ) || + [[ ( ( nm -eq compstate[nmatches] || -n "$noargs" ) && + -z "$aret" && -z "$mesg" ) || -z "$compconfig[option_prefix]" || "$compconfig[option_prefix]" = *\!${cmd}* || "$PREFIX" = [-+]* ]]; then @@ -246,6 +247,7 @@ compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}" else tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" ) + tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" ) tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) _describe -o -c "$cmd" option tmp1 tmp2 -Q -S '' diff -u -r oldcompletion/Base/_values Completion/Base/_values --- oldcompletion/Base/_values Thu Oct 21 08:58:56 1999 +++ Completion/Base/_values Thu Oct 21 11:45:48 1999 @@ -36,7 +36,7 @@ else compvalues -d descr if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then - sep=( "-qQS$sep" ) + sep=( "-qQS" "$sep" ) else sep=() fi diff -u -r oldcompletion/User/_bison Completion/User/_bison --- oldcompletion/User/_bison Thu Oct 21 10:33:31 1999 +++ Completion/User/_bison Thu Oct 21 13:42:09 1999 @@ -1,14 +1,14 @@ #compdef bison _arguments -s \ - '(--file-prefix)-b[specify output file prefix]:output file prefix:' \ + '(--file-prefix)-b+[specify output file prefix]:output file prefix:' \ '(--defines)-d[write token definition file]' \ '(--raw)-r[output bison token numbers]' \ '(--token-table)-k[output token table]' \ '(--no-lines)-l[don'"'"'t generate #line directives]' \ '(--no-parser)-n[don'"'"'t generate parse (only declarations)]' \ - '(--output-file)-o[specify parser output file name]:parser file name:_files' \ - '(--name-prefix)-p[change yy prefix]:prefix string:' \ + '(--output-file)-o+[specify parser output file name]:parser file name:_files' \ + '(--name-prefix)-p+[change yy prefix]:prefix string:' \ '(--debug)-t[output YYDEBUG definition]' \ '(--verbose)-v[verbose mode]' \ '(--version)-V[show version]' \ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de