From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4262 invoked by alias); 22 Sep 2016 21:13:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21956 Received: (qmail 24572 invoked from network); 22 Sep 2016 21:13:25 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.26):SA:0(0.0/5.0):. Processed in 0.135339 secs); 22 Sep 2016 21:13:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=NMYdfQ1XM82C+Jx1Pi/5p2pjHe4=; b=vxLjfR /uOsAi0xJKJWt6vE+Y83v66VlVCGio2aHY1uRAWnd01QZ53q/g78A6b5ixwPeFBS cdMKYHdTgFzjAOSNBbm9dbmgRN9RFp3ybentw+ApMizDaW5MuY1/xGLtmsNqYAix rCIosL5BAr5a91MfI48AqF22TSnz0BlkxFZZE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=NMYdfQ1XM82C+Jx1Pi/5p2pjHe4=; b=e/8AI i3hxayKL2BuAkDKXnzBYxDBToLj3+KKa/34JqQixSt9lzFWrC2NtYFRzMzMbXB4x hoyIXu1zbE/gSLm7eXCNL7Wam6ZRuCwfUq7rcvOcnvhHfie9LfwtpIa1AYDjpNwp KMq8wPWcGpJpVjVS17C7DmtJPOZt871lYhwMts= X-Sasl-enc: /1CkvYW4E+CfB6CbMPztuevku9pVoX/QF3DTnN3GBM8X 1474578802 Date: Thu, 22 Sep 2016 21:12:14 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Re: File completion with **/ (with solution) Message-ID: <20160922211214.GA14444@fujitsu.shahaf.local2> References: <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Tue, Sep 20, 2016 at 17:56:23 -0700: > _glob_expand() { reply=( $~1* ) } > zstyle :completion::user-expand:: user-expand _glob_expand > zstyle :completion::user-expand:: tag-order expansions all-expansions > zstyle ':completion:*' completer _expand _complete _match _user_expand > > Daniel, this might be the "better answer" to your _match question, too. Right: I could use _user_expand instead of _expand in my completer style, and implement a policy such as . 1. Try _expand if $condition 2. Try _match 3. Try _expand if not $condition . with $condition being the *[*][*]* pattern from the _match thread. > The other thing it might be useful to call out in the doc is to note that > because _user_expand is called AS a completer, it has access to more of > the zstyle $context when it is called than when the "completer" style is > looked up. This could be handy when deciding what to assign to $reply. I don't see that additional context: if I define _f as a completer function, then it's called with curcontext=:f::. Thanks again for all the investigations. I've switched to your 'zstyle -e' solution since this way I don't have to munge $curcontext in my wrapper function. Cheers, Daniel