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

Re: correction hook



Clint Adams wrote:
> Someone complained to me that when he mistyped "make" as "mak", zsh
> would spell-correct it to "mawk" instead of "make".  I had asked him for
> a proposed algorithm to solve this, but he had none.

When I wrote the approximate pattern matching stuff, I had it vaguely in
mind that you might want to give different types of error different
priorities, although it doesn't currently support that.  In this case,
unfortunately, that won't help, since they are both the same type of
approximation, adding a missing character.

You can add stuff to the hash table with the `hash' command; it's probably
a gap that, as far as I can see, you can delete commands you never want to
use or see completions or corrections for.  It's also always struck me as a
bit unhelpful that a rehash, implicit or explicit, removes all deliberate
changes to the command hash table.

If spelling correction could use the results from completion, there would
be ways around this, but that's always looked like it would need a major
rewrite.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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