From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29580 invoked from network); 10 Sep 2003 07:51:01 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Sep 2003 07:51:01 -0000 Received: (qmail 5297 invoked by alias); 10 Sep 2003 07:49:58 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6557 Received: (qmail 5265 invoked from network); 10 Sep 2003 07:49:57 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 10 Sep 2003 07:49:57 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 10 Sep 2003 7:49:57 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-15.tower-36.messagelabs.com!1063180179!451510 X-StarScan-Version: 5.0.7; banners=-,-,- Received: (qmail 22024 invoked from network); 10 Sep 2003 07:49:39 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-15.tower-36.messagelabs.com with SMTP; 10 Sep 2003 07:49:39 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h8A7naHM018619; Wed, 10 Sep 2003 08:49:37 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h8A7pno01962; Wed, 10 Sep 2003 09:51:49 +0200 cc: Zsh Users X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20030908191720.GR6280@strindberg.student.uu.se> From: Oliver Kiddle References: <20030813131429.GA2413@fruitcom.com> <20030908191720.GR6280@strindberg.student.uu.se> To: Jesper Holmberg Subject: Re: preexec function to work after `&&' Date: Wed, 10 Sep 2003 09:51:49 +0200 Message-ID: <1960.1063180309@gmcs3.local> Jesper Holmberg wrote: > I only now found the time to experiment with Eric's neat preexec function, > and it's very nice. However, I'd like it to also work with tab completion, > is that possible? Not without modifying completion functions I don't think. Completion in command context uses the -command- special context. By default this ($_comps[-command-]) is the _autocd function. So the easiest is perhaps to write your own wrapper function: _cmd_or_file() { _alternative \ 'files:file:_path_files -g "(#i)*.(html|jpg|jpeg|tif|tiff|png|doc|xls)"' \ 'commands:command:_autocd' } Then use this new function for the -command- context: compdef _cmd_or_file -command- Or you might find it easier to just get the latest 4.1 sources from CVS and try out Peter's new suffix aliases feature. Oliver