Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: HASH_LIST_ALL?
- X-seq: zsh-users 8059
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Matt Garman <garman@xxxxxxxxxxxxxx>
- Subject: Re: HASH_LIST_ALL?
- Date: Thu, 14 Oct 2004 08:37:36 -0700 (PDT)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20041014034134.GA7178@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20041013200240.GA27249@xxxxxxxxxxxxxx> <Pine.LNX.4.61.0410131937060.24408@xxxxxxxxxxxxxxxxxx> <20041014034134.GA7178@xxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Wed, 13 Oct 2004, Matt Garman wrote:
> rehashComplete() {
> rehash;
> zle expand-or-complete;
> }
Egad. That means you're rehashing on every completion, not just on every
command completion. What a terrific waste of time and CPU. If you're
using compsys, the right way to do this is by adding to your completer
zstyle:
_force_rehash() {
(( CURRENT == 1 )) && rehash
return 1 # Because we didn't really complete anything
}
zstyle ':completion:*' completer \
_oldlist _expand _force_rehash _complete ...
(where "..." is the rest of whatever you already have in that style).
> That works (meaning, it makes the shell behave as I want), but I was
> just hoping there was a simpler method, i.e. "setopt something".
Unfortunately, there's not. Command completion uses the $command variable
from the zsh/parameter module, which means it forces command hashing to
occur even if you (un)set all the options that otherwise turn hashing off.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author