[PATCH 2/2] test: add test-binary to print the number of ghost messages
[notmuch-archives.git] / 69 / 4e1636d33a265e8d2bbbae83e77879dfd15657
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 D9DC5429E31\r
6         for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 02:41:07 -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 Gie4own1SiLi for <notmuch@notmuchmail.org>;\r
17         Fri, 24 Feb 2012 02:41:07 -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 0C9C4431FAE\r
22         for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 02:41:06 -0800 (PST)\r
23 Received: by bkcit16 with SMTP id it16so2020859bkc.26\r
24         for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 02:41:05 -0800 (PST)\r
25 Received-SPF: pass (google.com: domain of dmitry.kurochkin@gmail.com\r
26         designates 10.204.10.91 as permitted sender)\r
27         client-ip=10.204.10.91; \r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
29         dmitry.kurochkin@gmail.com designates 10.204.10.91 as permitted\r
30         sender) smtp.mail=dmitry.kurochkin@gmail.com;\r
31         dkim=pass header.i=dmitry.kurochkin@gmail.com\r
32 Received: from mr.google.com ([10.204.10.91])\r
33         by 10.204.10.91 with SMTP id o27mr818767bko.17.1330080065749 (num_hops\r
34         = 1); Fri, 24 Feb 2012 02:41:05 -0800 (PST)\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
36         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
37         :message-id:mime-version:content-type;\r
38         bh=BQIiErY7N98r2FbpN1yiO3UsjlHldJkZFxpGYmr3OpU=;\r
39         b=iDGX56JBqKU8GiSZdPd4ihz5QwfwCfjPoFSjW3i9bw4+J3UPxLb1bW5nEHxTVHo2Hu\r
40         lhopfjqIMM5/oz99xGGnS1c5Lg/g1+Cj2JH/mGlBusxtNw+N66RNxe650aKC+WDNR9wL\r
41         BxyGpadfseuvRM2k294jFa9GPMHfct6RlyTGg=\r
42 Received: by 10.204.10.91 with SMTP id o27mr681097bko.17.1330080065681;\r
43         Fri, 24 Feb 2012 02:41:05 -0800 (PST)\r
44 Received: from localhost ([91.144.186.21])\r
45         by mx.google.com with ESMTPS id w15sm7893400bku.0.2012.02.24.02.41.04\r
46         (version=TLSv1/SSLv3 cipher=OTHER);\r
47         Fri, 24 Feb 2012 02:41:04 -0800 (PST)\r
48 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
49 To: Pieter Praet <pieter@praet.org>, David Bremner <david@tethera.net>\r
50 Subject: Re: [PATCH 4/6] emacs: add predicate arg to `notmuch-show-mapc'\r
51 In-Reply-To: <1330038554-10347-4-git-send-email-pieter@praet.org>\r
52 References: <878vjtqhcg.fsf@praet.org>\r
53         <1330038554-10347-4-git-send-email-pieter@praet.org>\r
54 User-Agent: Notmuch/0.11.1+188~ga5674c2 (http://notmuchmail.org) Emacs/23.3.1\r
55         (x86_64-pc-linux-gnu)\r
56 Date: Fri, 24 Feb 2012 14:39:41 +0400\r
57 Message-ID: <87fwe0jz0y.fsf@gmail.com>\r
58 MIME-Version: 1.0\r
59 Content-Type: text/plain; charset=us-ascii\r
60 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Fri, 24 Feb 2012 10:41:08 -0000\r
74 \r
75 On Fri, 24 Feb 2012 00:09:12 +0100, Pieter Praet <pieter@praet.org> wrote:\r
76 > * emacs/notmuch-show.el\r
77\r
78 >   (notmuch-show-mapc):\r
79 >     Only call FUNCTION if new argument PREDICATE is satisfied.\r
80 >     Also correct original docstring: 's/thread/buffer/'.\r
81\r
82 >   (notmuch-show-get-messages-ids):\r
83 >     Update wrt changes to `notmuch-show-mapc'.\r
84\r
85 >   (notmuch-show-tag-all):\r
86 >     Update wrt changes to `notmuch-show-mapc'.\r
87 > ---\r
88 >  emacs/notmuch-show.el |   15 ++++++++-------\r
89 >  1 files changed, 8 insertions(+), 7 deletions(-)\r
90\r
91 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
92 > index aa9ccee..5fc0e43 100644\r
93 > --- a/emacs/notmuch-show.el\r
94 > +++ b/emacs/notmuch-show.el\r
95 > @@ -1272,13 +1272,14 @@ (defun notmuch-show-goto-message-previous ()\r
96 >      (notmuch-show-move-to-message-top)\r
97 >      t))\r
98 >  \r
99 > -(defun notmuch-show-mapc (function)\r
100 > -  "Iterate through all messages in the current thread with\r
101 > -`notmuch-show-goto-message-next' and call FUNCTION for side\r
102 > -effects."\r
103 > +(defun notmuch-show-mapc (predicate function)\r
104 \r
105 Please make PREDICATE optional to avoid giving t when it is not needed.\r
106 \r
107 I would expect PREDICATE to be a function, but perhaps the way you\r
108 implemented it is common in Emacs.\r
109 \r
110 Regards,\r
111   Dmitry\r
112 \r
113 > +  "Iterate through all messages in the current buffer with\r
114 > +`notmuch-show-goto-message-next'.  If PREDICATE is satisfied,\r
115 > +call FUNCTION for side effects."\r
116 >    (save-excursion\r
117 >      (goto-char (point-min))\r
118 > -    (loop do (funcall function)\r
119 > +    (loop do (if (eval predicate)\r
120 > +              (funcall function))\r
121 >         while (notmuch-show-goto-message-next))))\r
122 >  \r
123 >  ;; Functions relating to the visibility of messages and their\r
124 > @@ -1336,7 +1337,7 @@ (defun notmuch-show-get-message-id ()\r
125 >  (defun notmuch-show-get-messages-ids ()\r
126 >    "Return all message ids of messages in the current thread."\r
127 >    (let ((message-ids))\r
128 > -    (notmuch-show-mapc\r
129 > +    (notmuch-show-mapc t\r
130 >       (lambda () (push (notmuch-show-get-message-id) message-ids)))\r
131 >      message-ids))\r
132 >  \r
133 > @@ -1633,7 +1634,7 @@ (defun notmuch-show-tag-all (&rest tag-changes)\r
134 >  TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
135 >    (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))\r
136 >    (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
137 > -  (notmuch-show-mapc\r
138 > +  (notmuch-show-mapc t\r
139 >     (lambda ()\r
140 >       (let* ((current-tags (notmuch-show-get-tags))\r
141 >           (new-tags (notmuch-update-tags current-tags tag-changes)))\r
142 > -- \r
143 > 1.7.8.1\r
144\r