1 Return-Path: <jani@nikula.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 33771431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:09:49 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5
\r
12 tests=[HTML_MESSAGE=0.001, 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 KnLglAAz3Pps for <notmuch@notmuchmail.org>;
\r
16 Sat, 28 Jan 2012 01:09:48 -0800 (PST)
\r
17 Received: from mail-pw0-f53.google.com (mail-pw0-f53.google.com
\r
18 [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 371BC431FAE
\r
21 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:09:48 -0800 (PST)
\r
22 Received: by pbbb4 with SMTP id b4so3083846pbb.26
\r
23 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:09:47 -0800 (PST)
\r
25 Received: by 10.68.189.6 with SMTP id ge6mr21709820pbc.93.1327741785529; Sat,
\r
26 28 Jan 2012 01:09:45 -0800 (PST)
\r
27 Received: by 10.68.236.137 with HTTP; Sat, 28 Jan 2012 01:09:45 -0800 (PST)
\r
28 Received: by 10.68.236.137 with HTTP; Sat, 28 Jan 2012 01:09:45 -0800 (PST)
\r
29 In-Reply-To: <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
30 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
31 <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
32 Date: Sat, 28 Jan 2012 11:09:45 +0200
\r
34 <CAB+hUn8feOnr8N_mGXw+wKA6exZG3V-7uW0Yz6+wPN=B+tCNMQ@mail.gmail.com>
\r
35 Subject: Re: [PATCH 8/6] emacs: use message ids instead of thread id in
\r
36 `notmuch-show-operate-all'
\r
37 From: Jani Nikula <jani@nikula.org>
\r
38 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
39 Content-Type: multipart/alternative; boundary=e89a8ff1c3e87ade2104b792f9ce
\r
40 Cc: notmuch@notmuchmail.org
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Sat, 28 Jan 2012 09:09:49 -0000
\r
55 --e89a8ff1c3e87ade2104b792f9ce
\r
56 Content-Type: text/plain; charset=UTF-8
\r
58 I guess this now includes the optimization of doing the tagging in a single
\r
59 call to notmuch tag. (As opposed to calling it once per msg like it used to
\r
60 be a while back.) There was some discussion about the cmdline length for
\r
61 large threads potentially growing too big when I sent such an optimization
\r
62 patch, shall we just ignore that and hope for the best? I guess an idea was
\r
63 to limit to, say, a few hundred msg ids per command. (Again, sorry I can't
\r
64 look up the earlier thread now.)
\r
66 On Jan 28, 2012 8:00 AM, "Dmitry Kurochkin" <dmitry.kurochkin@gmail.com>
\r
69 > Before the change, `notmuch-show-operate-all' used thread id for
\r
70 > "notmuch tag" search. This could result in tagging unexpected
\r
71 > messages that were added to the thread after the notmuch-show buffer
\r
72 > was created. The patch changes `notmuch-show-operate-all' to use ids
\r
73 > of shown messages to fix this.
\r
75 > emacs/notmuch-show.el | 23 ++++++++++++++++++++++-
\r
76 > 1 files changed, 22 insertions(+), 1 deletions(-)
\r
78 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
79 > index 2ca4d92..e606224 100644
\r
80 > --- a/emacs/notmuch-show.el
\r
81 > +++ b/emacs/notmuch-show.el
\r
82 > @@ -1170,6 +1170,15 @@ All currently available key bindings:
\r
83 > (notmuch-show-move-to-message-top)
\r
86 > +(defun notmuch-show-mapc (function)
\r
87 > + "Iterate through all messages with
\r
88 > +`notmuch-show-goto-message-next' and call `function' for side
\r
91 > + (goto-char (point-min))
\r
92 > + (loop do (funcall function)
\r
93 > + while (notmuch-show-goto-message-next))))
\r
95 > ;; Functions relating to the visibility of messages and their
\r
98 > @@ -1222,6 +1231,18 @@ Some useful entries are:
\r
99 > "Return the message id of the current message."
\r
100 > (concat "id:\"" (notmuch-show-get-prop :id) "\""))
\r
102 > +(defun notmuch-show-get-messages-ids ()
\r
103 > + "Return all message ids of currently shown messages."
\r
104 > + (let ((message-ids))
\r
105 > + (notmuch-show-mapc
\r
106 > + (lambda () (push (notmuch-show-get-message-id) message-ids)))
\r
109 > +(defun notmuch-show-get-messages-ids-search ()
\r
110 > + "Return a search string for all message ids of currently shown
\r
112 > + (mapconcat 'identity (notmuch-show-get-messages-ids) " or "))
\r
114 > ;; dme: Would it make sense to use a macro for many of these?
\r
116 > (defun notmuch-show-get-filename ()
\r
117 > @@ -1496,7 +1517,7 @@ i.e. a list of tags to change with '+' and '-'
\r
119 > `Changed-tags' is a list of tag operations for \"notmuch tag\",
\r
120 > i.e. a list of tags to change with '+' and '-' prefixes."
\r
121 > (interactive (notmuch-select-tags-with-completion nil
\r
122 notmuch-show-thread-id))
\r
123 > - (apply 'notmuch-tag notmuch-show-thread-id changed-tags)
\r
124 > + (apply 'notmuch-tag (notmuch-show-get-messages-ids-search)
\r
127 > (goto-char (point-min))
\r
128 > (loop do (let* ((current-tags (notmuch-show-get-tags))
\r
132 > _______________________________________________
\r
133 > notmuch mailing list
\r
134 > notmuch@notmuchmail.org
\r
135 > http://notmuchmail.org/mailman/listinfo/notmuch
\r
137 --e89a8ff1c3e87ade2104b792f9ce
\r
138 Content-Type: text/html; charset=UTF-8
\r
139 Content-Transfer-Encoding: quoted-printable
\r
142 I guess this now includes the optimization of doing the tagging in a single=
\r
143 call to notmuch tag. (As opposed to calling it once per msg like it used t=
\r
144 o be a while back.) There was some discussion about the cmdline length for =
\r
145 large threads potentially growing too big when I sent such an optimization =
\r
146 patch, shall we just ignore that and hope for the best? I guess an idea was=
\r
147 to limit to, say, a few hundred msg ids per command. (Again, sorry I can&#=
\r
148 39;t look up the earlier thread now.)</p>
\r
150 <p>On Jan 28, 2012 8:00 AM, "Dmitry Kurochkin" <<a href=3D"mai=
\r
151 lto:dmitry.kurochkin@gmail.com">dmitry.kurochkin@gmail.com</a>> wrote:<b=
\r
154 > Before the change, `notmuch-show-operate-all' used thread id for<b=
\r
156 > "notmuch tag" search. =C2=A0This could result in tagging une=
\r
158 > messages that were added to the thread after the notmuch-show buffer<b=
\r
160 > was created. =C2=A0The patch changes `notmuch-show-operate-all' to=
\r
162 > of shown messages to fix this.<br>
\r
164 > =C2=A0emacs/notmuch-show.el | =C2=A0 23 ++++++++++++++++++++++-<br>
\r
165 > =C2=A01 files changed, 22 insertions(+), 1 deletions(-)<br>
\r
167 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el<br>
\r
168 > index 2ca4d92..e606224 100644<br>
\r
169 > --- a/emacs/notmuch-show.el<br>
\r
170 > +++ b/emacs/notmuch-show.el<br>
\r
171 > @@ -1170,6 +1170,15 @@ All currently available key bindings:<br>
\r
172 > =C2=A0 =C2=A0 (notmuch-show-move-to-message-top)<br>
\r
173 > =C2=A0 =C2=A0 t))<br>
\r
175 > +(defun notmuch-show-mapc (function)<br>
\r
176 > + =C2=A0"Iterate through all messages with<br>
\r
177 > +`notmuch-show-goto-message-next' and call `function' for side=
\r
179 > +effects."<br>
\r
180 > + =C2=A0(save-excursion<br>
\r
181 > + =C2=A0 =C2=A0(goto-char (point-min))<br>
\r
182 > + =C2=A0 =C2=A0(loop do (funcall function)<br>
\r
183 > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 while (notmuch-show-goto-message-next)))=
\r
186 > =C2=A0;; Functions relating to the visibility of messages and their<br=
\r
188 > =C2=A0;; components.<br>
\r
190 > @@ -1222,6 +1231,18 @@ Some useful entries are:<br>
\r
191 > =C2=A0 "Return the message id of the current message."<br>
\r
192 > =C2=A0 (concat "id:\"" (notmuch-show-get-prop :id) &quo=
\r
193 t;\""))<br>
\r
195 > +(defun notmuch-show-get-messages-ids ()<br>
\r
196 > + =C2=A0"Return all message ids of currently shown messages."=
\r
198 > + =C2=A0(let ((message-ids))<br>
\r
199 > + =C2=A0 =C2=A0(notmuch-show-mapc<br>
\r
200 > + =C2=A0 =C2=A0 (lambda () (push (notmuch-show-get-message-id) message=
\r
202 > + =C2=A0 =C2=A0message-ids))<br>
\r
204 > +(defun notmuch-show-get-messages-ids-search ()<br>
\r
205 > + =C2=A0"Return a search string for all message ids of currently =
\r
207 > +messages."<br>
\r
208 > + =C2=A0(mapconcat 'identity (notmuch-show-get-messages-ids) "=
\r
211 > =C2=A0;; dme: Would it make sense to use a macro for many of these?<br=
\r
214 > =C2=A0(defun notmuch-show-get-filename ()<br>
\r
215 > @@ -1496,7 +1517,7 @@ i.e. a list of tags to change with '+' a=
\r
216 nd '-' prefixes."<br>
\r
217 > =C2=A0`Changed-tags' is a list of tag operations for \"notmuc=
\r
219 > =C2=A0i.e. a list of tags to change with '+' and '-' p=
\r
221 > =C2=A0 (interactive (notmuch-select-tags-with-completion nil notmuch-s=
\r
222 how-thread-id))<br>
\r
223 > - =C2=A0(apply 'notmuch-tag notmuch-show-thread-id changed-tags)<b=
\r
225 > + =C2=A0(apply 'notmuch-tag (notmuch-show-get-messages-ids-search)=
\r
227 > =C2=A0 (save-excursion<br>
\r
228 > =C2=A0 =C2=A0 (goto-char (point-min))<br>
\r
229 > =C2=A0 =C2=A0 (loop do (let* ((current-tags (notmuch-show-get-tags))<b=
\r
234 > _______________________________________________<br>
\r
235 > notmuch mailing list<br>
\r
236 > <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a>=
\r
238 > <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http://not=
\r
239 muchmail.org/mailman/listinfo/notmuch</a><br>
\r
242 --e89a8ff1c3e87ade2104b792f9ce--
\r