Re: [WIP PATCH] emacs: query: completion for from: in searches
[notmuch-archives.git] / 7d / 1f208be6ec3f23a3e5f65fdfd1b0f1ce104582
1 Return-Path: <gmn-notmuch@m.gmane.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 0E28E431FDB\r
6         for <notmuch@notmuchmail.org>; Wed, 10 Dec 2014 09:05:15 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id PB6xoC6Ngtkk for <notmuch@notmuchmail.org>;\r
16         Wed, 10 Dec 2014 09:05:11 -0800 (PST)\r
17 Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 46B95431FBF\r
21         for <notmuch@notmuchmail.org>; Wed, 10 Dec 2014 09:05:11 -0800 (PST)\r
22 Received: from list by plane.gmane.org with local (Exim 4.69)\r
23         (envelope-from <gmn-notmuch@m.gmane.org>) id 1XykhC-0007GT-W3\r
24         for notmuch@notmuchmail.org; Wed, 10 Dec 2014 18:05:03 +0100\r
25 Received: from c-67-169-117-151.hsd1.ca.comcast.net ([67.169.117.151])\r
26         by main.gmane.org with esmtp (Gmexim 0.1 (Debian))\r
27         id 1AlnuQ-0007hv-00\r
28         for <notmuch@notmuchmail.org>; Wed, 10 Dec 2014 18:05:02 +0100\r
29 Received: from richard.lawrence by c-67-169-117-151.hsd1.ca.comcast.net with\r
30         local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00\r
31         for <notmuch@notmuchmail.org>; Wed, 10 Dec 2014 18:05:02 +0100\r
32 X-Injected-Via-Gmane: http://gmane.org/\r
33 To: notmuch@notmuchmail.org\r
34 From: Richard Lawrence <richard.lawrence@berkeley.edu>\r
35 Subject: Re: email snoozing in notmuch\r
36 Date: Wed, 10 Dec 2014 09:00:17 -0800\r
37 Lines: 56\r
38 Message-ID: <87bnnbmoda.fsf@berkeley.edu>\r
39 References: <87wq60e2q5.fsf@uwaterloo.ca>\r
40         <548800d5ecc8b_551ca3e88c@TP_L520.notmuch>\r
41 Mime-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Complaints-To: usenet@ger.gmane.org\r
44 X-Gmane-NNTP-Posting-Host: c-67-169-117-151.hsd1.ca.comcast.net\r
45 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)\r
46 Cancel-Lock: sha1:I4hxtJlHs/z6q/FZgOii5c3eVFU=\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Wed, 10 Dec 2014 17:05:15 -0000\r
60 \r
61 Franz Fellner <alpine.art.de@gmail.com>\r
62 writes:\r
63 \r
64 > Sebastian Fischmeister wrote:\r
65  \r
66 >> I'm thinking of how to realize the mail snoozing feature with notmuch,\r
67 >> so that certain emails won't become visible (in the search) until a\r
68 >> certain day/time (e.g., 10 days from now).\r
69 >> \r
70 >> Using the tag as an absolute date when the mail should become visible\r
71 >> again, tags should be searchable and interpretable as dates. The search\r
72 >> would then be something like: notmuch search tag-as-date < now and\r
73 >> tag:inbox\r
74 >\r
75 > It is not neccessary to make notmuch interpret tags as date - just interpret them yourself ;)\r
76 > You can easily run your own scripts and modify tags/mails. So a simple solution might be:\r
77 > * Add "snoozed" to your notmuch exclude_tags (see config file)\r
78 > * To snooze a mail run in your mail client "tag +snoozed +snoozeby-10-days"\r
79 >   or "tag +snoozed +snoozeuntil-2015-01-09"\r
80 > * Your script (e.g. run as cronjob or after notmuch new) now \r
81 >   - queries for "tag:snoozed"\r
82 >   - looks for snoozeuntil-* tag and parses the tag into a date. If date < now remove snooze-tags.\r
83 >   - looks for (relative) snoozeby tag and transform it into (absolute) snoozeuntil tag.\r
84 > (should be not too hard using e.g. the python or ruby bindings)\r
85 \r
86 I actually do something like this.  It's not everything Sebastian was\r
87 looking for, but it's very simple, and works great for me.\r
88 \r
89 I use a combination of a "pending" tag and a "byYYYYMMDD" tag.\r
90 \r
91 >From cron, I run the following to refile pending mail back to the inbox\r
92 when it comes due:\r
93 \r
94 #!/bin/bash\r
95 DATE_STR=$(date +'%Y%m%d')\r
96 notmuch tag +inbox -pending -by$DATE_STR -- tag:by$DATE_STR\r
97 \r
98 and in Emacs, I use the following key binding to snooze mail (or in the Mutt\r
99 terminology I borrowed, `postpone' it, hence the key):\r
100 \r
101 (define-key notmuch-search-mode-map "P"\r
102   (lambda ()\r
103     "postpone message (remove inbox tag, add pending tag and refile date)"\r
104     (interactive)\r
105     (let* ((date-string (format-time-string "%Y%m%d" (org-read-date nil t)))\r
106            (date-tag (concat "+by" date-string)))\r
107       (notmuch-search-tag `("-inbox" "+pending" ,date-tag)))))\r
108       \r
109 (The `org-read-date' function gives me a nice easy way to pick a date\r
110 from a calendar.  I bind "P" to the same function in\r
111 notmuch-show-mode-map, too.)\r
112 \r
113 Hope that helps!\r
114 \r
115 Best,\r
116 Richard\r
117 \r