Re: [PATCH] emacs: address completion, allow sender/recipient and filters
[notmuch-archives.git] / c0 / 65f85da402cd3d5c99a26bfc8945f23ccddf67
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 8267B431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:43:18 -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: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 vwFmXCO6dTEn for <notmuch@notmuchmail.org>;\r
17         Sat, 28 Jan 2012 01:43:17 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 904ED431FAE\r
22         for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:43:17 -0800 (PST)\r
23 Received: by bkbzt19 with SMTP id zt19so2381110bkb.26\r
24         for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 01:43:16 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type;\r
28         bh=2SqD3BYL5NfNsmtZlZQ8IP2Xj0+bejWHVQjYxiyA14U=;\r
29         b=tuRsgcfiB09xWUnUVfJj+pUfouJ5bd92clW5uSa2QSPOp4EJEfo/arrevW3otECi7u\r
30         3M4TO0sxnTlN19axUtvv+OiVRV9tznN44mCn+I+WNz4leLC/yw2bmadCUnGc7uCyN9zr\r
31         rbGdHh5xvl7QQQp+DQ/6gaCmrdAlgWYn2PlP4=\r
32 Received: by 10.205.124.15 with SMTP id gm15mr4892112bkc.63.1327743796148;\r
33         Sat, 28 Jan 2012 01:43:16 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id ek9sm22158588bkb.10.2012.01.28.01.43.14\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sat, 28 Jan 2012 01:43:15 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: Jani Nikula <jani@nikula.org>\r
40 Subject: Re: [PATCH 8/6] emacs: use message ids instead of thread id in\r
41         `notmuch-show-operate-all'\r
42 In-Reply-To:\r
43  <CAB+hUn8feOnr8N_mGXw+wKA6exZG3V-7uW0Yz6+wPN=B+tCNMQ@mail.gmail.com>\r
44 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45         <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46         <CAB+hUn8feOnr8N_mGXw+wKA6exZG3V-7uW0Yz6+wPN=B+tCNMQ@mail.gmail.com>\r
47 User-Agent: Notmuch/0.11+134~g7ddba9d (http://notmuchmail.org) Emacs/23.3.1\r
48         (x86_64-pc-linux-gnu)\r
49 Date: Sat, 28 Jan 2012 13:42:06 +0400\r
50 Message-ID: <87wr8c88pd.fsf@gmail.com>\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=us-ascii\r
53 Cc: notmuch@notmuchmail.org\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Sat, 28 Jan 2012 09:43:18 -0000\r
67 \r
68 Hi Jani.\r
69 \r
70 On Sat, 28 Jan 2012 11:09:45 +0200, Jani Nikula <jani@nikula.org> wrote:\r
71 > I guess this now includes the optimization of doing the tagging in a single\r
72 > call to notmuch tag. (As opposed to calling it once per msg like it used to\r
73 > be a while back.)\r
74 \r
75 This patch changes the code which was added few patches earlier in the\r
76 series.  And rational for it is not an optimization but a bug fix as\r
77 described in the preamble.\r
78 \r
79 > There was some discussion about the cmdline length for\r
80 > large threads potentially growing too big when I sent such an optimization\r
81 > patch, shall we just ignore that and hope for the best?\r
82 \r
83 Sorry, I think I did not read that discussion in details.  I have never\r
84 hit this issue.  So, for now, I do not care about it.\r
85 \r
86 Notmuch-search range tagging works in a similar way, constructing search\r
87 string of OR'ed thread ids.  So the patch is consistent with the\r
88 existing code.\r
89 \r
90 > I guess an idea was\r
91 > to limit to, say, a few hundred msg ids per command. (Again, sorry I can't\r
92 > look up the earlier thread now.)\r
93\r
94 \r
95 That may be a solution.  Though, I think it should rely on system's\r
96 command line limit instead of magic constants.\r
97 \r
98 Anyway, this problem is out of scope of this patch series.  Currently,\r
99 neither notmuch-search region tagging code nor the proposed patch try to\r
100 solve the issue.  If and when a proper solution is found, we should\r
101 implement it for both (or probably more) cases (provided this patch gets\r
102 accepted).\r
103 \r
104 Regards,\r
105   Dmitry\r
106 \r
107 > On Jan 28, 2012 8:00 AM, "Dmitry Kurochkin" <dmitry.kurochkin@gmail.com>\r
108 > wrote:\r
109 > >\r
110 > > Before the change, `notmuch-show-operate-all' used thread id for\r
111 > > "notmuch tag" search.  This could result in tagging unexpected\r
112 > > messages that were added to the thread after the notmuch-show buffer\r
113 > > was created.  The patch changes `notmuch-show-operate-all' to use ids\r
114 > > of shown messages to fix this.\r
115 > > ---\r
116 > >  emacs/notmuch-show.el |   23 ++++++++++++++++++++++-\r
117 > >  1 files changed, 22 insertions(+), 1 deletions(-)\r
118 > >\r
119 > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
120 > > index 2ca4d92..e606224 100644\r
121 > > --- a/emacs/notmuch-show.el\r
122 > > +++ b/emacs/notmuch-show.el\r
123 > > @@ -1170,6 +1170,15 @@ All currently available key bindings:\r
124 > >     (notmuch-show-move-to-message-top)\r
125 > >     t))\r
126 > >\r
127 > > +(defun notmuch-show-mapc (function)\r
128 > > +  "Iterate through all messages with\r
129 > > +`notmuch-show-goto-message-next' and call `function' for side\r
130 > > +effects."\r
131 > > +  (save-excursion\r
132 > > +    (goto-char (point-min))\r
133 > > +    (loop do (funcall function)\r
134 > > +         while (notmuch-show-goto-message-next))))\r
135 > > +\r
136 > >  ;; Functions relating to the visibility of messages and their\r
137 > >  ;; components.\r
138 > >\r
139 > > @@ -1222,6 +1231,18 @@ Some useful entries are:\r
140 > >   "Return the message id of the current message."\r
141 > >   (concat "id:\"" (notmuch-show-get-prop :id) "\""))\r
142 > >\r
143 > > +(defun notmuch-show-get-messages-ids ()\r
144 > > +  "Return all message ids of currently shown messages."\r
145 > > +  (let ((message-ids))\r
146 > > +    (notmuch-show-mapc\r
147 > > +     (lambda () (push (notmuch-show-get-message-id) message-ids)))\r
148 > > +    message-ids))\r
149 > > +\r
150 > > +(defun notmuch-show-get-messages-ids-search ()\r
151 > > +  "Return a search string for all message ids of currently shown\r
152 > > +messages."\r
153 > > +  (mapconcat 'identity (notmuch-show-get-messages-ids) " or "))\r
154 > > +\r
155 > >  ;; dme: Would it make sense to use a macro for many of these?\r
156 > >\r
157 > >  (defun notmuch-show-get-filename ()\r
158 > > @@ -1496,7 +1517,7 @@ i.e. a list of tags to change with '+' and '-'\r
159 > prefixes."\r
160 > >  `Changed-tags' is a list of tag operations for \"notmuch tag\",\r
161 > >  i.e. a list of tags to change with '+' and '-' prefixes."\r
162 > >   (interactive (notmuch-select-tags-with-completion nil\r
163 > notmuch-show-thread-id))\r
164 > > -  (apply 'notmuch-tag notmuch-show-thread-id changed-tags)\r
165 > > +  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search)\r
166 > changed-tags)\r
167 > >   (save-excursion\r
168 > >     (goto-char (point-min))\r
169 > >     (loop do (let* ((current-tags (notmuch-show-get-tags))\r
170 > > --\r
171 > > 1.7.8.3\r
172 > >\r
173 > > _______________________________________________\r
174 > > notmuch mailing list\r
175 > > notmuch@notmuchmail.org\r
176 > > http://notmuchmail.org/mailman/listinfo/notmuch\r
177 Non-text part: text/html\r