From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7691 invoked by alias); 14 Aug 2011 21:54:48 -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: 16222 Received: (qmail 8991 invoked from network); 14 Aug 2011 21:54:46 -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: Sun, 14 Aug 2011 23:54:44 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: command completion Message-ID: <20110814215444.GJ20653@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20110814205936.GI20653@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6194-vl-r44775 (2011-07-13) On 2011-08-14 23:09:37 +0200, Mikael Magnusson wrote: > On 14 August 2011 22:59, Vincent Lefevre wrote: [...] > > Now, if I move blah-cmd somewhere else in $PATH, and use > > > > % zstyle ':completion:*:complete:-command-:*' tag-order 'commands' > > % blah[TAB] > > > > then only blah-cmd is proposed, as expected. However if I do: > > > > % mkdir ~/blah-hdir > > % cdpath=(. ~) > > % setopt AUTO_CD > > % blah[TAB] > > > > then both blah-cmd and blah-hdir/ are proposed. I don't see why > > blah-hdir/ should be regarded as a command. > > Because it might contain executable files? Then what? First, zsh does not complete to such executable files, so that's a wrong reason. Moreover such executable files cannot be executed anyway, because they are not in the path! And if the current directory happens to be $HOME, zsh does not propose blah-hdir/ in the completions. It seems the reason is that the directory (and possible subdirectories) is a candidate for the autocd. But my point is that such a directory is not a command ('commands' was specified first in tag-order). > What happens when you only create the dir and don't do the other > things? Both the "cdpath=(. ~)" and "setopt AUTO_CD" are necessary to make this (IMHO incorrect) behavior appear. Otherwise blah-hdir/ is not proposed as a completion. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)