From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11357 invoked from network); 23 Apr 2003 10:59:35 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Apr 2003 10:59:35 -0000 Received: (qmail 169 invoked by alias); 23 Apr 2003 10:59:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18462 Received: (qmail 160 invoked from network); 23 Apr 2003 10:59:31 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Apr 2003 10:59:31 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Apr 2003 10:59:30 -0000 Received: (qmail 30010 invoked from network); 23 Apr 2003 10:55:46 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-4.tower-1.messagelabs.com with SMTP; 23 Apr 2003 10:55:46 -0000 Received: from gmcs3.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA15907; Wed, 23 Apr 2003 11:54:53 +0100 X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.61] claimed to be gmcs3.logica.co.uk Received: from gmcs3.logica.co.uk (localhost [127.0.0.1]) by gmcs3.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h3NAslF23064; Wed, 23 Apr 2003 12:54:48 +0200 cc: zw X-VirusChecked: Checked In-reply-to: <20030401054125.86443.qmail@web10410.mail.yahoo.com> From: Oliver Kiddle References: <20030401054125.86443.qmail@web10410.mail.yahoo.com> To: Felix Rosencrantz Subject: PATCH: Re: Bug with _sh completion function Date: Wed, 23 Apr 2003 12:54:47 +0200 Message-ID: <23062.1051095287@gmcs3.logica.co.uk> On 31 Mar, Felix Rosencrantz wrote: > There is a problem with the sh completion function. > > I have a script in the cwd called Build.sh > When I try to complete: sh -x B > The _sh function attempts to complete executable&builtin commands, but not > files in the cwd. It should be completing files in the cwd. (I don’t have dot > in my path.) This change makes it complete files too. Unfortunately, it further exacerbates the situation with respect to directory completion. If you have autocd set, they already get completed twice and with this, they get added thrice as completions after sh. > I'm not sure what _sh is trying to do, but it is an attempt at a completion > function for several different shells at once. Well, the shells all accept a command as a parameter to run so it is useful to complete commands for them. Completion in command position was somewhat simpler when I first added _sh. Oliver Index: Completion/Unix/Command/_sh =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sh,v retrieving revision 1.2 diff -u -r1.2 _sh --- Completion/Unix/Command/_sh 28 Aug 2001 20:35:53 -0000 1.2 +++ Completion/Unix/Command/_sh 23 Apr 2003 10:43:36 -0000 @@ -16,7 +16,9 @@ local n=${words[(b:2:i)[^-]*]} if (( n <= CURRENT )); then compset -n $n - _normal && return 0 + _alternative \ + 'files:file:_files' \ + 'commands:command:_normal' && return 0 fi _default fi