Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5c / 6c383a02ec86d4ae7456d80c4b3a2702079a2d
1 Return-Path: <cworth@cworth.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 DB56D431FBC\r
6         for <notmuch@notmuchmail.org>; Thu, 25 Feb 2010 17:02:14 -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: -3.284\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-3.284 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1.8, AWL=1.115, BAYES_00=-2.599] autolearn=ham\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 mmRj11WXOaGw; Thu, 25 Feb 2010 17:02:12 -0800 (PST)\r
16 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
17         by olra.theworths.org (Postfix) with ESMTP id AFA2A431FAE;\r
18         Thu, 25 Feb 2010 17:02:12 -0800 (PST)\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
20         id B429925427B; Thu, 25 Feb 2010 17:02:08 -0800 (PST)\r
21 From: Carl Worth <cworth@cworth.org>\r
22 To: James Vasile <james@hackervisions.org>, notmuch@notmuchmail.org\r
23 In-Reply-To: <87hbp5j9dv.fsf@hackervisions.org>\r
24 References: <87hbp5j9dv.fsf@hackervisions.org>\r
25 Date: Thu, 25 Feb 2010 17:02:08 -0800\r
26 Message-ID: <87r5o8stbj.fsf@yoom.home.cworth.org>\r
27 MIME-Version: 1.0\r
28 Content-Type: multipart/signed; boundary="=-=-=";\r
29         micalg=pgp-sha1; protocol="application/pgp-signature"\r
30 Subject: Re: [notmuch] Initial tagging\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Fri, 26 Feb 2010 01:02:15 -0000\r
44 \r
45 --=-=-=\r
46 \r
47 On Thu, 25 Feb 2010 16:25:16 -0500, James Vasile <james@hackervisions.org> wrote:\r
48 > I'm curious as to what people are doing in this regard.\r
49 \r
50 I'm currently using a script that does tagging not entirely unlike\r
51 yours, (though my script isn't clever to retry a call to\r
52 notmuch---believe it or not I'm just calling it manually still, not from\r
53 cron).\r
54 \r
55 > The tagging script uses the inbox tag to identify new mail, tags it\r
56 > according to criteria, then removes the inbox tag from anything it found\r
57 > a match for.  Uncategorized mail keeps the inbox tag so I can inspect it\r
58 > later and make rules for it (or tag it manually).\r
59 \r
60 One distinction is that I have all of my "notmuch tag" commands operate\r
61 globally rather than just on new messages. One of the things that really\r
62 annoyed be about sup was that the support for automatic tagging worked\r
63 as a hook on messages as they were processed. So I couldn't use any of\r
64 the tags for searches prior to the time that I had added a particular\r
65 tag rule. I definitely didn't want to replicate that bug.\r
66 \r
67 I also don't remove the inbox tag from matched mail, since I have a\r
68 "notmuch-folders" configuration that takes advantage of the matched tags\r
69 in concert with the inbox tag.\r
70 \r
71 I've included my current auto-tagging script (notmuch-poll) below, as\r
72 well as the snippet of my .emacs that sets my notmuch-folders variable.\r
73 \r
74 > Also, prepending "tag:inbox and" to search criteria restricts the\r
75 > tagging to a small subset of the db, which makes the tagging script run\r
76 > fairly quickly.  My unexpurgated tagging script has almost 100 rules for\r
77 > tagging, and I expect it to grow over time.\r
78 \r
79 To do my "global" searches quickly, I do a similar subsetting, but it's\r
80 much simpler. If I'm adding the "notmuch" tag I do "and not\r
81 tag:notmuch". We've even had the proposal of making "notmuch tag" do\r
82 that automatically.\r
83 \r
84 Meanwhile, I'm planning on eventually moving entirely away from any tags\r
85 that are driven entirely by searches like this. Instead, I'd like to\r
86 just have good support for "saved searches" where we have some syntax to\r
87 perform string expansion on configured search terms. So where I'm\r
88 currently doing:\r
89 \r
90         notmuch search tag:notmuch\r
91 \r
92 I could instead do:\r
93 \r
94         notmuch search query:notmuch\r
95 \r
96 with a configuration associating "notmuch" to "to:notmuchmail.org" and\r
97 the above would expand to:\r
98 \r
99         notmuch search '(' to:notmuchmail.org ')'\r
100 \r
101 We've been talking about these saved searches for a while, but we\r
102 haven't implemented them yet, (nor decided firmly on the syntax we\r
103 want). I just noticed today that sup recently added a similar\r
104 saved-search feature with the following syntax:\r
105 \r
106         notmuch search {notmuch}\r
107 \r
108 I think I might like something like that with more custom syntax, (since\r
109 the existing "prefix:" syntax has a fairly standard meaning that doesn't\r
110 fit well with this new feature.\r
111 \r
112 With saved-search support in notmuch, I could get rid of my notmuch-poll\r
113 script almost entirely, (I'd still want something to automatically\r
114 remove the -inbox tag from some messages, but that's about it).\r
115 \r
116 -Carl\r
117 \r
118 ##### notmuch-poll #####\r
119 echo "Importing new mail"\r
120 notmuch new\r
121 \r
122 echo "Running global tag additions to tag new mail"\r
123 \r
124 # Tag bug-mail first, (since we use the bugs tag below)\r
125 notmuch tag +bugs from:bugzilla-daemon and not tag:bugs\r
126 \r
127 # Note mail sent specifically to me (excluding bug mail)\r
128 notmuch tag +to-me to:cworth@cworth.org and not tag:to-me and not tag:bugs\r
129 notmuch tag +to-me to:carl@theworths.org and not tag:to-me and not tag:bugs\r
130 notmuch tag +to-me to:carl.d.worth@intel.com and not tag:to-me and not tag:bugs\r
131 \r
132 # And note all mail sent from me\r
133 notmuch tag +sent from:cworth@cworth.org and not tag:sent\r
134 notmuch tag +sent from:carl@theworths.org and not tag:sent\r
135 notmuch tag +sent from:carl.d.worth@intel.com and not tag:sent\r
136 \r
137 # Intel mail deserves some distinction\r
138 notmuch tag +intel to:carl.d.worth@intel.com and not tag:intel\r
139 notmuch tag +intel from:intel.com and not tag:intel\r
140 notmuch tag +intel to:intel-gfx and not tag:intel\r
141 notmuch tag +intel to:linux-gfx and not tag:intel\r
142 \r
143 # Next, various free-software projects tagged by recipient\r
144 notmuch tag +cairo to:cairographics.org and not tag:cairo\r
145 notmuch tag +cairo to:pixman@lists.freedesktop.org and not tag:cairo\r
146 notmuch tag +xorg-board to:foundation.x.org and not tag:xorg-board\r
147 notmuch tag +xorg to:xorg and not tag:xorg\r
148 notmuch tag +xorg to:xcb and not tag:xorg\r
149 notmuch tag +announce to:announce@lists.debian.org and not tag:announce\r
150 notmuch tag +debian to:lists.debian.org and not tag:debian\r
151 notmuch tag +sup to:sup-devel@rubyforge.org and not tag:sup\r
152 notmuch tag +lca to:lists.lca2010.org.nz and not tag:lca\r
153 notmuch tag +notmuch to:notmuchmail.org and not tag:notmuch\r
154 notmuch tag +nickle to:nickle.org and not tag:nickle\r
155 notmuch tag +meego '( to:dev@moblin.org or to:dev@lists.moblin.org or to:meego-dev@meego.com )' and not tag:meego\r
156 \r
157 # Finally, a few subject-based tags\r
158 notmuch tag +intel subject:xf86-video-intel and not tag:intel\r
159 notmuch tag +sup subject:sup-talk and not tag:sup\r
160 notmuch tag +pdx subject:pdx and not tag:pdx\r
161 \r
162 # And some sender-based tags\r
163 notmuch tag +family from:theworths.org and not tag:family'\r
164 \r
165 # Keep most Debian bug traffic out of my inbox\r
166 notmuch tag +debbugs '(' to:bugs.debian.org or from:bugs.debian.org ')' and not tag:debbugs\r
167 notmuch tag -inbox tag:inbox and tag:debbugs and not '(' '"Package: cairo"' or '"Package: notmuch"' ')'\r
168 \r
169 echo "Done."\r
170 \r
171 ##### a snippet of .emacs #####\r
172 (setq notmuch-folders '(("inbox" . "tag:inbox")\r
173                         ("tome" . "tag:inbox and (tag:to-me or tag:family)")\r
174                         ("tome-select" . "tag:inbox and (tag:to-me or tag:family) and not tag:notmuch and not tag:cairo")\r
175                         ("other" . "tag:inbox AND not (tag:to-me or tag:announce or tag:notmuch or tag:intel or tag:bugs or tag:cairo or tag:xorgboard or tag:xorg or tag:debian or tag:sup or tag:lca or tag:meego or tag:nickle or tag:pdx)")\r
176                         ("announce" . "tag:inbox AND tag:announce")\r
177                         ("notmuch" . "tag:inbox AND tag:notmuch")\r
178                         ("intel" . "tag:inbox AND tag:intel")\r
179                         ("bugs" . "tag:inbox AND tag:bugs")\r
180                         ("cairo" . "tag:inbox AND tag:cairo")\r
181                         ("xorgboard" . "tag:inbox AND tag:xorg-board")\r
182                         ("xorg" . "tag:inbox AND tag:xorg")\r
183                         ("debian" . "tag:inbox AND tag:debian")\r
184                         ("sup" . "tag:inbox AND tag:sup")\r
185                         ("lca" . "tag:inbox AND tag:lca")\r
186                         ("meego" . "tag:inbox AND tag:meego")\r
187                         ("nickle" . "tag:inbox AND tag:nickle")\r
188                         ("pdx" . "tag:inbox AND tag:pdx")\r
189                         ("todo" . "tag:todo and not tag:cairo and not tag:notmuch and not tag:intel")\r
190                         ("inteltodo" . "(tag:todo and tag:intel) or tag:todo-intel")\r
191                         ("notmuchtodo" . "(tag:todo and tag:notmuch) or tag:todo-notmuch")\r
192                         ("cairotodo" . "(tag:todo and tag:cairo) or tag:todo-cairo")\r
193                         ))\r
194 \r
195 --=-=-=\r
196 Content-Type: application/pgp-signature\r
197 \r
198 -----BEGIN PGP SIGNATURE-----\r
199 Version: GnuPG v1.4.10 (GNU/Linux)\r
200 \r
201 iD8DBQFLhx2Q6JDdNq8qSWgRAsa3AKCR2jtPtckrF79hQQ0bdLw129w+KACePw4A\r
202 bBuRWhs1I+LVaxwudPw7ysA=\r
203 =wClM\r
204 -----END PGP SIGNATURE-----\r
205 --=-=-=--\r