Re: [WIP PATCH] emacs: query: completion for from: in searches
[notmuch-archives.git] / 4a / 719a6a665341b3b75ccbe7edc6bf870fb0c0d7
1 Return-Path: <emmanuel.beffara@univ-amu.fr>\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 6E2DD431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 19 May 2012 08:49:20 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 WpgvgbkTOF+F for <notmuch@notmuchmail.org>;\r
16         Sat, 19 May 2012 08:49:19 -0700 (PDT)\r
17 X-Greylist: delayed 557 seconds by postgrey-1.32 at olra;\r
18         Sat, 19 May 2012 08:49:19 PDT\r
19 Received: from smtp.univmed.fr (smtp.univmed.fr [139.124.132.70])\r
20         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id B14B3431FAE\r
23         for <notmuch@notmuchmail.org>; Sat, 19 May 2012 08:49:19 -0700 (PDT)\r
24 Received: from localhost (dra13-2-82-237-244-11.fbx.proxad.net\r
25  [82.237.244.11])       by smtp.univmed.fr (Postfix) with ESMTPSA id 52C7D2003E;\r
26         Sat, 19 May 2012 17:39:59 +0200 (CEST)\r
27 Date: Sat, 19 May 2012 17:40:43 +0200\r
28 From: Emmanuel Beffara <manu@beffara.org>\r
29 To: notmuch@notmuchmail.org\r
30 Subject: tagging moved messages\r
31 Message-ID: <20120519154043.GA7220@chantourne>\r
32 MIME-Version: 1.0\r
33 Content-Type: text/plain; charset=us-ascii\r
34 Content-Disposition: inline\r
35 User-Agent: Mutt/1.5.21 (2010-09-15)\r
36 X-Miltered: at smtp.univmed.fr with ID 4FB7BECF.000 by Joe's j-chkmail (http :\r
37         // j-chkmail dot ensmp dot fr)!\r
38 X-j-chkmail-Enveloppe: 4FB7BECF.000/82.237.244.11/dra13-2-82-237-244-11.fbx.proxad.net/localhost/<emmanuel.beffara@univ-amu.fr>\r
39 X-j-chkmail-Score: MSGID : 4FB7BECF.000 on smtp.univmed.fr : j-chkmail score :\r
40         . : R=. U=. O=## B=0.010 -> S=0.016\r
41 X-j-chkmail-Status: Ham\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Sat, 19 May 2012 15:49:20 -0000\r
55 \r
56 Hello,\r
57 \r
58 What would be the proper way of automatically tagging messages whose\r
59 file has been renamed?\r
60 \r
61 My use case is the following:\r
62 \r
63 In order to have some synchronization of tags between several machines,\r
64 I use folders on the IMAP server. The idea is simply that messages\r
65 tagged "foo" are actually moved to a folder "foo". The same applies to\r
66 the "inbox" tag, and as an exception, messages in a folder named "saved"\r
67 are those with no tags. Of course this excludes having several tags on a\r
68 given message (except for the special tags like "unread" and "signed"),\r
69 but it does fit my needs for now. The post-new hook says this:\r
70 \r
71     #!/bin/sh\r
72     for FOLDER in *\r
73     do\r
74         case $FOLDER in\r
75         INBOX) TAG=inbox ;;\r
76         Drafts) TAG=draft ;;\r
77         Trash) TAG=killed ;;\r
78         saved) continue ;;\r
79         *) TAG=$FOLDER\r
80         esac\r
81         notmuch tag -$TAG -- tag:$TAG not folder:$FOLDER\r
82         notmuch tag +$TAG -- folder:$FOLDER not tag:$TAG\r
83     done\r
84 \r
85 It does work but it is rather slow: 8 seconds, for a collection of 16000\r
86 messages. I can live with that but it does involve browsing the whole\r
87 collection for each tag. Having a tag on all moved messages, like for\r
88 the new ones, would dramatically improve this process.\r
89 \r
90 Besides, the "folder:" prefix is not an exact search, so the above does\r
91 not work well if one folder name is part of another, like if I had a\r
92 folder "bar" and a folder "foo.bar". Is there a way around this?\r
93 \r
94 I have another script called "pre-sync" that moves messages to folders\r
95 according to their tags. This one is called before offlineimap does the\r
96 full actual synchronization (calling notmuch new after that).\r
97 \r
98 I welcome any comments on my usage pattern, as there may well be better\r
99 approaches I didn't think of...\r
100 \r
101 -- \r
102 Emmanuel\r