day-oriented search - how to?

17 views
Skip to first unread message

Andrew Gaydenko

unread,
Mar 1, 2016, 6:47:17 AM3/1/16
to mu-discuss
Hi!

I often use search filter in 'd:20160301..20160301' form,
that is just means some day in past.

It would be very handy:

- to avoid repeating
- optionally to omit year/month defaulting to the current ones
- optionally to omit century (that is '20' year part)

Logically it is very simple:

- 'to' is omitted => 'to' is the last moment of 'from' day
- 2 digits - a day of the current month
- 4 digits - month/day of the current year
- 6 digits - year/month/day of the current century
- 8 digits - full form

How to?
Have I missed some handy way to get the aim?
--

Regards,
Andrew

Eduardo Mercovich

unread,
Mar 1, 2016, 8:21:22 AM3/1/16
to mu-di...@googlegroups.com
Hi Andrew.

> I often use search filter in 'd:20160301..20160301' form,
> that is just means some day in past.
> It would be very handy: [...]
> How to?
> Have I missed some handy way to get the aim?

Just to understand... do you mean making some inteligent parsing of the
usual search, or creating a function to search for a special day?

If it's the 1st, I've no idea how it can be done, but if it's the 2nd it
can be done counting the digits:
+ if 2, that's the day in the current month/year
+ if 1+/1+, that's day in month in current year
+ if 1+/1+/1+ that's day/month/year...


--
eduardo mercovich

Donde se cruzan tus talentos
con las necesidades del mundo,
ahí está tu vocación.

Andrew Gaydenko

unread,
Mar 1, 2016, 9:48:24 AM3/1/16
to mu-di...@googlegroups.com
Eduardo, hi,

As far as current search syntax isn't compatible with that day-oriented
one I have suggested, it is more the second, that is probably some kind
of own command.

I'm rather new with elisp, so, probably somebody already have crafted
own custom search commands, and I'd take it as a base to modify.
--

Regards,
Andrew

Eduardo Mercovich

unread,
Mar 1, 2016, 4:18:44 PM3/1/16
to mu-di...@googlegroups.com
Hi.

> As far as current search syntax isn't compatible with that day-oriented
> one I have suggested, it is more the second, that is probably some kind
> of own command.

Ok.

> I'm rather new with elisp, so, probably somebody already have crafted
> own custom search commands, and I'd take it as a base to modify.

I don't know elisp, sorry.
However, I'd like to understand it's use to make it more usable for
everyone interested. How do you get the precise date?

Becase if you search a message 1st to find the date, one posibility could be an action

"[s]how this date"

similar to the current

"[s]how this thread"...

(further filters could be applied, of course).

Andrew Gaydenko

unread,
Mar 1, 2016, 4:30:40 PM3/1/16
to mu-di...@googlegroups.com

Eduardo Mercovich <eduardo....@gmail.com> writes:
> How do you get the precise date?

I haven't got any task-related code yet.

--

Regards,
Andrew

Eduardo Mercovich

unread,
Mar 2, 2016, 7:43:33 AM3/2/16
to mu-di...@googlegroups.com
Hi Andrew.

>> How do you get the precise date?

> I haven't got any task-related code yet.

Sorry I wasn't clear... I meant how do you do it from a human/task point
of view. Nothing about code. :)

And when I said "action" I meant that it could be implemented in the
same way. So yes, here is something about code, althought I don't know
how it's done, except that it is "get this info from this mail" (the
date in this case) and make a search based on this info.

Best...

Dirk-Jan C. Binnema

unread,
Mar 3, 2016, 2:18:55 PM3/3/16
to mu-di...@googlegroups.com
Most of this is possible already - search for 'date:' in the 'mu-find'
manpage, and there are some example in the mu4e manual as well.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Andrew Gaydenko

unread,
Mar 3, 2016, 2:41:28 PM3/3/16
to mu-di...@googlegroups.com

Dirk-Jan C. Binnema <dj...@djcbsoftware.nl> writes:

> On Tuesday Mar 01 2016, Andrew Gaydenko wrote:
>
>> Hi!
>>
>> I often use search filter in 'd:20160301..20160301' form,
>> that is just means some day in past.
>>
>> It would be very handy:
>>
>> - to avoid repeating
>> - optionally to omit year/month defaulting to the current ones
>> - optionally to omit century (that is '20' year part)
>>
>> Logically it is very simple:
>>
>> - 'to' is omitted => 'to' is the last moment of 'from' day
>> - 2 digits - a day of the current month
>> - 4 digits - month/day of the current year
>> - 6 digits - year/month/day of the current century
>> - 8 digits - full form
>>
>> How to?
>> Have I missed some handy way to get the aim?
>
> Most of this is possible already - search for 'date:' in the 'mu-find'
> manpage, and there are some example in the mu4e manual as well.

Dirk, hi!

Yes, I have dug in 'man mu-find' (and do it from time to time
discovering something new), but still wasn't lucky to understand how to
shorten 'particular day' search, say, 'messages during Dec 31 last
year'. In other words, d:20151231..20151231 is the shortest way I
have found. Have I missed some sugar?

--

Regards,
Andrew

Dirk-Jan C. Binnema

unread,
Mar 4, 2016, 12:47:07 PM3/4/16
to mu-di...@googlegroups.com
Hi Andrew,

On Thursday Mar 03 2016, Andrew Gaydenko wrote:


> Yes, I have dug in 'man mu-find' (and do it from time to time
> discovering something new), but still wasn't lucky to understand how to
> shorten 'particular day' search, say, 'messages during Dec 31 last
> year'. In other words, d:20151231..20151231 is the shortest way I
> have found. Have I missed some sugar?

That's really the shortest way for now; I remember someone wanted to
implement relative dates, but it never came to it.
Reply all
Reply to author
Forward
0 new messages