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

Re: Documentation error



On Sat, Dec 10, 2011 at 06:37:04PM +0100, Mikael Magnusson wrote:

>> Hi All,
>>
>> Is the following an error in the documentation from man zshcompsys:
>>
>>      _example_caching_policy () {
>>             # rebuild if cache is more than a week old
>>             local -a oldp
>>             oldp=( "$1"(Nmw+1) )
>>             (( $#oldp ))
>>         }
>>
>> Technically won't this rebuild the cache if it's more than TWO weeks
>> old? "$1"(Nmw+0) seems to do one week old for me,
> 
> It depends on what you mean by more than one week. The way it works in
> zsh is that -, +, and no sign are disjunct sets, so mw-1, mw1, mw+1
> don't have any overlap. mw1 is any files that are one week old, which
> is 7-13 days, so more than that is 14 days old (two weeks).

Hmm. mw+1 gave me false for a 13 day old file, and true for a 15 day old
file. But mw+0 gave me true for all files more than a week old. 

Reading the comment in the ZSH man page (included above), I'd guess it
means that the cache will be rebuilt if it's more than 7 days old.
However, it appears to only be rebuilt if it's more than 14 days old?

Perhaps the comment above (or example above) should be changed to match
up? [I'm of course not advocating any change in ZSH behaviour.]

GI

-- 
Chemicals: Noxious substances from which modern foods are made.



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