From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11176 invoked by alias); 10 Jan 2015 02:12:58 -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: 19720 Received: (qmail 8833 invoked from network); 10 Jan 2015 02:12:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Kc1larcG c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=oTU6sMeUR2wsWZSVPhQA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150109181241.ZM21734@torch.brasslantern.com> Date: Fri, 09 Jan 2015 18:12:41 -0800 In-reply-to: <20150108123606.GA9609@ypig.lip.ens-lyon.fr> Comments: In reply to Vincent Lefevre "Re: completion" (Jan 8, 1:36pm) References: <30453.1418258082@thecus.kiddle.eu> <5488F0AC.2040901@eastlink.ca> <141210214454.ZM12261@torch.brasslantern.com> <5489C8F4.8030703@eastlink.ca> <141211092824.ZM13349@torch.brasslantern.com> <5489F1BC.5000900@eastlink.ca> <20150107150109.GA14088@ypig.lip.ens-lyon.fr> <20150108004323.GA7954@xvii.vinc17.org> <20150108123606.GA9609@ypig.lip.ens-lyon.fr> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 8, 1:36pm, Vincent Lefevre wrote: } } I don't understand. I suppose that the real intent of } } zstyle ':completion:*:complete:*' matcher-list [...] } } was to match the completer "complete", i.e. like } } zstyle ':completion:*:complete:*:*:*' matcher-list [...] } } But what if the context is ":completion::foo:complete::" in some } completion, i.e. with the completer "foo" and the command "complete"? First of all, the completer "_foo" would have had to have been added to the "completer" style (the default value of this style is _complete and _ignored), and second, the _foo function would have to contain a zstyle command that looks up the value of the matcher-list style. If either of those conditions does not hold, the context will never be ":completion::foo:complete::" and the question is not relevant. The assumption, therefore, is that if the user has deliberately added _foo to the completer style, then he is also aware that _foo may want to look up match-list, and therefore he will have used the form with more colons and/or fewer asterisks when defining the matcher-list for each of the two completers that want a matcher-list. } It would match, wouldn't it? But the intent was to match only the } completer "complete", not "foo"! The zstyle command can't psychically predict the user's intent. It's not up to zstyle to make it impossible for the user to mistakenly use a pattern that's not specific enough. It's also not up to zstyle to force the user to make patterns more specific than necessary. The format is carefully documented and the user can be as paranoid as he wishes to be in limiting the contexts that match.