From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20457 invoked by alias); 10 Dec 2011 18:29:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29982 Received: (qmail 9639 invoked from network); 10 Dec 2011 18:29:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.43 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 86.6.29.42 Date: Sat, 10 Dec 2011 18:29:12 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Documentation error Message-ID: <20111210182912.3403de1b@pws-pc.ntlworld.com> In-Reply-To: <20111210174408.GE8394@andrew.cmu.edu> References: <20111210170956.GD8394@andrew.cmu.edu> <20111210174408.GE8394@andrew.cmu.edu> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 10 Dec 2011 12:44:11 -0500 gi1242+zsh@gmail.com wrote: > >>... > >> # rebuild if cache is more than a week old > >> local -a oldp > >> oldp=( "$1"(Nmw+1) ) > >>... > >> 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.] It does seem to violate the principle of least surprise --- the documentation for globbing qualifiers now has a long spiel about ignoring the fraction part of the difference in times to try to explain. Maybe +7 (days) is better? Of course there's still the same oddity at the level of a day but that's a good deal easier to sweep under the carpet. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/