From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19945 invoked from network); 10 Aug 2006 21:42:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Aug 2006 21:42:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 44609 invoked from network); 10 Aug 2006 21:42:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Aug 2006 21:42:12 -0000 Received: (qmail 13376 invoked by alias); 10 Aug 2006 21:42:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10584 Received: (qmail 13364 invoked from network); 10 Aug 2006 21:42:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 Aug 2006 21:42:04 -0000 Received: (qmail 43479 invoked from network); 10 Aug 2006 21:42:04 -0000 Received: from mtaout02-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 10 Aug 2006 21:42:02 -0000 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20060810214200.ZEGZ27023.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Thu, 10 Aug 2006 22:42:00 +0100 Received: from pwslaptop.csr.com ([81.107.41.155]) by aamtaout03-winn.ispmail.ntl.com with ESMTP id <20060810214200.GBLI11710.aamtaout03-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Thu, 10 Aug 2006 22:42:00 +0100 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.7/8.13.7) with ESMTP id k7ALfw4J005496 for ; Thu, 10 Aug 2006 22:41:58 +0100 Message-Id: <200608102141.k7ALfw4J005496@pwslaptop.csr.com> From: Peter Stephenson To: "Zsh Users' List" Subject: Re: Completing a unique prefix of "script" completes "script" In-Reply-To: Message from "Nikolai Weibull" of "Thu, 10 Aug 2006 22:17:30 +0200." Date: Thu, 10 Aug 2006 22:41:58 +0100 "Nikolai Weibull" wrote: > Is there a way to make sure that both options, i.e., "script/" and > "script ", are completed? This is all rather frustrating, yet again... Looks like you can get this with the combination of "setopt autocd" to have local directories completed and "zstyle ':completion:*' group-name ''" to separate groups, so that it knows that it's ok to have both matches for "script" separately. I'm not sure why you would need autocd---that looks like a bug, since you can execute commands by relative paths anyway. That's still not it, however, since you only get both if the completion is otherwise ambiguous (i.e. script and script/ aren't sufficiently different to show up separately). Bizarrely, playing around suggests my matcher-list is enough to make them appear "different": zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[.,_-]=**r:|=**' > Also, is there a way to ignore the command "script" found in $path? > Using the ignored-patterns style doesn't work, of course. And that's > basically the only thing I > was able to think of. You should be able to do it with the tag-order style so that it prefers the directory if it's found. However, there's something a bit screwy here, too. zstyle :completion::complete:-command-:: tag-order local-directories should prefer local directory completion to everything else, only offering other stuff if there's no local directory (or if you explicitly use _next_tags). But that doesn't work; you get all possibilities together. Explicitly listing other possibilities in a second argument doesn't work, either. However, it's not completely broken since zstyle :completion::complete:-command-:: tag-order local-directories - does work; that gives you only local directories and nothing else. So for some reason as soon as you try to specify an order it's assuming you don't want an order. You can cheat and unhash the command if you never use it. "unhash script" did seem to do the trick. Note, however, that a "rehash" will bring it back. That's about five things I don't understand. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/