1 Return-Path: <markwalters1009@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 045A2431FC0
\r
6 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:35:03 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id 8Ba8lDYgDcmq for <notmuch@notmuchmail.org>;
\r
18 Sun, 11 May 2014 01:34:57 -0700 (PDT)
\r
19 Received: from mail-we0-f176.google.com (mail-we0-f176.google.com
\r
20 [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 06B83431FC3
\r
23 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:34:53 -0700 (PDT)
\r
24 Received: by mail-we0-f176.google.com with SMTP id q59so5485305wes.7
\r
25 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:34:52 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=D0/2AqwSy12chsRku2rIQ6KCll+oD4VHK0vyVbj9Cv8=;
\r
29 b=K01CM7yf1K+96sheCj1P8eWfhOEVqKEO3QD2FLexeCexK5l0p2vHO19kbfiPkGAafA
\r
30 Gk42Ujr+UMwhurY6ZCEuHIwY7m/7TdpycLV3iyFObWgifEmszNBTLjOk+DfvfkE+PtZP
\r
31 pGJ1DvfF/ekaMXv9d0ImEaKaXDHJSTmBPfo3KHJ1f6pxswVgWVe8k4M1p88wiVK04VTZ
\r
32 HGRQbCCfWz7xbkU3uaRa6MdPyKKADeo+tP5BgggfjCESj75rcZUozTcDRQPv33JZHKWO
\r
33 KkLGexrlW7YRWqBc3maPc+WlUQ2021MrnvUnjQG1EUKrHVODIRzkMx6bWdroFQ2HNlS5
\r
35 X-Received: by 10.180.36.212 with SMTP id s20mr10650438wij.18.1399797292931;
\r
36 Sun, 11 May 2014 01:34:52 -0700 (PDT)
\r
37 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])
\r
38 by mx.google.com with ESMTPSA id
\r
39 gr2sm12751610wjc.12.2014.05.11.01.34.51 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sun, 11 May 2014 01:34:52 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 3/7] emacs: hello: store previous saved-search results
\r
45 Date: Sun, 11 May 2014 09:34:38 +0100
\r
46 Message-Id: <1399797282-20389-4-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.10.4
\r
48 In-Reply-To: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Sun, 11 May 2014 08:35:03 -0000
\r
64 This adds a variable which keeps track of the previous saved search
\r
65 results. It is stored as a plist with keys being the saved
\r
66 searches. The result the saved search display function gave last time
\r
67 is passed to the display-function as the the keyword :old argument.
\r
69 This is useful for display functions that want to keep some state: eg
\r
70 to show that the count has changed, new messages have arrived etc. The
\r
71 function returns a saved search style plist so it can store any
\r
72 information it likes inside this plist.
\r
74 emacs/notmuch-hello.el | 8 ++++++++
\r
75 1 file changed, 8 insertions(+)
\r
77 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
78 index 7075860..e11006b 100644
\r
79 --- a/emacs/notmuch-hello.el
\r
80 +++ b/emacs/notmuch-hello.el
\r
81 @@ -127,6 +127,10 @@ (defcustom notmuch-saved-searches '((:name "inbox" :query "tag:inbox")
\r
82 :tag "List of Saved Searches"
\r
83 :group 'notmuch-hello)
\r
85 +(defvar notmuch-hello-saved-search-results nil
\r
86 + "Current saved search counts as a plist")
\r
87 +(make-local-variable 'notmuch-hello-saved-search-results)
\r
89 (defcustom notmuch-hello-recent-searches-max 10
\r
90 "The number of recent searches to display."
\r
92 @@ -541,11 +545,15 @@ (defun notmuch-hello-query-counts (query-list &rest options)
\r
94 (let* ((elem-plist (notmuch-hello-saved-search-to-plist elem))
\r
95 (display-function (plist-get elem-plist :display-function))
\r
96 + (old-result (plist-get notmuch-hello-saved-search-results elem))
\r
97 (result (if display-function
\r
98 (funcall display-function
\r
102 (notmuch-hello-batch-message-count elem-plist options))))
\r
103 + (setq notmuch-hello-saved-search-results
\r
104 + (plist-put notmuch-hello-saved-search-results elem result))
\r