Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / ac / 8781cbd5628b290d2ec553b677285ba3542584
1 Return-Path: <m.walters@qmul.ac.uk>\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 50965431FD0\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jan 2012 03:31:35 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id SwJdhzxot2+o for <notmuch@notmuchmail.org>;\r
17         Mon,  9 Jan 2012 03:31:34 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id A00D7431FB6\r
22         for <notmuch@notmuchmail.org>; Mon,  9 Jan 2012 03:31:34 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1RkDRi-0002Ag-6K; Mon, 09 Jan 2012 11:31:31 +0000\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1RkDRh-0005rz-S8; Mon, 09 Jan 2012 11:31:22 +0000\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Austin Clements <amdragon@MIT.EDU>, Aaron Ecay <aaronecay@gmail.com>\r
34 Subject: Re: [PATCH] emacs: call "notmuch tag" only once when archiving a\r
35         thread\r
36 In-Reply-To: <20120109011259.GD20796@mit.edu>\r
37 References: <1325615346-8302-1-git-send-email-jani@nikula.org>\r
38         <m2hb09kj0m.fsf@gmail.com> <87fwftao1b.fsf@nikula.org>\r
39         <m262glk82m.fsf@gmail.com> <20120109011259.GD20796@mit.edu>\r
40 User-Agent: Notmuch/0.10.2+172~g60f099b (http://notmuchmail.org) Emacs/23.3.1\r
41         (i486-pc-linux-gnu)\r
42 Date: Mon, 09 Jan 2012 11:31:21 +0000\r
43 Message-ID: <87wr91f6ye.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 X-Sender-Host-Address: 94.192.233.223\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: 380c5fc64b1cdd4bf720bece40193094 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -1.7\r
50 X-SpamAssassin-SpamBar: -\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -1.7 points.\r
55         Summary of the scoring: \r
56         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
57         *      medium trust\r
58         *      [138.37.6.40 listed in list.dnswl.org]\r
59         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
60         provider *      (markwalters1009[at]gmail.com)\r
61         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
62         *      domain\r
63         *  0.6 AWL AWL: From: address is in the auto white-list\r
64 X-QM-Scan-Virus: ClamAV says the message is clean\r
65 Cc: notmuch@notmuchmail.org\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.13\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70         <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
77         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Mon, 09 Jan 2012 11:31:35 -0000\r
79 \r
80 \r
81 > There's been quite a bit of discussion on fixing this properly.  See,\r
82 > for example\r
83 > id:"CAH-f9WsPj=1Eu=g3sOePJgCTBFs6HrLdLq18xMEnJ8aZ00yCEg@mail.gmail.com".\r
84 > The gist is that we need to include message IDs (or document IDs) in\r
85 > the search output and use these in tagging operations, rather than the\r
86 > unstable thread:XXX queries.  Unfortunately, actually fixing this got\r
87 > stalled since adding this information the text format is a fool's\r
88 > errand (having been the fool, I can say this!), so we need to switch\r
89 > Emacs over to using the JSON search format first.  However, once\r
90 > that's done, it's a relatively simple change.\r
91 \r
92 I will just mention a different possible solution to this problem. I\r
93 think it is probably more hassle than its worth but just in case someone\r
94 sees how to do it nicely. \r
95 \r
96 The idea is to try and put the race-free solution into the command-line\r
97 notmuch rather than the emacs part.\r
98 \r
99 I will just consider one race to start with: the race in notmuch\r
100 search/notmuch tag. notmuch search gives us just the thread-ids and what\r
101 is in that thread can change. So we could ask for a "cookie" (some short\r
102 unique identifier) and notmuch itself would store the state of its\r
103 output (i.e., the thread-ids together with the message-ids and the\r
104 matched message-ids).\r
105 \r
106 Then notmuch tag could be called with this cookie to say "apply this tag\r
107 to the threads as they were at cookie.\r
108 \r
109 example use\r
110 notmuch search --cookie <query>\r
111 prints a cookie followed by the output of the search\r
112 \r
113 notmuch tag --cookie=cookievalue +sometag matched-thread:id .. \\r
114                                  all-thread:id .. <other search terms>\r
115 \r
116 and notmuch would replace the matched-thread:id by the (matching)\r
117 message-ids in thread it stored at time cookievalue and all-thread by\r
118 all the messages at time cookievalue.\r
119 \r
120 The nice feature is that this makes it easy for all clients to be race\r
121 free (not just emacs). The backend has the information to hand: there is\r
122 no encoding and decoding (via text or JSON) so storing message-ids etc\r
123 is simpler.  It also means that if notmuch wants to use document-ids\r
124 internally it can: it does not become a public interface.\r
125 \r
126 The downside is trying to do the argument parsing in c and we have do\r
127 some reference counting or something to delete the cookies state at some\r
128 point.\r
129 \r
130 Anyway it's just a thought.\r
131 \r
132 Best wishes\r
133 \r
134 Mark\r
135 \r
136 \r