From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6692 invoked from network); 28 Jan 2002 16:33:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Jan 2002 16:33:04 -0000 Received: (qmail 21008 invoked by alias); 28 Jan 2002 16:32:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16507 Received: (qmail 20997 invoked from network); 28 Jan 2002 16:32:53 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15445.31972.949053.686995@wischnow.berkom.de> Date: Mon, 28 Jan 2002 17:31:32 +0100 To: zsh-workers@sunsite.dk Subject: Re: _command_names and path In-Reply-To: <20020127204311.GA32345@dman.com> References: <20020121172829.GB6491@dman.com> <15437.17263.353779.491314@wischnow.berkom.de> <20020127204311.GA32345@dman.com> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Clint Adams wrote: > > Probably changing _command_names to use `_files -P/ -W/ ...' if `.' is > > not in $path. > > ... > + > +if [[ -n "$path[(r).]" ]]; then > + defs=( "$defs[@]" > + 'executables:executable file or directory:_path_files -/g \*\(-\*\)' > + ) > +else > + defs=( "$defs[@]" > + 'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)' > + ) > +fi I've been thinking about this, too, at the weekend. We need to complete files after things like `./', too. So we can make this slightly simpler. Bye Sven Index: Completion/Zsh/Type/_command_names =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_command_names,v retrieving revision 1.4 diff -u -r1.4 _command_names --- Completion/Zsh/Type/_command_names 2002/01/27 21:57:54 1.4 +++ Completion/Zsh/Type/_command_names 2002/01/28 16:31:03 @@ -10,15 +10,10 @@ 'commands:external command:compadd -k commands' ) -if [[ -n "$path[(r).]" ]]; then +[[ -n "$path[(r).]" || $PREFIX = */* ]] && defs=( "$defs[@]" 'executables:executable file or directory:_path_files -/g \*\(-\*\)' ) -else - defs=( "$defs[@]" - 'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)' - ) -fi if [[ "$1" = -e ]]; then shift -- Sven Wischnowsky wischnow@berkom.de