zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: _archie
Date: Thu, 21 Oct 1999 14:42:21 +0200 (MET DST)	[thread overview]
Message-ID: <199910211242.OAA06593@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 21 Oct 1999 20:28:44 +0900


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<TAB>

Whoa. I did quite a bit of testing but...

> (2) flex -C<TAB><TAB>

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 <TAB>

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 -<TAB>

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


             reply	other threads:[~1999-10-21 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-21 12:42 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-10-21 10:31 Sven Wischnowsky
1999-10-21 11:28 ` Tanaka Akira
1999-10-21  8:32 Sven Wischnowsky
1999-10-21  9:05 ` Tanaka Akira
1999-10-18  9:16 Sven Wischnowsky
1999-10-20 16:15 ` Tanaka Akira
1999-10-16  4:47 Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199910211242.OAA06593@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).