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

Re: correction hook



> Aliases have served me well for the few common typos like this. I have
> reservations about this because this simple function probably doesn't
> go far enough. How might you disable correction for certain words, e.g.
> the destination to a mv command?

Sorry, I described a specific case and forgot to mention the more
general problems.  They are as follows.

1) In the case of mak/mawk/make, the user has no instances of 'mawk'
in his history, but he has recently typed 'make'.  The correction
algorithm is unaware of these details.

2) When one has CORRECT_ALL set, correction isn't nearly as intelligent
as completion.  I have things like
alias cp='nocorrect cp'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'

Rather than adding a slew of additional aliases, it would be nice if
correction were smart enough not to assume that arguments to, f.ex.,
ssh should match local files.

> I'm not entirely convinced by the correction mechanism because it has
> to interrupt you with its prompt. With the new completion system I get
> any typo in a word I completed corrected by _approximate anyway. I'd be
> more inclined to think about a totally different way of spotting and
> communicating typos such as using the completion system continually and
> underlining possible typos.

I imagine that would be slow, though quite useful to some.



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