From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19164 invoked from network); 17 Mar 2000 17:32:19 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Mar 2000 17:32:19 -0000 Received: (qmail 14617 invoked by alias); 17 Mar 2000 17:32:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10162 Received: (qmail 14609 invoked from network); 17 Mar 2000 17:32:12 -0000 Message-ID: <38D26C12.83DAFEF3@u.genie.co.uk> Date: Fri, 17 Mar 2000 17:32:02 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: _expand limitation Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I just did vi *(w) and expected it to expand to the one writable file in the directory. It didn't work though. The trouble is that _expand tries to expand things by doing ${~exp}(N). This means that it is in effect trying to expand *(w)(N) which isn't the same as *(wN). The easiest solution I can think of is if _expand does setopt localoptions nullglob though someone else may have a better idea. The patch adds this. Oliver --- _expand.bak Fri Mar 17 17:16:01 2000 +++ _expand Fri Mar 17 17:17:48 2000 @@ -7,6 +7,8 @@ # the expansions done produce no result or do not change the original # word from the line. +setopt localoptions nullglob + [[ _matcher_num -gt 1 ]] && return 1 local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" " @@ -42,7 +44,7 @@ zstyle -s ":completion:${curcontext}:" glob expr && [[ "${(e):-\$[$expr]}" -eq 1 ]] && - exp=( ${~exp}(N) ) + exp=( ${~exp} ) # If we don't have any expansions or only one and that is the same # as the original string, we let other completers run.