From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4059 invoked from network); 13 Mar 2003 09:31:42 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2003 09:31:42 -0000 Received: (qmail 444 invoked by alias); 13 Mar 2003 09:31:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18347 Received: (qmail 436 invoked from network); 13 Mar 2003 09:31:35 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Mar 2003 09:31:35 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Mar 2003 9:31:35 -0000 Received: (qmail 29897 invoked from network); 13 Mar 2003 09:31:34 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-9.tower-1.messagelabs.com with SMTP; 13 Mar 2003 09:31:34 -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 JAA07742 for ; Thu, 13 Mar 2003 09:31:33 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 h2D9ZM803710 for ; Thu, 13 Mar 2003 10:35:22 +0100 X-VirusChecked: Checked From: Oliver Kiddle To: Zsh workers Subject: PATCH: bug with ((val\:desc ...)) actions in _alternative Date: Thu, 13 Mar 2003 10:35:22 +0100 Message-ID: <3708.1047548122@finches.logica.co.uk> This: _alternative 'foos:foo:((one\:a two\:b))' 'bars:bar:((a\:one b\:two))' doesn't work. With more than one ((...)) action in an _alternative spec, after the first `local ws' prints the value of ws. The second problem with it was that it was not setting the tag as specified in the spec. So the two things were not completed separately. Oliver Index: Completion/Base/Utility/_alternative =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_alternative,v retrieving revision 1.2 diff -u -r1.2 _alternative --- Completion/Base/Utility/_alternative 22 Jan 2002 10:22:48 -0000 1.2 +++ Completion/Base/Utility/_alternative 13 Mar 2003 09:28:06 -0000 @@ -1,7 +1,7 @@ #autoload local tags def expl descr action mesgs nm="$compstate[nmatches]" subopts -local opt curcontext="$curcontext" +local opt ws curcontext="$curcontext" subopts=() while getopts 'O:C:' opt; do @@ -33,13 +33,12 @@ mesgs=( "$mesgs[@]" "${def%%:*}:$descr") elif [[ "$action" = \(\(*\)\) ]]; then - local ws # ((...)) contains literal strings with descriptions. eval ws\=\( "${action[3,-3]}" \) - _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" + _describe -t "${def%%:*}" "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly.