From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25380 invoked by alias); 22 May 2012 22:56:01 -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: 17108 Received: (qmail 23448 invoked from network); 22 May 2012 22:55:57 -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 Received-SPF: none (ns1.primenet.com.au: domain at klanderman.net does not designate permitted sender hosts) From: Greg Klanderman To: zsh-users@zsh.org Subject: Re: completion oddity Reply-To: gak@klanderman.net Date: Tue, 22 May 2012 18:55:53 -0400 In-Reply-To: (Bart Schaefer's message of "Tue, 22 May 2012 15:30:11 -0700") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.17 (linux) References: <20120521214023.GB10763@lorien.comfychair.org> <120521194232.ZM990@torch.brasslantern.com> <20120522050158.GC26384@lorien.comfychair.org> <20120522051617.GD26384@lorien.comfychair.org> <120521233507.ZM1136@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> On May 22, 2012 Bart Schaefer wrote: > On Tue, May 22, 2012 at 9:35 AM, Greg Klanderman wrote: >> >> Is there something I can put in matcher-list to effectively turn off >> this default and globally get the behavior as when you added "-M ''" > No. The sneaky thing here is that generically, the matcher-list > zstyle is for matching file names, not command options. > Consequently _arguments doesn't use the matcher-list style itself; > it's up to the individual context completion functions (like _k in the > example) to look up the style (presumably in an option-specific style > context) and pass it to _arguments -M. OK, thanks for looking into this Bart. So _main_complete is still looping over zstyle matcher-list values in completing parameters but it's not used? I do see that _arguments uses _description which uses _matcher if non-empty (as you noted earlier). I have to confess I cannot follow all this completion code though. Greg > Practically speaking, the assumption is that the completion function > must "know" exactly what the command options "look like" for the > command it is completing, so there's no reason to provide a way for > the user to override it. File names, on the other hand, could look > like anything, so the user is given hooks to tell completion about > those file names. > I can't recall any discussion of leading to a conscious decision to > have it work this way; it just fell out so from the incremental > process of making the completion system handle common cases cleverly > (without requiring the user to tweak everything).