From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 8d8e398f for ; Mon, 13 Jan 2020 17:07:17 +0000 (UTC) Received: (qmail 17545 invoked by alias); 13 Jan 2020 17:07:11 -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: List-Unsubscribe: X-Seq: 24655 Received: (qmail 20296 invoked by uid 1010); 13 Jan 2020 17:07:11 -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.102.1/25691. spamassassin: 3.4.2. Clear:RC:0(66.111.4.26):SA:0(-2.6/5.0):. Processed in 3.754974 secs); 13 Jan 2020 17:07:11 -0000 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) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdejtddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjfgesthdttddttdervdenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cukfhppeejledrudektddrheejrdduudelnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu rdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgenucevlhhushhtvghrufhiiigvpe dt X-ME-Proxy: Date: Mon, 13 Jan 2020 17:06:30 +0000 From: Daniel Shahaf To: Pier Paolo Grassi Cc: Zsh-Users List Subject: Re: problem with context specification Message-ID: <20200113170630.GA8134@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Pier Paolo Grassi wrote on Mon, Jan 13, 2020 at 17:46:09 +0100: > if I substitute this as the general case, eg: > > zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z} l:|=* r:|=*' > > then everything get this style, so the syntax is correct. it seem that what > is wrong is the pattern. > I tried some variations of it, with no success: > > zstyle ':completion:*:*:episodes:*' ... > zstyle ':completion:*:episodes:*' ... > > my main problem is that I don't really understand the pattern syntax, and > haven't been able to find a man page detailing it (the documentation on the > zstyle builtin doesn't explain it), so I basically try random variations. The documentation does explain it; quote: For ordering of comparisons, patterns are searched from most specific to least specific, and patterns that are equally specific keep the order in which they were defined. A pattern is considered to be more specific than another if it contains more components (substrings separated by colons) or if the patterns for the components are more specific, where simple strings are considered to be more specific than patterns and complex patterns are considered to be more specific than the pattern `*'. The upshot of this is that each of the patterns ':completion:*:*:episodes:*' and ':completion:*:episodes:*' is considered to be more specific than ':completion:*'. A style set under either of the former would have precedence over a style set under the latter, _as far as zstyle is concerned_. (See pws's answer for the caveat.) > Using ctrl-x h after episodes on the command line it gives: > > tags in context :completion::complete:episodes:: > argument-rest (_arguments _episodes) > > so I've tried: > zstyle ' :completion::complete:episodes::' > > but still to no effect, and also the lack of * seems a little suspicious No, the lack of stars is expected. What you put in zshrc is patterns; the completion system then looks up specific strings that the patterns are matched against. The settings attached to the most specific pattern that matches are used. Minimal example: zshrc contains: % zstyle ':foo:bar' lorem yes % zstyle ':foo:*' lorem no Then the foo subsystem might run, for example: % zstyle -t :foo:bar lorem && pwd /home/daniel % zstyle -t :foo:baz lorem && pwd % I take it the documentation of zstyle didn't make this clear, so could you suggest how to improve it? Cheers, Daniel