zsh-workers
 help / color / mirror / code / Atom feed
From: Adam Spiers <adam@spiers.net>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: completion caching layer
Date: Wed, 2 Aug 2000 16:01:31 +0100	[thread overview]
Message-ID: <20000802160131.B19975@thelonious.new.ox.ac.uk> (raw)
In-Reply-To: <200008021413.QAA11687@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Wed, Aug 02, 2000 at 04:13:29PM +0200

Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote:
> 
> 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

I had thought of that, and then decided against it, probably for no
good reason whatsoever, as I was exhausted at the time :-) 

> > > 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).

OK.  Although that doesn't solve the problem of having to set a
default for each of the commands _perl_modules completes.  Maybe

  zstyle ':completion:::::RPMs' cache-policy _rpms_caching_policy

would work?

Incidentally I couldn't find anything in the documentation to explain
the difference between e.g. ::: and :*:*: in contexts.  Did I miss it?

> One problem is your
> naming scheme (upper-case) which is different from what we've used so
> far.

That's easily fixed...

I just noticed I forgot hunks for cache-policy.  Coming up in the next
patch ...


  reply	other threads:[~2000-08-02 15:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-02 14:13 Sven Wischnowsky
2000-08-02 15:01 ` Adam Spiers [this message]
2000-08-03 12:21   ` Adam Spiers
  -- strict thread matches above, loose matches on Subject: below --
2000-08-04  6:59 Sven Wischnowsky
2000-08-03  7:11 Sven Wischnowsky
2000-08-02  9:36 Sven Wischnowsky
2000-08-02 13:35 ` Adam Spiers
2000-07-27  8:00 Sven Wischnowsky
2000-08-01 16:31 ` Adam Spiers
2000-08-01 17:03   ` Bart Schaefer
2000-08-01 17:09     ` Bart Schaefer
2000-08-01 23:37     ` Adam Spiers
2000-08-02  3:53       ` Bart Schaefer
2000-07-19 14:48 Sven Wischnowsky
2000-07-26 19:53 ` Adam Spiers
2000-07-17 14:38 Adam Spiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000802160131.B19975@thelonious.new.ox.ac.uk \
    --to=adam@spiers.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).