From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15078 invoked by alias); 13 Aug 2015 20:27:51 -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: 36151 Received: (qmail 18877 invoked from network); 13 Aug 2015 20:27:49 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=ubGK1e+Yy9I3p066SAbqb4kGy1XTvVEFXYnw+6OlAgk=; b=H+289THGQddR0wYelwz9UMhYUergtU5z8F710EALoOxXoj+TzOJusaElElq3rlp8z0 MswyjhnYTDGTSHXngcrfn2JM4Umah8kCehIOMu4sk1DsUO9U98CKjDYoP3jRLQChw2wE LuDjuL3uPaDgYRMm1LOA2C7jATY5KG03bH9ngGOqlT0xqjauuvTXDHflL7B7ftpw9cxf 8wbnNvvI+nYLMv+n0EV5DJowC2NocekO3ck3L+UdVusBmkaIkpqOMGBoTXiSqlOJ7LCl vWwKkvpeAOk+w5Yg/i5Os0G1kmKu4sTJjpCBHi6lTejBBHbGRuN0KwMdwFlsoOpRFXdQ kV8w== X-Gm-Message-State: ALoCoQn0lsElGyvQkBFTZUear0pKff4GHrrRq4BU0y4Cyr7TbKgg7Gh/CcqR8zfW3UIPa6jvs7fJ X-Received: by 10.182.20.141 with SMTP id n13mr38216150obe.26.1439497667215; Thu, 13 Aug 2015 13:27:47 -0700 (PDT) From: Bart Schaefer Message-Id: <150813132743.ZM28791@torch.brasslantern.com> Date: Thu, 13 Aug 2015 13:27:43 -0700 In-Reply-To: <12099.1439460739@thecus.kiddle.eu> Comments: In reply to Oliver Kiddle "Re: PATCH 3/5: _imagemagick: complete all files if image files didn't match" (Aug 13, 12:12pm) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Oliver Kiddle , zsh workers Subject: Re: PATCH 3/5: _imagemagick: complete all files if image files didn't match MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 13, 12:12pm, Oliver Kiddle wrote: } } Had I been paying enough attention in 2008 to be opinionated then, I } would have questioned why we need a special style corresponding to a } specific user preference that ought to be covered by file-patterns. 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. } _files does: } [[ "$type" = */* ]] && glob="$glob,*(-/)" } } Either comma was at one time special to _path_files or this was never } tested. In the patch below, I just remove it. That bit is probably trying to do the trick of merging together glob qualifiers, and just gets it wrong. I.e. here: # add `^-/' after `#q' glob qualifier if not there already if [[ "$glob" = (#b)(*\(\#q)(*\)) ]]; then [[ $match[2] != \^-/* ]] && glob="${match[1]}^-/,${match[2]}" else glob="$glob(#q^-/)" fi } I would actually be inclined to suggest that other-files should be } globbed-files: _files is defining three defaults for file-patterns } corresponding to whether -g, -/ or neither was specified. So how do you } override just one of those file patterns? If we define _files without a } -g as being equivalent to _files -g '*(-.)' then a single file-patterns } default would suffice. It'd also mean all-files would only be used as a } fallback and globbed-files would be the tag for all the files when no } glob is specified. Does it ever make sense to use _files -g '*(/)' ? Or should -/ always be used in that case? } It would probably be a good } thing if we can avoid every little completion function needing to do } stuff like _files -g '*.png(-.)". -/ would mean we actually want to } select directories. Any opinions? I'm not sure I understand that part of the issue, yet. -- Barton E. Schaefer