From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23641 invoked from network); 19 Oct 2001 10:25:23 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Oct 2001 10:25:23 -0000 Received: (qmail 6365 invoked by alias); 19 Oct 2001 10:25:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16085 Received: (qmail 6348 invoked from network); 19 Oct 2001 10:25:14 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15311.65417.5840.933884@gargle.gargle.HOWL> Date: Fri, 19 Oct 2001 12:25:13 +0200 To: zsh-workers@sunsite.dk Subject: Re: bug in _describe In-Reply-To: <3BCDCEF1.C103658D@yahoo.co.uk> References: <3BCDCEF1.C103658D@yahoo.co.uk> X-Mailer: VM 6.92 under 21.1 (patch 3) "Acadia" XEmacs Lucid Oliver Kiddle wrote: > Completion of conditions no longer works: > > % [[ - > (eval):1: error in flags > > I'm fairly certain that this was introduced in 15415. Error comes from > line 57 of _describe. It is not accounting for arrays specified as '( > ... )' instead of actual array names. Ahem. Indeed. I forgot to handle the case where the matches are given with `(...)', not via an array name. Sorry. The patch also makes _condition use _file_descriptors for completion after -t and it keeps _file_descriptors from displaying empty descriptions. Bye Sven Index: Completion/Base/Utility/_describe =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_describe,v retrieving revision 1.9 diff -u -r1.9 _describe --- Completion/Base/Utility/_describe 2001/08/07 10:38:36 1.9 +++ Completion/Base/Utility/_describe 2001/10/19 10:24:45 @@ -54,7 +54,11 @@ while (( $# )); do _strs="_a_$_try$_i" - eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' + if [[ "$1" = \(*\) ]]; then + eval local "_a_$_try$_i;_a_$_try$_i"'='$1 + else + eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' + fi _argv[_i]="_a_$_try$_i" shift (( _i++ )) @@ -63,7 +67,11 @@ _mats= else _matss="_a_$_try$_i" - eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' + if [[ "$1" = \(*\) ]]; then + eval local "_a_$_try$_i;_a_$_try$_i"'='$1 + else + eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' + fi _argv[_i]="_a_$_try$_i" shift (( _i++ )) Index: Completion/Zsh/Context/_condition =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_condition,v retrieving revision 1.1 diff -u -r1.1 _condition --- Completion/Zsh/Context/_condition 2001/04/02 11:22:21 1.1 +++ Completion/Zsh/Context/_condition 2001/10/19 10:24:45 @@ -6,6 +6,8 @@ _tags -C -o options && _options elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then _tags -C "$prev" files && _files +elif [[ "$prev" = -t ]]; then + _file_descriptors else if [[ "$PREFIX" = -* ]] || ! zstyle -T ":completion:${curcontext}:options" prefix-needed; then Index: Completion/Zsh/Type/_file_descriptors =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v retrieving revision 1.2 diff -u -r1.2 _file_descriptors --- Completion/Zsh/Type/_file_descriptors 2001/07/25 12:36:34 1.2 +++ Completion/Zsh/Type/_file_descriptors 2001/10/19 10:24:45 @@ -19,7 +19,11 @@ list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) done fi - _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds -else - _wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds + + if (( $list[(I)* $sep ?*] )); then + _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds + return + fi fi + +_wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds -- Sven Wischnowsky wischnow@informatik.hu-berlin.de