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=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 ef807716 for ; Tue, 14 Jan 2020 16:01:24 +0000 (UTC) Received: (qmail 600 invoked by alias); 14 Jan 2020 16:01:15 -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: 24660 Received: (qmail 3906 invoked by uid 1010); 14 Jan 2020 16:01:15 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk1-f173.google.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(209.85.221.173):SA:0(-2.0/5.0):. Processed in 5.361324 secs); 14 Jan 2020 16:01:15 -0000 X-Envelope-From: pierpaolog@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.173 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ruFCbyrwoIaOYU4XbRhpHYQSeFH4Tdx0aq0dAbjZUGk=; b=M40Xt5eMokaXfHZxOgowTLRciWuhwQG2/YfCInBwVE84vByep5rOOHQO2MrjPPysO6 bfgR0lm9MZCreYSqRZL0gUyfCuHLuOwX8CPcygxOl3GT/oBPXNkBANhHdXsfkuSMUyMA 3Il24/WEFVwICWSW39Bij0jL//TqBIHBRbMsq5oRxOhhlorHmJ9LcFvMYXggxqJlN/rC va6rjMpvyP/+v/Yp7HMXfx5wA5+T+0mHN6Rcyr5976gg8S+51G/nxmnlOz1rvKMEqpVN 99Jy7iuYAlVUMpPP4/yVuRojxvhJHAjWb12E3dPbeP3czcbqFWgXj2W+Xjwc3sG/Q/pt ggsA== X-Gm-Message-State: APjAAAU9ocv6dWWrCzzOim7o435F2CL9YX0USKMjUQxl/HLxjm3LDL4o YmKo3BrHPkGkP2j1mMW3KN7uijNYQ6SDqTycXGw= X-Google-Smtp-Source: APXvYqzQy/YR46B9RfivB6nW/p+7BDdiTfn7BqGse9ki1sdlc/JyuQ0A64/m68iI5YXNBQ0pB0QrDfp0ozbT2OIdJU4= X-Received: by 2002:ac5:c9a7:: with SMTP id f7mr11130711vkm.58.1579017635567; Tue, 14 Jan 2020 08:00:35 -0800 (PST) MIME-Version: 1.0 References: <20200113170630.GA8134@tarpaulin.shahaf.local2> In-Reply-To: <20200113170630.GA8134@tarpaulin.shahaf.local2> From: Pier Paolo Grassi Date: Tue, 14 Jan 2020 16:59:58 +0100 Message-ID: Subject: Re: problem with context specification To: Daniel Shahaf Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000431caa059c1bb1f3" --000000000000431caa059c1bb1f3 Content-Type: text/plain; charset="UTF-8" thanks all for the clarifications. I will try to use the method described in the tag-order style documentation to answer Daniel: > I take it the documentation of zstyle didn't make this clear, so could you > suggest how to improve it? It's not clear to me what is the meaning of the various "sections"of the pattern (the segments delimited by the colons) what should I put in the first section? is there a list of possible values and relative meaning? and so on for each section why the number of sections is not the same for every pattern? How can I know how many pattern I should put in? I assume the stars are for matching every possible value for that segment, are there other globbing operators available? can I use them for prefix/suffix matching? (eg someth* for something etc) Not that I think it would be particularly useful, but the question came to mind I assume also that the stars don't match multiple segments, but this doesn't seem to be stated in the docs. regards Pier Paolo Grassi linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217 founder: https://www.meetup.com/it-IT/Machine-Learning-TO Il giorno lun 13 gen 2020 alle ore 18:06 Daniel Shahaf < d.s@daniel.shahaf.name> ha scritto: > 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 > --000000000000431caa059c1bb1f3--