From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16155 invoked from network); 26 Feb 2003 08:44:14 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Feb 2003 08:44:14 -0000 Received: (qmail 3463 invoked by alias); 26 Feb 2003 08:44:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18299 Received: (qmail 3455 invoked from network); 26 Feb 2003 08:44:05 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Feb 2003 08:44:05 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.147] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Feb 2003 8:44:4 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1046249044!926 Received: (qmail 20999 invoked from network); 26 Feb 2003 08:44:04 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-4.tower-27.messagelabs.com with SMTP; 26 Feb 2003 08:44:04 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id IAA16626 for ; Wed, 26 Feb 2003 08:44:02 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h1Q8liD01205 for ; Wed, 26 Feb 2003 09:47:45 +0100 In-reply-to: <22979.1046178445@csr.com> From: Oliver Kiddle References: <22979.1046178445@csr.com> To: zsh-workers@sunsite.dk Subject: PATCH: Re: Bugs thrown up by _perforce Date: Wed, 26 Feb 2003 09:47:43 +0100 Message-ID: <1203.1046249263@finches.logica.co.uk> Sender: kiddleo@logica.com Peter wrote: > Oliver Kiddle wrote: > > [_next_tags always inserts an unambiguous completion] > > > > You can fix this by changing the ins=unambiguous line to just ins= so > > that compstate[insert] remains empty but this changes _next_tags > > behaviour in other cases. > > I'll test this out. That would be useful. > > behaviour would be. Does anyone want _next_tags to actually complete > > stuff ever? > > I can't see why --- certainly not treat it as an unambiguous insertion, > fait accompli. You can't even see what it's going to complete next. Okay, I think it can be fixed then. > > [an _arguments --- or any inner tags loop --- screws up _next_tags] > Um. I'm still a bit vague as to how all this works. Can we prevent > this behaviour happening with argument-rest? After all, it's being > smuggled in behind our back anyway --- it's not specified either in the > styles, nor in the list of tags I'm explicitly generating. You could but a more generic solution would be much better. The argument- tags can be useful. > Can we make the system remember we're in a nested loop? And then inside > it can be more lenient? Or some combination of the tow? Or something? This patch should do the job. It only puts tags from the inner most tag loops into $_lastcomp[tags] and hence $_next_tags_not. Not blocking an outer loop tag does not matter because all inner tags will be blocked for it so the effect is the same. Does anyone see a problem with the change to what $_lastcomp[tags] contains? Note that it isn't used by anything other than _next_tags. Potential problems remain if the same tag names are used across different branches (the inner loops of separate outer loops). Doing that is otherwise not very sensible anyway. Oliver Index: Completion/Base/Core/_all_labels =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_all_labels,v retrieving revision 1.2 diff -u -r1.2 _all_labels --- Completion/Base/Core/_all_labels 12 Feb 2002 13:37:03 -0000 1.2 +++ Completion/Base/Core/_all_labels 26 Feb 2003 08:33:31 -0000 @@ -24,6 +24,8 @@ fi while comptags "-A$__prev" "$1" curtag __spec; do + (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" + _tags_level=$#funcstack _comp_tags="$_comp_tags $__spec " if [[ "$curtag" = *[^\\]:* ]]; then zformat -f __descr "${curtag#*:}" "d:$3" Index: Completion/Base/Core/_main_complete =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_main_complete,v retrieving revision 1.6 diff -u -r1.6 _main_complete --- Completion/Base/Core/_main_complete 26 Jun 2002 11:07:46 -0000 1.6 +++ Completion/Base/Core/_main_complete 26 Feb 2003 08:33:31 -0000 @@ -23,6 +23,7 @@ _matchers _matcher _c_matcher _matcher_num _comp_tags _comp_mesg \ mesg str context state line opt_args val_args curcontext="$curcontext" \ _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \ + _tags_level=0 \ _saved_exact="${compstate[exact]}" \ _saved_lastprompt="${compstate[last_prompt]}" \ _saved_list="${compstate[list]}" \ Index: Completion/Base/Core/_next_label =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_next_label,v retrieving revision 1.2 diff -u -r1.2 _next_label --- Completion/Base/Core/_next_label 12 Feb 2002 13:37:04 -0000 1.2 +++ Completion/Base/Core/_next_label 26 Feb 2003 08:33:31 -0000 @@ -6,6 +6,8 @@ zparseopts -D -a __gopt 1 2 V J x if comptags -A "$1" curtag __spec; then + (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" + _tags_level=$#funcstack _comp_tags="$_comp_tags $__spec " if [[ "$curtag" = *[^\\]:* ]]; then zformat -f __descr "${curtag#*:}" "d:$3" Index: Completion/Base/Widget/_next_tags =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Widget/_next_tags,v retrieving revision 1.3 diff -u -r1.3 _next_tags --- Completion/Base/Widget/_next_tags 25 Feb 2003 18:43:51 -0000 1.3 +++ Completion/Base/Widget/_next_tags 26 Feb 2003 08:33:31 -0000 @@ -34,6 +34,8 @@ fi while comptags "-A$__prev" "$1" curtag __spec; do + (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" + _tags_level=$#funcstack [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue _comp_tags="$_comp_tags $__spec " if [[ "$curtag" = *[^\\]:* ]]; then @@ -59,6 +61,8 @@ zparseopts -D -a __gopt 1 2 V J x if comptags -A "$1" curtag __spec; then + (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" + _tags_level=$#funcstack [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue _comp_tags="$_comp_tags $__spec " if [[ "$curtag" = *[^\\]:* ]]; then This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.