Re: "snoozing" with notmuch?

2016-08-04 Thread David Bremner
Matt Armstrong  writes:

> My mail yesterday about muting
> (id:qf5vazjjciq@marmstrong-linux.kir.corp.google.com) was in part
> motivated by this question:
>
> Has anybody implemented something like "snooze" in notmuch?
>

There is some related discussion at

  id:4a05c1d8-6da3-44ba-86e3-259191c4d...@me.com

(alas, all the web archives I tried are broken at the moment)

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


"snoozing" with notmuch?

2016-08-04 Thread Matt Armstrong
My mail yesterday about muting
(id:qf5vazjjciq@marmstrong-linux.kir.corp.google.com) was in part
motivated by this question:

Has anybody implemented something like "snooze" in notmuch?

I think of a "snooze" as a temporary mute.

The intent would be to hide messages from the inbox until some future
time, upon which they are automatically promoted back into the inbox.

A more precise spec:

 - if a new message arrives into a "snoozed" thread it too is snoozed
   and is not tagged 'inbox'.

 - (perhaps optinoally) unless it is "to me", which always
   auto-unsnoozes the threads it is part of.

 - when unsnoozed, or when a snooze expires, messages in the thread are
   tagged with inbox.

The difficulty I have is that notmuch doesn't support tags with
timestamps or numerical values.  It might be possible to snooze based on
fixed intervals.  E.g. one unique "snoozed until" tag per day of the
year.  Using this would require some UI facade.


Prior art that I'm aware of:

a) Google Inbox has snooze.  You choose a time and the thread appears in
   your inbox as "new mail", as if it arrived then.  It appears to be
   implemented as a tag on the thread that suppresses message display by
   the client (e.g. if you view your "Google Inbox" mail in Gmail the
   "snoozed" messages appear there as normal).

b) in a past life I filtered low priority mail into hourly and daily
   temporary mailboxes, and had cron entries set up to re-incorporate
   those as incoming mail on an hourly/daily basis.  This was a great
   way to encourage myself to batch-process less important mail.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


email snoozing in notmuch

2014-12-21 Thread Sebastian Fischmeister
Hi Richard,

Thanks for the nice and simple solution. I prefer this one to a solution
like notmuch-snooze that stores the desnoozing in an external program
and thus complicates backups.

  Sebastian

Richard Lawrence  writes:

> Franz Fellner 
> writes:
>
>> Sebastian Fischmeister wrote:
>  
>>> I'm thinking of how to realize the mail snoozing feature with notmuch,
>>> so that certain emails won't become visible (in the search) until a
>>> certain day/time (e.g., 10 days from now).
>>> 
>>> Using the tag as an absolute date when the mail should become visible
>>> again, tags should be searchable and interpretable as dates. The search
>>> would then be something like: notmuch search tag-as-date < now and
>>> tag:inbox
>>
>> It is not neccessary to make notmuch interpret tags as date - just interpret 
>> them yourself ;)
>> You can easily run your own scripts and modify tags/mails. So a simple 
>> solution might be:
>> * Add "snoozed" to your notmuch exclude_tags (see config file)
>> * To snooze a mail run in your mail client "tag +snoozed +snoozeby-10-days"
>>   or "tag +snoozed +snoozeuntil-2015-01-09"
>> * Your script (e.g. run as cronjob or after notmuch new) now 
>>   - queries for "tag:snoozed"
>>   - looks for snoozeuntil-* tag and parses the tag into a date. If date < 
>> now remove snooze-tags.
>>   - looks for (relative) snoozeby tag and transform it into (absolute) 
>> snoozeuntil tag.
>> (should be not too hard using e.g. the python or ruby bindings)
>
> I actually do something like this.  It's not everything Sebastian was
> looking for, but it's very simple, and works great for me.
>
> I use a combination of a "pending" tag and a "byMMDD" tag.
>
> From cron, I run the following to refile pending mail back to the inbox
> when it comes due:
>
> #!/bin/bash
> DATE_STR=$(date +'%Y%m%d')
> notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR
>
> and in Emacs, I use the following key binding to snooze mail (or in the Mutt
> terminology I borrowed, `postpone' it, hence the key):
>
> (define-key notmuch-search-mode-map "P"
>   (lambda ()
> "postpone message (remove inbox tag, add pending tag and refile date)"
> (interactive)
> (let* ((date-string (format-time-string "%Y%m%d" (org-read-date nil t)))
>  (date-tag (concat "+by" date-string)))
>   (notmuch-search-tag `("-inbox" "+pending" ,date-tag)
>   
> (The `org-read-date' function gives me a nice easy way to pick a date
> from a calendar.  I bind "P" to the same function in
> notmuch-show-mode-map, too.)
>
> Hope that helps!
>
> Best,
> Richard
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: email snoozing in notmuch

2014-12-21 Thread Sebastian Fischmeister
Hi Richard,

Thanks for the nice and simple solution. I prefer this one to a solution
like notmuch-snooze that stores the desnoozing in an external program
and thus complicates backups.

  Sebastian

Richard Lawrence richard.lawre...@berkeley.edu writes:

 Franz Fellner alpine.art...@gmail.com
 writes:

 Sebastian Fischmeister wrote:
  
 I'm thinking of how to realize the mail snoozing feature with notmuch,
 so that certain emails won't become visible (in the search) until a
 certain day/time (e.g., 10 days from now).
 
 Using the tag as an absolute date when the mail should become visible
 again, tags should be searchable and interpretable as dates. The search
 would then be something like: notmuch search tag-as-date  now and
 tag:inbox

 It is not neccessary to make notmuch interpret tags as date - just interpret 
 them yourself ;)
 You can easily run your own scripts and modify tags/mails. So a simple 
 solution might be:
 * Add snoozed to your notmuch exclude_tags (see config file)
 * To snooze a mail run in your mail client tag +snoozed +snoozeby-10-days
   or tag +snoozed +snoozeuntil-2015-01-09
 * Your script (e.g. run as cronjob or after notmuch new) now 
   - queries for tag:snoozed
   - looks for snoozeuntil-* tag and parses the tag into a date. If date  
 now remove snooze-tags.
   - looks for (relative) snoozeby tag and transform it into (absolute) 
 snoozeuntil tag.
 (should be not too hard using e.g. the python or ruby bindings)

 I actually do something like this.  It's not everything Sebastian was
 looking for, but it's very simple, and works great for me.

 I use a combination of a pending tag and a byMMDD tag.

 From cron, I run the following to refile pending mail back to the inbox
 when it comes due:

 #!/bin/bash
 DATE_STR=$(date +'%Y%m%d')
 notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR

 and in Emacs, I use the following key binding to snooze mail (or in the Mutt
 terminology I borrowed, `postpone' it, hence the key):

 (define-key notmuch-search-mode-map P
   (lambda ()
 postpone message (remove inbox tag, add pending tag and refile date)
 (interactive)
 (let* ((date-string (format-time-string %Y%m%d (org-read-date nil t)))
  (date-tag (concat +by date-string)))
   (notmuch-search-tag `(-inbox +pending ,date-tag)
   
 (The `org-read-date' function gives me a nice easy way to pick a date
 from a calendar.  I bind P to the same function in
 notmuch-show-mode-map, too.)

 Hope that helps!

 Best,
 Richard

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


email snoozing in notmuch

2014-12-11 Thread Trevor Jim
I've implemented this in elisp, here: 
https://github.com/tjim/nevermore/blob/master/nm.el#L745

Snooze has come up a repeatedly on this list. Maybe it would make sense to 
build it in to notmuch?

Of course, it can be built on top of notmuch so it's not necessary to bake it 
in. But there are other features in notmuch of which you could say the same, 
e.g., excluded tags.

The benefit of building it in would be a common interface/implementation that 
all UIs could use.
?

-- next part --
An HTML attachment was scrubbed...
URL: 



Re: email snoozing in notmuch

2014-12-11 Thread Trevor Jim

I've implemented this in elisp, here: 
https://github.com/tjim/nevermore/blob/master/nm.el#L745

Snooze has come up a repeatedly on this list. Maybe it would make sense to 
build it in to notmuch?

Of course, it can be built on top of notmuch so it's not necessary to bake it 
in. But there are other features in notmuch of which you could say the same, 
e.g., excluded tags.

The benefit of building it in would be a common interface/implementation that 
all UIs could use.


___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


email snoozing in notmuch

2014-12-10 Thread Franz Fellner
Hi,

Sebastian Fischmeister wrote:
> Hi,
> 
> I'm thinking of how to realize the mail snoozing feature with notmuch,
> so that certain emails won't become visible (in the search) until a
> certain day/time (e.g., 10 days from now).
> 
> Using the tag as an absolute date when the mail should become visible
> again, tags should be searchable and interpretable as dates. The search
> would then be something like: notmuch search tag-as-date < now and
> tag:inbox

It is not neccessary to make notmuch interpret tags as date - just interpret 
them yourself ;)
You can easily run your own scripts and modify tags/mails. So a simple solution 
might be:
* Add "snoozed" to your notmuch exclude_tags (see config file)
* To snooze a mail run in your mail client "tag +snoozed +snoozeby-10-days"
  or "tag +snoozed +snoozeuntil-2015-01-09"
* Your script (e.g. run as cronjob or after notmuch new) now 
  - queries for "tag:snoozed"
  - looks for snoozeuntil-* tag and parses the tag into a date. If date < now 
remove snooze-tags.
  - looks for (relative) snoozeby tag and transform it into (absolute) 
snoozeuntil tag.
(should be not too hard using e.g. the python or ruby bindings)

Of course you can use an own email header to store the snoozeuntil value.
With such a header it should be possible to use afew [1] for automated 
snooze-tag-management
instead of a hand-crafted script.

Regards
Franz

[1] https://github.com/teythoon/afew

> 
> Using the receive date as base and encoding the delay as relative time
> from that, would still need the ability to interpret tag values as
> numbers:
> 
> notmuch search date:01012011..15days and tag-as-number < 10 and tag:inbox
> 
> Any ideas how the snoozing feature can be implemented with what is
> already present in notmuch?
> 
> Thanks,
>   Sebastian
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch




email snoozing in notmuch

2014-12-10 Thread Richard Lawrence
Franz Fellner 
writes:

> Sebastian Fischmeister wrote:

>> I'm thinking of how to realize the mail snoozing feature with notmuch,
>> so that certain emails won't become visible (in the search) until a
>> certain day/time (e.g., 10 days from now).
>> 
>> Using the tag as an absolute date when the mail should become visible
>> again, tags should be searchable and interpretable as dates. The search
>> would then be something like: notmuch search tag-as-date < now and
>> tag:inbox
>
> It is not neccessary to make notmuch interpret tags as date - just interpret 
> them yourself ;)
> You can easily run your own scripts and modify tags/mails. So a simple 
> solution might be:
> * Add "snoozed" to your notmuch exclude_tags (see config file)
> * To snooze a mail run in your mail client "tag +snoozed +snoozeby-10-days"
>   or "tag +snoozed +snoozeuntil-2015-01-09"
> * Your script (e.g. run as cronjob or after notmuch new) now 
>   - queries for "tag:snoozed"
>   - looks for snoozeuntil-* tag and parses the tag into a date. If date < now 
> remove snooze-tags.
>   - looks for (relative) snoozeby tag and transform it into (absolute) 
> snoozeuntil tag.
> (should be not too hard using e.g. the python or ruby bindings)

I actually do something like this.  It's not everything Sebastian was
looking for, but it's very simple, and works great for me.

I use a combination of a "pending" tag and a "byMMDD" tag.

>From cron, I run the following to refile pending mail back to the inbox
when it comes due:

#!/bin/bash
DATE_STR=$(date +'%Y%m%d')
notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR

and in Emacs, I use the following key binding to snooze mail (or in the Mutt
terminology I borrowed, `postpone' it, hence the key):

(define-key notmuch-search-mode-map "P"
  (lambda ()
"postpone message (remove inbox tag, add pending tag and refile date)"
(interactive)
(let* ((date-string (format-time-string "%Y%m%d" (org-read-date nil t)))
   (date-tag (concat "+by" date-string)))
  (notmuch-search-tag `("-inbox" "+pending" ,date-tag)

(The `org-read-date' function gives me a nice easy way to pick a date
from a calendar.  I bind "P" to the same function in
notmuch-show-mode-map, too.)

Hope that helps!

Best,
Richard



RE: email snoozing in notmuch

2014-12-10 Thread Franz Fellner
Hi,

Sebastian Fischmeister wrote:
 Hi,
 
 I'm thinking of how to realize the mail snoozing feature with notmuch,
 so that certain emails won't become visible (in the search) until a
 certain day/time (e.g., 10 days from now).
 
 Using the tag as an absolute date when the mail should become visible
 again, tags should be searchable and interpretable as dates. The search
 would then be something like: notmuch search tag-as-date  now and
 tag:inbox

It is not neccessary to make notmuch interpret tags as date - just interpret 
them yourself ;)
You can easily run your own scripts and modify tags/mails. So a simple solution 
might be:
* Add snoozed to your notmuch exclude_tags (see config file)
* To snooze a mail run in your mail client tag +snoozed +snoozeby-10-days
  or tag +snoozed +snoozeuntil-2015-01-09
* Your script (e.g. run as cronjob or after notmuch new) now 
  - queries for tag:snoozed
  - looks for snoozeuntil-* tag and parses the tag into a date. If date  now 
remove snooze-tags.
  - looks for (relative) snoozeby tag and transform it into (absolute) 
snoozeuntil tag.
(should be not too hard using e.g. the python or ruby bindings)

Of course you can use an own email header to store the snoozeuntil value.
With such a header it should be possible to use afew [1] for automated 
snooze-tag-management
instead of a hand-crafted script.

Regards
Franz

[1] https://github.com/teythoon/afew

 
 Using the receive date as base and encoding the delay as relative time
 from that, would still need the ability to interpret tag values as
 numbers:
 
 notmuch search date:01012011..15days and tag-as-number  10 and tag:inbox
 
 Any ideas how the snoozing feature can be implemented with what is
 already present in notmuch?
 
 Thanks,
   Sebastian
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch


___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: email snoozing in notmuch

2014-12-10 Thread Richard Lawrence
Franz Fellner alpine.art...@gmail.com
writes:

 Sebastian Fischmeister wrote:
 
 I'm thinking of how to realize the mail snoozing feature with notmuch,
 so that certain emails won't become visible (in the search) until a
 certain day/time (e.g., 10 days from now).
 
 Using the tag as an absolute date when the mail should become visible
 again, tags should be searchable and interpretable as dates. The search
 would then be something like: notmuch search tag-as-date  now and
 tag:inbox

 It is not neccessary to make notmuch interpret tags as date - just interpret 
 them yourself ;)
 You can easily run your own scripts and modify tags/mails. So a simple 
 solution might be:
 * Add snoozed to your notmuch exclude_tags (see config file)
 * To snooze a mail run in your mail client tag +snoozed +snoozeby-10-days
   or tag +snoozed +snoozeuntil-2015-01-09
 * Your script (e.g. run as cronjob or after notmuch new) now 
   - queries for tag:snoozed
   - looks for snoozeuntil-* tag and parses the tag into a date. If date  now 
 remove snooze-tags.
   - looks for (relative) snoozeby tag and transform it into (absolute) 
 snoozeuntil tag.
 (should be not too hard using e.g. the python or ruby bindings)

I actually do something like this.  It's not everything Sebastian was
looking for, but it's very simple, and works great for me.

I use a combination of a pending tag and a byMMDD tag.

From cron, I run the following to refile pending mail back to the inbox
when it comes due:

#!/bin/bash
DATE_STR=$(date +'%Y%m%d')
notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR

and in Emacs, I use the following key binding to snooze mail (or in the Mutt
terminology I borrowed, `postpone' it, hence the key):

(define-key notmuch-search-mode-map P
  (lambda ()
postpone message (remove inbox tag, add pending tag and refile date)
(interactive)
(let* ((date-string (format-time-string %Y%m%d (org-read-date nil t)))
   (date-tag (concat +by date-string)))
  (notmuch-search-tag `(-inbox +pending ,date-tag)
  
(The `org-read-date' function gives me a nice easy way to pick a date
from a calendar.  I bind P to the same function in
notmuch-show-mode-map, too.)

Hope that helps!

Best,
Richard

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


email snoozing in notmuch

2014-12-09 Thread Sebastian Fischmeister
Hi,

I'm thinking of how to realize the mail snoozing feature with notmuch,
so that certain emails won't become visible (in the search) until a
certain day/time (e.g., 10 days from now).

Using the tag as an absolute date when the mail should become visible
again, tags should be searchable and interpretable as dates. The search
would then be something like: notmuch search tag-as-date < now and
tag:inbox

Using the receive date as base and encoding the delay as relative time
from that, would still need the ability to interpret tag values as
numbers:

notmuch search date:01012011..15days and tag-as-number < 10 and tag:inbox

Any ideas how the snoozing feature can be implemented with what is
already present in notmuch?

Thanks,
  Sebastian


email snoozing in notmuch

2014-12-09 Thread Sebastian Fischmeister
Hi,

I'm thinking of how to realize the mail snoozing feature with notmuch,
so that certain emails won't become visible (in the search) until a
certain day/time (e.g., 10 days from now).

Using the tag as an absolute date when the mail should become visible
again, tags should be searchable and interpretable as dates. The search
would then be something like: notmuch search tag-as-date  now and
tag:inbox

Using the receive date as base and encoding the delay as relative time
from that, would still need the ability to interpret tag values as
numbers:

notmuch search date:01012011..15days and tag-as-number  10 and tag:inbox

Any ideas how the snoozing feature can be implemented with what is
already present in notmuch?

Thanks,
  Sebastian
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch