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

Re: command-spelling correction strangeness



[This is a copy of a message sent to Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxxxxxxxxx> that I Cc'ed to zsh-workers
before remembering that I was on a ORBS-tainted site whose mail
is rejected by sunsite.auc.dk.]

On Wed, Sep 29, 1999 at 05:39:43AM +0000, Bart Schaefer wrote:
> A change was made about a year ago (zsh-workers/4404 and follow-ups) to
> remove entries for non-executable files from the command hash table.
> This happens only when "autocd" is set, because the only bad side effect
> of bogus hash table entries is that if they're directories rather than
> non-executable files, you can't autocd into them.
> 
> However, if you have the hashcmds option set, the rest of the path is
> searched and the correct location gets immediately added back again --
> so you do not set hashcmds.  Am I correct?

[detailed explanation snipped]

Yes (as you may have seen in my "zsh -f" demonstration).  The explanation
is plausible.  I am now a little mystified by the documentation where it
says:

: HASH_CMDS <D>
:      Note the location of each command the first time it is executed.
:      Subsequent invocations of the same command will use the saved
:      location, avoiding a path search.  If this option is unset, no
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
:      path hashing will be done at all.
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

(I admit that I have read only the documentation, not the source code.)

> So ... what you describe may or may not be a bug, but the following should
> cause the command table to be updated more intelligently.  I'd be just as
> happy with encouraging people not to use "correct" without "hashcmds" ...

It could be added to the documentation ....

[patch snipped]

	-Paul <kimoto@xxxxxxxxxxxxx>



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