From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28487 invoked from network); 21 Jun 2001 09:18:56 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jun 2001 09:18:56 -0000 Received: (qmail 17591 invoked by alias); 21 Jun 2001 09:18:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15020 Received: (qmail 17573 invoked from network); 21 Jun 2001 09:18:15 -0000 From: "Bart Schaefer" Message-Id: <1010621091740.ZM1701@candle.brasslantern.com> Date: Thu, 21 Jun 2001 09:17:40 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: PATCH: Completion for AUTO_CD MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii This should be pretty self-explanatory, except for the fact that it's named _autocd because _command is pre-empted for the `command' builtin. There doesn't seem to be a lot of documentation for the context funcs. Some of them get mentioned in a few places as if people should know that they exist (e.g. _default in the use-compctl entry) but that's all, so I didn't document this one either. May I add this to 4.0.2? On a semi-related note, why doesn't _command call `_command_names -e'? Index: Completion/Zsh/Context/_autocd =================================================================== RCS file: _autocd diff -N _autocd --- /dev/null Tue May 5 13:32:27 1998 +++ Completion/Zsh/Context/_autocd Thu Jun 21 01:55:18 2001 @@ -0,0 +1,5 @@ +#compdef -command- + +_command_names +local ret=$? +[[ -o autocd ]] && _cd || return ret Index: Completion/Zsh/Command/_cd =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Command/_cd,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 _cd --- Completion/Zsh/Command/_cd 2001/04/09 20:14:09 1.1.1.1 +++ Completion/Zsh/Command/_cd 2001/06/21 08:48:03 @@ -24,7 +24,7 @@ rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}}) (( $#rep )) && _wanted -C replacement strings expl replacement compadd -a rep else - _directory_stack && ret=0 + [[ CURRENT -gt 1 ]] && _directory_stack && ret=0 if [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then local tdir tdir2 Index: Completion/Zsh/Type/_command_names =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Type/_command_names,v retrieving revision 1.2 diff -u -r1.2 _command_names --- Completion/Zsh/Type/_command_names 2001/06/18 18:01:55 1.2 +++ Completion/Zsh/Type/_command_names 2001/06/21 08:54:50 @@ -1,4 +1,4 @@ -#compdef -command- +#autoload # The option `-e' if given as the first argument says that we should # complete only external commands and executable files. This and a -- 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