From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18663 invoked by alias); 14 Aug 2011 23:07:41 -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: 16225 Received: (qmail 19583 invoked from network); 14 Aug 2011 23:07:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Mon, 15 Aug 2011 01:07:37 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: command completion Message-ID: <20110814230737.GK20653@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20110814205936.GI20653@prunille.vinc17.org> <110814151453.ZM19551@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <110814151453.ZM19551@torch.brasslantern.com> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6194-vl-r44775 (2011-07-13) On 2011-08-14 15:14:53 -0700, Bart Schaefer wrote: > Here we have the key. In order to stop "remaining tags" from being tried, > the value "-" must appear somewhere in the completion style. So your > problem is solved by: > > zstyle ':completion:*:complete:-command-:*' tag-order 'commands' - > > (note trailing dash). Not really. I still wish to generate a completion for directories in the cdpath if there are no matches. Consider the following example: autoload -U compinit compinit zstyle ':completion:*:complete:-command-:*' tag-order 'commands executables builtins functions aliases suffix-aliases reserved-words jobs parameters' - mkdir temp_dir cd temp_dir mkdir bin dir prefix-dir touch bin/prefix-cmd1 chmod 755 bin/prefix-cmd1 touch dir/prefix-cmd2 chmod 755 dir/prefix-cmd2 path=($PWD/bin $path) echo $path rehash cdpath=(. $PWD) setopt AUTO_CD cd dir If I type prefix[TAB][TAB], I get: % prefix-cmd prefix-cmd1 prefix-cmd2* as more or less expected (I don't know why prefix-cmd2 as an asterisk but not prefix-cmd1). However, if I type prefix-d[TAB], I get no completions, while I would like "prefix-dir". If I remove the trailing dash from the zstyle line and I type prefix[TAB][TAB], I get: % prefix- prefix-cmd1 prefix-cmd2* prefix-dir/ which is not what I want either. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)