[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Picking Recent Emails.

From: Ralph Corderoy
Subject: Re: [Nmh-workers] Picking Recent Emails.
Date: Thu, 09 Apr 2015 12:58:31 +0100

Hi Ken,

> David wrote:
> > Yes.  Supporting "appear later on the command line" would be
> > non-trivial, as in messy but not difficult, with the MH command line
> > parser.  Do we really need that?  It seems a bit wierd to me to mix
> > the 24-hour and calendar dates.
> I say "no".  I think a -daystart (or whatever we want to call it)
> option should apply to all dates on the command line that lack a
> specific time.

Agreed.  I wasn't suggesting find's -daystart be copied at all, really.
Just that the problem occurs elsewhere, and find tackled it with that.

What date limiting is required?  My guess, based on wanting to limit the
sphere of a search, is

    Today's emails.
    Yesterday's and today's.
    This week's.
    Last week's.
    This month's.
    This year's.
    From 1980-01-01 to 1981-01-01, inclusive and exclusive, [f, t).

That last one being [f, t) makes it easy to walk in chunks by having
this t being next's f, and [1980-02-01, 1980-03-01) doesn't care how
many days February has.

The `today', `yesterday', etc., accepted by -after and -before have the
time of day as `now' AIUI.  So today's emails can't be picked with
`-after yesterday' or `-not -before today'.  A date has to be given, the
hh:mm:ss of 00:00:00, and vital timezone information.

Here's some playing around with how the above selections could work.
All examples are just interested in dates.  Time and zone could be given
as well, but where omitted default to 00:00:00 and the locale's zone.
Each list ordered with most preferable last.

    Today's emails.
        -since today

        -since yesterday -and -upto today

    Yesterday's and today's.
        -since yesterday

    This week's.
        -since 2015-04-06
        -since -04-06
        -since --06
        -since monday

    Last week's.
        -since 2015-03-30 -and -upto monday
        -between -10 -3
        -between -03-30 monday

    This month's.
        -since 2015-04-01
        -since 2015-04-
        -since --01

    This year's.
        -since 2015-01-01
        -since -01-01
        -since 2015--

    From 1980-01-01 to 1981-01-01, inclusive and exclusive, [f, t).
        -since 1980-01-01 -and -upto 1981-01-01
        -between 1980-01-01 1981-01-01
        -between 1980-- 1981--

I find yyyy-mm-dd format handy, and have several commands that allow
yyyy, or yyyy and mm, to be omitted, defaulting to today's.  or dd, or
mm and dd, defaulting to 01.  A negative number is distinct because of
the number of minus signs, e.g. `-since -3' for the last four days,
using -after's syntax.

Cheers, Ralph.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]