From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27775 invoked by alias); 20 Sep 2016 15:46:18 -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: 21952 Received: (qmail 19339 invoked from network); 20 Sep 2016 15:46:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f173.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.173):SA:0(0.0/5.0):. Processed in 0.812748 secs); 20 Sep 2016 15:46:18 -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=mtU9Zp6pPOFOz4Rtrxxm8mdCTPmZmP3gsXwzYZNO6j8=; b=B2mj9PNNyuzitv78ptKvEvAgHOsbyUwWqvGvDCH0Y75eO2oPGuNAOWB0EpMLuT+Yic AiUXvUlO7hDQj8G/EZ5o+cI2lVSqeMzmV97amfZ7YVaSbSCisOVJsOsVGDPRCEVpqxP4 rlyav0sKwbFOrtLjBE4jhvOSQTSWrF7YCnj75giY4V9/pHfKtmTBGU9YRjt83/9rdItb G5ijwEy3m4iSD/GZHAsD5ntsNYcdC5oAqqmVMFXhyfrUQN8hF7HsQdzPRe4xq/N868kH bmzd7k++9z1EuWVXoyIRAn/+NcXv7xnfvcMt1QW04wHSntf0epzHyuTkkcAj9FSOi0Oz odJQ== 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=mtU9Zp6pPOFOz4Rtrxxm8mdCTPmZmP3gsXwzYZNO6j8=; b=lD2UKQ2WtDuMXrJE3spvxDBZ6rF89xgrtEDpHtOEnT1MyLch0yzHYFVTEDqwu8Rjsy Jr8cBRq3ddZP3qFxqIiYkT2YuJTBauQN9dkt/+e4vcv4m6VprYS8Q1wraMGRtli4QLIX E9VkzObpE9y5+YbAFu8y+fUt/PMih+px5MudWT6Xy3Yn6FJDCjBnUxTRXPb47IEAIw8L b+q+yPjlIMDhWUYIlmH30AyB8lfmHPYF2jTe9hgeNNKNXvmGfKwZojHfunCIKog3Pdtq Hpv1TThjPlWEoTEtqxGJS3G0li0DBvak7sv1blx6yo+r1zJFNFTj2e06Xo6rq0Y0gxuH O11g== X-Gm-Message-State: AE9vXwM7chm1RcYstqO5YVe8G3/IFMobfx0prgGdFTllkkTBHhWEkRwhYSYt+P80SK6ijw== X-Received: by 10.98.73.202 with SMTP id r71mr56426490pfi.36.1474386368603; Tue, 20 Sep 2016 08:46:08 -0700 (PDT) From: Bart Schaefer Message-Id: <160920084607.ZM31623@torch.brasslantern.com> Date: Tue, 20 Sep 2016 08:46:07 -0700 In-Reply-To: <20160920085431.GA3720@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "Re: Setting the 'completer' style - _match and **" (Sep 20, 8:54am) References: <20160912233028.GA17257@fujitsu.shahaf.local2> <160919074515.ZM28018__10595.0927398682$1474296416$gmane$org@torch.brasslantern.com> <20160920085431.GA3720@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 20, 8:54am, Daniel Shahaf wrote: } } [ Your MUA seems to have changed the subject: your email has a hyphen } where the email you reply to had an em dash. ] Sorry about that; mail to my home desktop passes through a number of gateways and processing steps, some of which think non-ascii subjects are potential spam indicators. } > } The idea is that if a pattern contains "**" then _match('s wrapper) will } > } leave it for _expand to process. } > } > You could probably come up with a "zstyle -e" formulation that would only } > include_match in the completer value in the right circurmstances. } } How would I do that? I think the "right circumstances" are [[ $curtag } == *(file|dir)* ]], but the 'completer' style is looked up under the } context :completion:::::, before tags are known. I was thinking quite literally what you said about the pattern: zstyle -e ':completion:*' completer \ '[[ $PREFIX$SUFFIX == *[*][*]* ]] && reply=(... _expand ...) || \ reply=(... _match ...)' But you could add to the [[ ]] e.g. "&& $words[1] == service" (the value of $service hasn't been set yet there either because it's a feature of _complete).