From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8255 invoked from network); 31 May 2001 12:36:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 May 2001 12:36:21 -0000 Received: (qmail 6582 invoked by alias); 31 May 2001 12:36:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14607 Received: (qmail 6529 invoked from network); 31 May 2001 12:36:12 -0000 From: Sven Wischnowsky Date: Thu, 31 May 2001 14:35:15 +0200 (MET DST) Message-Id: <200105311235.OAA12648@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: PATCH: Re: tag-order problem? In-Reply-To: <200105281030.MAA06745@beta.informatik.hu-berlin.de> 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' 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@informatik.hu-berlin.de