From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23617 invoked by alias); 15 Aug 2011 04:14:07 -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: 16243 Received: (qmail 26558 invoked from network); 15 Aug 2011 04:13:56 -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,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110814211341.ZM20215@torch.brasslantern.com> Date: Sun, 14 Aug 2011 21:13:41 -0700 In-reply-to: <20110815005734.GM20653@prunille.vinc17.org> Comments: In reply to Vincent Lefevre "Re: command completion" (Aug 15, 2:57am) References: <20110814205936.GI20653@prunille.vinc17.org> <110814151453.ZM19551@torch.brasslantern.com> <20110814230737.GK20653@prunille.vinc17.org> <110814165650.ZM19855@torch.brasslantern.com> <20110815005734.GM20653@prunille.vinc17.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: command completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 15, 2:57am, Vincent Lefevre wrote: } } > [...] because there are two passes and there are no } > *additional* completions for the "command" tag added inside _cd, all } > the defaults for _cd get added as well. } } OK, but this behavior is a bit strange: if I use } } zstyle ':completion:*:complete:-command-:*' tag-order 'commands' } } on my example, then I get: } % prefix- } prefix-cmd1 prefix-dir/ } from the "dir" directory. And from the parent directory "temp_dir", } prefix[TAB] gives prefix-cmd1 only (i.e. prefix-dir/ has mysteriously } disappeared though it is a cd target). To understand that you have to read comments in _cd, explaining that it assumes (incorrectly because of your tag-order) that _command_names has already added all the names of local subdirectories, so _cd should not do so again. Wheels within wheels ... } However wouldn't it be cleaner if there were a specific } tag for autocd? Yes, but to do that would require abstracting the guts of both _cd and _command_names somehow so they could be combined into a single _tags loop in _autocd. As you're the only person who has complained about this in many years, there's been no impetus to make that effort. Most people are probably already have zstyle ':completion:*:complete:*' group-name '' and are therefore content with zstyle ':completion:*:complete:-command-:*' group-order commands which makes sure that the command names are offered first, rather than mixed with the directory names.