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 475A8431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 22:31:42 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 E76VSXFl6Bnk for <notmuch@notmuchmail.org>;
\r
17 Sat, 5 Apr 2014 22:31:36 -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 27677431FAF
\r
22 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 22:31:36 -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 1WWfg3-0003UT-Jz; Sun, 06 Apr 2014 06:31:31 +0100
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1WWfg3-0003R7-5q; Sun, 06 Apr 2014 06:31:31 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: Re: [PATCH 4/5] emacs: hello: switch notmuch-hello-insert-buttons to
\r
35 In-Reply-To: <20140406012425.GF15472@mit.edu>
\r
36 References: <1396733065-32602-1-git-send-email-markwalters1009@gmail.com>
\r
37 <1396733065-32602-5-git-send-email-markwalters1009@gmail.com>
\r
38 <20140406012425.GF15472@mit.edu>
\r
39 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1
\r
40 (x86_64-pc-linux-gnu)
\r
41 Date: Sun, 06 Apr 2014 06:31:29 +0100
\r
42 Message-ID: <87vbunuiq6.fsf@qmul.ac.uk>
\r
44 Content-Type: text/plain; charset=us-ascii
\r
45 X-Sender-Host-Address: 93.97.24.31
\r
46 X-QM-Geographic: According to ripencc,
\r
47 this message was delivered by a machine in Britain (UK) (GB).
\r
48 X-QM-SPAM-Info: Sender has good ham record. :)
\r
49 X-QM-Body-MD5: c74662a89db8d8693277a51c71d49895 (of first 20000 bytes)
\r
50 X-SpamAssassin-Score: 0.0
\r
51 X-SpamAssassin-SpamBar: /
\r
52 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
54 spam. We require at least 5.0 points to mark a message as spam.
\r
55 This message scored 0.0 points. Summary of the scoring:
\r
56 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
57 provider * (markwalters1009[at]gmail.com)
\r
58 * 0.0 AWL AWL: From: address is in the auto white-list
\r
59 X-QM-Scan-Virus: ClamAV says the message is clean
\r
60 Cc: notmuch@notmuchmail.org
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\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: Sun, 06 Apr 2014 05:31:42 -0000
\r
78 >> @@ -455,23 +457,26 @@ (defun notmuch-hello-query-counts (query-list &rest options)
\r
82 >> - (let ((name (notmuch-saved-search-get elem :name))
\r
83 >> - (search-query (notmuch-saved-search-get elem :query))
\r
84 >> - (message-count (prog1 (read (current-buffer))
\r
85 >> + (let* ((elem-plist (notmuch-hello-saved-search-to-plist elem))
\r
86 >> + (search-query (plist-get elem-plist :query))
\r
87 >> + (filtered-query (notmuch-hello-filtered-query
\r
88 >> + search-query (plist-get options :filter)))
\r
89 >> + (message-count (prog1 (read (current-buffer))
\r
90 >> (forward-line 1))))
\r
91 >> (and (or (plist-get options :show-empty-searches) (> message-count 0))
\r
92 >> - (list name (notmuch-hello-filtered-query
\r
93 >> - search-query (plist-get options :filter))
\r
94 >> - message-count))))
\r
95 >> + (setq elem-plist (plist-put elem-plist :query filtered-query))
\r
97 > This technically works, but `setq' is a strange thing to see in an
\r
98 > `and'. But the problem isn't the `setq'; it's that crazy `and'. I'd
\r
99 > replace the `and' with `when', keep the `setq' and `plist-put' in the
\r
100 > body, and squint a lot less at this code.
\r
102 This was actually a bug on my part: the filtered query can be nil (which
\r
103 is used to mean hide this search); in earlier versions having a setq
\r
104 inside the `and' achieved this but obviously not in this plist form. I
\r
105 have switched to the when as suggested and added a test for
\r
106 filtered-query being nil.
\r