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

Re: caching mechanism and Re: PATCH Completion for _yum

On Dec 14, 12:38pm, Oliver Kiddle wrote:
} > > Whether we want to be keeping caches also in a global variable is a
} > > different question
} > keeping the data in a variable may not be a good idea.
} I'm uneasy about it either way. What about someone who wants to set
} use-cache to false? It also seems a pity not to keep the variable
} between _complete and various runs of _correct/_approximate.

Well, the point of it being a global is that it *is* kept, not just
between _complete and others, but for the whole shell session, unless
overwritten by _retrieve_cache, which should only happen if the cache
is invalid.

The basic idea -- take any variable the caller wants, and stuff its
value in a file in a quickly-reloadable format -- is a good one; I
just think the way the styles are used to configure it is a lot more
convoluted than necessary.

} Sven also stated:
}       We decided some time ago that they [completion functions]
}       shouldn't set styles themselves, only look them up.
} That was apparently ignored.

There are a couple of cases where it's more convenient to do a test-
and-set of a style rather than having to repeat the default values in
multiple places, if you know the order in which the style calls will
be made.  But I would say that normally that should happen only in the
circumstance where an autoload file is first setting the style and
then redefining its own function, so the setting happens only once.

} Another option would be to deprecate the old mechanism completely?

I've no problem with that, either -- though more recently a lot of
work was put into making the cache file write/read as fast as possible,
so it would be nice to preserve that.

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