database error
[notmuch-archives.git] / 3e / 99c9895f5ef6165584c7858b1555af3cf8e495
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 5D1A0403E4E\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:39:31 -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: -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 6CKnPaw9dCg2 for <notmuch@notmuchmail.org>;\r
17         Mon,  9 Apr 2012 11:39:30 -0700 (PDT)\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 64752429E44\r
22         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:39:30 -0700 (PDT)\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 1SHJUs-0007KL-84; Mon, 09 Apr 2012 19:39:28 +0100\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 1SHJUr-00049j-Rx; Mon, 09 Apr 2012 19:39:26 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
34         Notmuch Mail <notmuch@notmuchmail.org>\r
35 Subject: Re: [PATCH 5/8] emacs: modify search tag functions to use new\r
36         notmuch-tag interface\r
37 In-Reply-To: <1333845338-22960-6-git-send-email-jrollins@finestructure.net>\r
38 References: <1333354853-25729-1-git-send-email-jrollins@finestructure.net>\r
39         <1333845338-22960-1-git-send-email-jrollins@finestructure.net>\r
40         <1333845338-22960-2-git-send-email-jrollins@finestructure.net>\r
41         <1333845338-22960-3-git-send-email-jrollins@finestructure.net>\r
42         <1333845338-22960-4-git-send-email-jrollins@finestructure.net>\r
43         <1333845338-22960-5-git-send-email-jrollins@finestructure.net>\r
44         <1333845338-22960-6-git-send-email-jrollins@finestructure.net>\r
45 User-Agent: Notmuch/0.12+111~g5c30f66 (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Mon, 09 Apr 2012 19:39:43 +0100\r
48 Message-ID: <871unwn40g.fsf@qmul.ac.uk>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 X-Sender-Host-Address: 94.192.233.223\r
52 X-QM-SPAM-Info: Sender has good ham record.  :)\r
53 X-QM-Body-MD5: 34e9d1bb4f60377bf589deafabb2a391 (of first 20000 bytes)\r
54 X-SpamAssassin-Score: -1.8\r
55 X-SpamAssassin-SpamBar: -\r
56 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
57         determine if it is\r
58         spam. We require at least 5.0 points to mark a message as spam.\r
59         This message scored -1.8 points.\r
60         Summary of the scoring: \r
61         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
62         *      medium trust\r
63         *      [138.37.6.40 listed in list.dnswl.org]\r
64         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
65         provider *      (markwalters1009[at]gmail.com)\r
66         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
67         *      domain\r
68         *  0.5 AWL AWL: From: address is in the auto white-list\r
69 X-QM-Scan-Virus: ClamAV says the message is clean\r
70 X-BeenThere: notmuch@notmuchmail.org\r
71 X-Mailman-Version: 2.1.13\r
72 Precedence: list\r
73 List-Id: "Use and development of the notmuch mail system."\r
74         <notmuch.notmuchmail.org>\r
75 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
77 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
78 List-Post: <mailto:notmuch@notmuchmail.org>\r
79 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
80 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
81         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
82 X-List-Received-Date: Mon, 09 Apr 2012 18:39:31 -0000\r
83 \r
84 On Sun, 08 Apr 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
85 > The main change here is to modify argument parsing so as to not force\r
86 > tag-changes to be a list, and to let notmuch-tag handle prompting the\r
87 > user when required.  doc strings are also updated and cleaned up.\r
88 > ---\r
89 >  emacs/notmuch.el |   36 +++++++++++++-----------------------\r
90 >  1 files changed, 13 insertions(+), 23 deletions(-)\r
91 >\r
92 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
93 > index 9aec96d..a03a526 100644\r
94 > --- a/emacs/notmuch.el\r
95 > +++ b/emacs/notmuch.el\r
96 > @@ -523,13 +523,10 @@ and will also appear in a buffer named \"*Notmuch errors*\"."\r
97 >  See `notmuch-search-tag-region' for details."\r
98 >    (apply 'notmuch-search-tag-region (point) (point) tag-changes))\r
99 >  \r
100 > -(defun notmuch-search-tag-region (beg end &rest tag-changes)\r
101 > -  "Change tags for threads in the given region.\r
102 > -\r
103 > -TAGS is a list of tag operations for `notmuch-tag'.  The tags are\r
104 > -added or removed for all threads in the region from BEG to END."\r
105 > +(defun notmuch-search-tag-region (beg end &optional tag-changes)\r
106 > +  "Change tags for threads in the given region."\r
107 >    (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))\r
108 > -    (apply 'notmuch-tag search-string tag-changes)\r
109 > +    (setq tag-changes (funcall 'notmuch-tag search-string tag-changes))\r
110 >      (save-excursion\r
111 >        (let ((last-line (line-number-at-pos end))\r
112 >           (max-line (- (line-number-at-pos (point-max)) 2)))\r
113 > @@ -539,14 +536,14 @@ added or removed for all threads in the region from BEG to END."\r
114 >          (notmuch-update-tags (notmuch-search-get-tags) tag-changes))\r
115 >         (forward-line))))))\r
116 >  \r
117 > -(defun notmuch-search-tag (&optional initial-input)\r
118 > -  "Change tags for the currently selected thread or region."\r
119 > +(defun notmuch-search-tag (&optional tag-changes)\r
120 > +  "Change tags for the currently selected thread or region.\r
121 > +\r
122 > +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
123 >    (interactive)\r
124 >    (let* ((beg (if (region-active-p) (region-beginning) (point)))\r
125 > -      (end (if (region-active-p) (region-end) (point)))\r
126 > -      (search-string (notmuch-search-find-thread-id-region-search beg end))\r
127 > -      (tags (notmuch-read-tag-changes initial-input search-string)))\r
128 > -    (apply 'notmuch-search-tag-region beg end tags)))\r
129 > +      (end (if (region-active-p) (region-end) (point))))\r
130 > +    (funcall 'notmuch-search-tag-region beg end tag-changes)))\r
131 >  \r
132 >  (defun notmuch-search-add-tag ()\r
133 >    "Same as `notmuch-search-tag' but sets initial input to '+'."\r
134 > @@ -790,18 +787,11 @@ non-authors is found, assume that all of the authors match."\r
135 >             (goto-char found-target)))\r
136 >        (delete-process proc))))\r
137 >  \r
138 > -(defun notmuch-search-tag-all (&rest tag-changes)\r
139 > -  "Add/remove tags from all matching messages.\r
140 > +(defun notmuch-search-tag-all (&optional tag-changes)\r
141 > +  "Add/remove tags from all messages in current search buffer.\r
142 >  \r
143 > -This command adds or removes tags from all messages matching the\r
144 > -current search terms. When called interactively, this command\r
145 > -will prompt for tags to be added or removed. Tags prefixed with\r
146 > -'+' will be added and tags prefixed with '-' will be removed.\r
147 > -\r
148 > -Each character of the tag name may consist of alphanumeric\r
149 > -characters as well as `_.+-'.\r
150 > -"\r
151 > -  (interactive (notmuch-read-tag-changes))\r
152 > +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
153 > +  (interactive)\r
154 >    (apply 'notmuch-tag notmuch-search-query-string tag-changes))\r
155 \r
156 My only comment here is that I wonder about the tag-all command. I can\r
157 see that this is a performance win over applying tag region to the whole\r
158 buffer but is it another place where we have a race with incoming mail\r
159 (ie we tag everything that now matches rather than everything in the\r
160 buffer).\r
161 \r
162 A second advantage with the tag-region form is that it automatically\r
163 does excludes. Currently notmuch-tag does not do excludes as it looked\r
164 very hairy to implement correctly: thus the tag-all command could spend\r
165 a lot of time tagging excluded messages.\r
166 \r
167 OTOH this seems to be a "feature" of the existing code so a "fix" is not\r
168 required for this series.\r
169 \r
170 (Note I would not consider this a full review as my lisp is not good\r
171 enough; eg I am unsure  why the change from apply to funcall was\r
172 needed).\r
173 \r
174 Best wishes\r
175 \r
176 Mark\r
177 \r
178 >  \r
179 >  (defun notmuch-search-buffer-title (query)\r
180 > -- \r
181 > 1.7.9.1\r
182 >\r
183 > _______________________________________________\r
184 > notmuch mailing list\r
185 > notmuch@notmuchmail.org\r
186 > http://notmuchmail.org/mailman/listinfo/notmuch\r