From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25445 invoked by alias); 19 Sep 2016 14:45:23 -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: 21948 Received: (qmail 24827 invoked from network); 19 Sep 2016 14:45:23 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f177.google.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(209.85.192.177):SA:0(0.0/5.0):. Processed in 0.758245 secs); 19 Sep 2016 14:45:23 -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: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=wN0VTyjj+HgPelx6jmcUK8I+LEBq1m/6us0HX9YiExY=; b=xzxhdJxXv6N1SIa5aPTYHguDDAAwhBgjukRJXGI+finl3DawwoV0nc76S0zTKxvcIn 3GJjkIuCpQFVXK38UY/R0PMh/ubyol7aUxQon5ufzeO7rSNKC3PtbfsgmYZnZmQXtQDn CtnFKrRkgKv7U7nnL/b1GNd/8z570vx0qcLH9VkZMM08SB99D3TGFlZNbsKyhnR8QGQH IZ4eOmiLIDZB7e0F3b44md+2oyqIv4OknJBY991gEcoGJhZNyk2g550gn66MepIkUYyA PV4QRNvW209zygB9Ua6ltdi5YiW+EgAN3POPjzvtUTOxQDluupzNAIbzb39PoCUsLMDW 3shQ== 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; bh=wN0VTyjj+HgPelx6jmcUK8I+LEBq1m/6us0HX9YiExY=; b=RBpISQ4EAVZPI66RBKgO53hEYt2G1EacL0/XYDNtqE50EggxmzQKK22QozRpT3tEnr CfvrjzVGMk9kCkaJvm1BMrU94i/sV6WProwa+4heEgI53zC2Mbtcqtm+9qE/Cp+jFiBW kHMdmUv2fCMAbp2Qoeg4ioC2gimptvzMShIqOVhOR8sqqQ0YP6Bl0N2LOn5jaYES8UJc WXJeD/lzCh8ylhnHO1MjDajiySRK/TFhH1g1SVo82n3mFJn4CECCwZT/CzAzCSZTpl4/ iF9DeLgDBmJuBAW8nnhpaPQ1LFQUu8XTbNGMGGhXezr85hQ8+w2H1u102aExpqLdnYz1 uIew== X-Gm-Message-State: AE9vXwOYKDpHU73uJ3dG0fRrBDuQdMW5XnXz0XmJwDGIe8J1DW1ZTEZB8iNGShou7r3wvA== X-Received: by 10.98.137.145 with SMTP id n17mr33626247pfk.170.1474296316660; Mon, 19 Sep 2016 07:45:16 -0700 (PDT) From: Bart Schaefer Message-Id: <160919074515.ZM28018@torch.brasslantern.com> Date: Mon, 19 Sep 2016 07:45:15 -0700 In-Reply-To: <20160912233028.GA17257@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "Setting the 'completer' style - _match and **" (Sep 12, 11:30pm) References: <20160912233028.GA17257@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Setting the 'completer' style - _match and ** MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 11:30pm, Daniel Shahaf wrote: } } I've come up with the following: } . } bindkey $'\t' complete-word } zstyle ':completion:*' completer _all_matches _match-ds _expand _complete _ignored } _match-ds() { } [[ $PREFIX$SUFFIX != *[*][*]* ]] && _match "$@" } } } . } The idea is that if a pattern contains "**" then _match('s wrapper) will } leave it for _expand to process. } } Is there another way to implement this? You could probably come up with a "zstyle -e" formulation that would only include_match in the completer value in the right circurmstances. I'm not sure that's a better solution than yours. I'll note in passing that _match is supposed to be used after _complete, not before _expand. Might it be better to suppress the _expand completer in the cases where you want _match rather than the other way around?