From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20265 invoked from network); 8 May 2008 08:53:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 May 2008 08:53:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 47266 invoked from network); 8 May 2008 08:53:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 May 2008 08:53:19 -0000 Received: (qmail 23773 invoked by alias); 8 May 2008 08:53:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24974 Received: (qmail 23760 invoked from network); 8 May 2008 08:53:15 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 May 2008 08:53:15 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id 0C86480ED172 for ; Thu, 8 May 2008 10:53:11 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly25g.srv.mailcontrol.com (MailControl) with ESMTP id m488r7oH031502 for ; Thu, 8 May 2008 09:53:08 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 May 2008 09:53:07 +0100 Date: Thu, 8 May 2008 09:53:07 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: Bug in spell correction of directories for cd Message-ID: <20080508095307.5dd54625@news01> In-Reply-To: <20080507233234.GQ13554@prunille.vinc17.org> References: <20080507233234.GQ13554@prunille.vinc17.org> Organization: CSR X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 May 2008 08:53:07.0038 (UTC) FILETIME=[EF1967E0:01C8B0E8] X-Scanned-By: MailControl A-08-50-01 (www.mailcontrol.com) on 10.71.0.135 X-Virus-Scanned: ClamAV 0.91.2/7060/Thu May 8 08:07:49 2008 on bifrost X-Virus-Status: Clean On Thu, 8 May 2008 01:32:34 +0200 Vincent Lefevre wrote: > This has annoyed me from some time, but spell corrections of directories > doesn't work correctly. I think it doesn't take the cdpath into account > or something like that. As far as I can see the only place where directories are handled specially during spell-checking is in command position with AUTO_CD set. Spell checking is very much simpler than completion and has virtually no knowledge of context beyond whether or not the word is in command position. It's in the main shell, which makes it hard to use all the pre-existing correction code in completion. Probably the only sensible way to improve it would be to run something when the line editor exited. Even that's quite hard to set up since it would have to scan every word as if it were being completed, or something such. You can, of course, set up correction so that you can invoke it directly from the line editor, but it's not the same as having it checked as you go along. Hmm... I wonder if there's scope for an even-more-magic-space command that sees if a shell argument has just been completed and if it should spell check it? You'd need a long list either of exceptions or inclusions, which might have to be narrowed down by argument position. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070