From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22376 invoked from network); 2 Aug 2000 14:13:47 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Aug 2000 14:13:47 -0000 Received: (qmail 23202 invoked by alias); 2 Aug 2000 14:13:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12488 Received: (qmail 23195 invoked from network); 2 Aug 2000 14:13:37 -0000 Date: Wed, 2 Aug 2000 16:13:29 +0200 (MET DST) Message-Id: <200008021413.QAA11687@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Adam Spiers's message of Wed, 2 Aug 2000 14:35:07 +0100 Subject: Re: PATCH: completion caching layer Adam Spiers wrote: > Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote: > > It's a bit unfortunate that _cache_invalid can be called twice (in > > your examples), once directly and once from _retrieve_cache. I think. > > Yes, I didn't like that either, but couldn't think of a better > design. The problem is that there are actually two caching layers - > the parameters, and the cache files on disk, but the _cache_invalid > check needs to be invoked if either is about to be used. Suggestions > for how to avoid this welcome. Couldn't we stuff everything in _retrieve_cache? So that one only needs to call: if ! _retrieve_cache RPMs _rpms; then _rpms=(...) _store_cache RPMs _rpms fi > ... > > > About the lookup: I /think/ it would be more convenient if the type of > > information cached would appear in the context, so that you could say > > `zstyle ":completion:*:rpms" cache-policy ...'. Haven't really played > > with it yet, though. > > I agree entirely. That way also I could make _perl_modules set a > default style (if one is not already set) when the function is loaded, > rather than each time it's invoked. But where would it appear in the > context? My knowledge of this stuff is slightly weak, I'm afraid. After the last colon: zstyle -t ":completion:${curcontext}:" ... ^here I.e., instead of the tag (if you would use tags). One problem is your naming scheme (upper-case) which is different from what we've used so far. And then the tags should be documented, or similar tags which are already used elsewhere could be used for caching. > > And another thing: with `zstyle -e' one could use a boolean style > > `cache-invalid' or whatever and let the user do the rest. It's hard to > > give arguments to that, though. Other than by documenting > > $_cache_path, that is. > > I think I understand that, but how would it be better than the current > system? Maybe hopefully consistency(?) I'm not too sure about this either, since there are still other styles which allow to give names of functions to be called (tag-order, for example). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de