Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: tag-order problem?



Apart from the disown question which probably can't or won't be finally
resolved before the release[1], this is the last thing on my list.

In 14506 I wrote:

> ...
> 
> Anyway. Anyone interested could try the patch below, which gives what
> you expect in this case. The question is whether this breaks any of the
> examples we had for inventing the -w and -W options. I don't think I'll
> have the time to test those today.

I've tested this now and it doesn't seem to break anything.  But I found
and fixed another little ugliness.  With:

  _arguments -w -s '-a:aa:(1)' '-b-:ab:(2)' -x -y

Completion after `-ab<TAB>' didn't complete the `2'.

I'm going to commit it this time.


Bye
  Sven

[1] My only suggestion at this time would be to think about changing the
    warnings to `warning: job is still suspended' (i.e. inserting that
    `still' to make it clearer that the job has been disowned but is
    still sleeping).  Dunno.  Adding a flag to tell bin_fg() that it's a
    `%1 &!' and then calling killjb() there isn't hard to implement
    either, of course, but we got no comments on this, so...

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.5
diff -u -r1.5 _arguments
--- Completion/Base/Utility/_arguments	2001/04/26 14:40:11	1.5
+++ Completion/Base/Utility/_arguments	2001/05/31 12:27:02
@@ -233,7 +233,7 @@
 	descr="$descrs[anum]"
 	subc="$subcs[anum++]"
 
-        if [[ -n "$matched" ]] || _requested "$subc"; then
+        if [[ -z "$tried" ]] && { [[ -n "$matched" ]] || _requested "$subc" }; then
 
           curcontext="${oldcontext%:*}:$subc"
 
@@ -328,7 +328,8 @@
         fi
       done
       if [[ -z "$hasopts" &&
-            ( -z "$matched" || -n "$alwopt" ) &&
+            -z "$matched" &&
+            ( -z "$tried" || -n "$alwopt" ) &&
             ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] &&
           _requested options &&
           { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
@@ -389,7 +390,8 @@
       [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break
     done
     if [[ -n "$opts" && -z "$aret" &&
-          ( -z "$matched$mesg" || -n "$alwopt" ) &&
+          -z "$matched" &&
+          ( -z "$tried" || -n "$alwopt" ) &&
           nm -eq compstate[nmatches] ]]; then
 
       PREFIX="$origpre"
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.56
diff -u -r1.56 computil.c
--- Src/Zle/computil.c	2001/05/31 09:44:00	1.56
+++ Src/Zle/computil.c	2001/05/31 12:27:03
@@ -1436,7 +1436,7 @@
 	    char *p;
 	    Caopt tmpopt;
 
-	    if (sopts && nonempty(sopts))
+	    if (cur != compcurrent && sopts && nonempty(sopts))
 		state.curopt = (Caopt) uremnode(sopts, firstnode(sopts));
 
 	    if (!state.oargs[state.curopt->num])

-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author