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

Re: named dirs and corrections



On Fri, 9 Oct 2009 16:37:00 +0200
Andreas Sahlbach <andreas.sahlbach@xxxxxxxxx> wrote:
> Is it possible to give cdpath directories a higher priority than corrections
> during a "cd"?

I think the simple answer is "no".  Spelling correction is very simple
and doesn't know about--well, anything very much beyond the fact that
it's on a word that might want to be treated as a command word, or a
file.

Hmmm... having looked at the code I can see that if you set the AUTOCD
option and type a directory name (no cd), then correction is correctly
applied to the command argument to treat it as a diretory in cdpath
(along, of course, with all the other possibilities that could occur
here).  This isn't quite what you want, of course.

The vague, touchy-feely it's-probably-never-actually-going-to-happen
answer is that a better way of doing spelling correction would be to use
the completion system but with a different interface to prompt for
corrections.

A slightly less hopeless answer is that it's not rocket science to
create a widget that runs when you hit <return> on a command line that
does spelling correction that could be tweaked, but it's still not
trivial.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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