Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in spell correction of directories for cd



On Thu, 8 May 2008 01:32:34 +0200
Vincent Lefevre <vincent@xxxxxxxxxx> 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 <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author