From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24068 invoked by alias); 14 Aug 2015 16:18:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36169 Received: (qmail 23174 invoked from network); 14 Aug 2015 16:18:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Sb+1MoBT/9xKRVhI/nP/lHcYSaCSrEdbPz3upchogrk=; b=d1goaDs1q3BtMD9pbUu/wOBMy8L5GKd6KX9UaEgzZsBkYotsjDP1yKYPOYYkVRrbeN gtMxuAZoSxxgmGwwng4o7E0SO0tfzmI4C13ZlIGVzYXdr+n1BXJ0iEGzFDph+D2lWFW1 ZUd4NWRrCcWoaTfQY73S+LHAKwf3vIP6PIkAF91B+iH2nraqTB8LLJPOolAaAjQxvRRn iGqcM0XvpcouImBxR6XnZZAe3DJjIYliV1pP1mapldEv4yuBbC1fcDYZETx+JhkRsMn7 v6wTQR1AlNd4oiTUzHOvbuqNI+frP+ETotfm9YsdZrtlVWfMDmtFPorfrRiNnU2Y+BM8 oVBA== MIME-Version: 1.0 X-Received: by 10.107.138.216 with SMTP id c85mr44106879ioj.187.1439569132954; Fri, 14 Aug 2015 09:18:52 -0700 (PDT) In-Reply-To: <25646.1439541856@thecus.kiddle.eu> References: <1439348703-8268-1-git-send-email-mikachu@gmail.com> <1439348703-8268-3-git-send-email-mikachu@gmail.com> <7518.1439400015@thecus.kiddle.eu> <150812115958.ZM14070@torch.brasslantern.com> <150812135724.ZM14165@torch.brasslantern.com> <150812144433.ZM14263@torch.brasslantern.com> <150812154611.ZM14299@torch.brasslantern.com> <12099.1439460739@thecus.kiddle.eu> <150813132743.ZM28791@torch.brasslantern.com> <25646.1439541856@thecus.kiddle.eu> Date: Fri, 14 Aug 2015 18:18:52 +0200 Message-ID: Subject: Re: PATCH 3/5: _imagemagick: complete all files if image files didn't match From: Mikael Magnusson To: Oliver Kiddle Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Fri, Aug 14, 2015 at 10:44 AM, Oliver Kiddle wrote: > Bart wrote: >> As I think I've mentioned elsewhere, file-patterns seems to take >> precedence over list-dirst-first anyway. So I suppose it could be >> interpreted as a shorthand, except for the other-files business. > > Yes, it is harmless enough as a shorthand. [...] >> Does it ever make sense to use _files -g '*(/)' ? Or should -/ always >> be used in that case? > > In that exact example, -/ should be used but there's definitely > use-cases for globs matching only some directories. For example, to > select a git repository you might want *(e:[[ -d \$REPLY/.git ]]:) I think Bart just meant (/) vs (-/), but I'm not sure. > We don't tend to bother in the functions because the directories get > picked up for the directories tag anyway and there's no way to tell the > selected directories apart from those only there because they might be > part of the path to the final directory. You can't use complist colours > because that works on the basis of the group rather than the tag. If you > use separate groups then you get matches duplicated. > > Instead of *(-/) for the directories, we ideally need to negate the glob > specified with -g. The trouble is that it is actually quite hard to get > the opposite of a glob. The opposite of *.ext(ab,cd) is something like > ^*.ext *.ext(^a,^b)(^c,^d) > It'd probably be easier to expand the glob in an array and use that > array as a filter. I'd be interested if anyone has any ideas on how to > do this. Something like this? all=(*) positive=(*.ext(ab,cd)) negative=( ${all:|positive} ) You can't actually write that in a glob:tag part though... (And doing it in (e:...:) would be very slow) [...] -- Mikael Magnusson