From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24938 invoked from network); 2 Oct 2002 08:34:53 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Oct 2002 08:34:53 -0000 Received: (qmail 25716 invoked by alias); 2 Oct 2002 08:34:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5410 Received: (qmail 25702 invoked from network); 2 Oct 2002 08:34:29 -0000 From: "Bart Schaefer" Message-Id: <1021002083329.ZM16730@candle.brasslantern.com> Date: Wed, 2 Oct 2002 08:33:29 +0000 In-Reply-To: <20021002075023.GA802@chem.helsinki.fi> Comments: In reply to Jonas Juselius "Re: zstyle problems" (Oct 2, 10:50am) References: <20021001113453.GA3095@chem.helsinki.fi> <1021002031516.ZM14546@candle.brasslantern.com> <20021002075023.GA802@chem.helsinki.fi> X-Mailer: Z-Mail (5.0.0 30July97) To: Jonas Juselius , zsh-users@sunsite.dk Subject: Re: zstyle problems MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 2, 10:50am, Jonas Juselius wrote: } Subject: Re: zstyle problems } } I still think this is a bit confusing. Typing 'cd' and then pressing } ^Xh says 'tags in context :completion::complete:cd::', which made me } think that this was the actual context... It is the context for the tags (hence "tags in context ..."), but not the context for any old style that has nothing to do with tags. I agree that it's confusing at first, but this is the way the system is structured; because it isn't just based on simply completing after a known command name any more, there has to be a way to bootstrap it. The completers are what figure out the full context by examining the command line in detail (among other things that they do). } What would be the correct way of defining different (individual) } completions for 'cd' and other commands? There's a difference between defining completions (which is done with compdef and a function) and defining completion behaviors (which is done with zstyles for completers and tags). Some completers implement other special styles (like max-errors for _correct) to adjust their behavior, but there isn't direct support for changing the entire set of completers based on the command name, because of the bootstrapping issue. However, there's an example in the documentation under the _approximate completer that shows how to change the entire list of completers based on a condition of your own invention. (Hmm, I just noticed that example is missing a "-e" flag in the "zstyle" command. Doc typo.) You'd want something like zstyle -e ':completion::*' completer '\ case $words[1] in (cd|chdir) reply=(_complete);; (*) reply=(_complete _correct _approximate);; esac' } Ok, I tried this but I didn't see any difference from the standard } completion... I presume you mean you tried *this*: } > zstyle ':completion::complete:-tilde-:*' tag-order \ } > named-directories users directory-stack } Could this have something to do with menu completion and sorting? You want to look at the group-order style, and its partner group-name, as well as tag-order. If you haven't already, add to you .zshrc: zstyle ':completion:*' group-name '' and see if that doesn't change something. Then start experimenting with group-order. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net