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 F2ED9431FD5
\r
6 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:35:32 -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 3UTlV-+6PzfX for <notmuch@notmuchmail.org>;
\r
18 Sun, 11 May 2014 01:35:26 -0700 (PDT)
\r
19 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com
\r
20 [209.85.212.174]) (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 0E8C3431FD8
\r
23 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:34:59 -0700 (PDT)
\r
24 Received: by mail-wi0-f174.google.com with SMTP id r20so3110706wiv.7
\r
25 for <notmuch@notmuchmail.org>; Sun, 11 May 2014 01:34:57 -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=+G915XYvV22C6eVdqzno2RwGphrqXZ4LpBN05H+0od0=;
\r
29 b=lAscZ4ZNXI73FeObVu2/VNzHroy4I8cGqnzh9pFkcp77sBQlFN4WX4iUwlV3Zm8epj
\r
30 GqLJEUCyzswzVpGmTaf3c7eV6AwsyQzL1VC0a6G0We5UNe3fzSL1bZm+GaKx+JpPytfL
\r
31 P2BGjEe6QnJAwtfcfXC2oy+jEugRnf9WZB+fG7qdMH7mwjzRj5bu2Y8I4DHt0g8/tN1b
\r
32 DXaHfaajxg8YcmEPV2gDmdPzYTw/sDKAUx6usv80GCpqt3CxNGpbe1rSJ/Sp6ZBf31G0
\r
33 7GLOdUJwf/35qsaysdqQKB/DyPeDl+nRrqiRzWYzMEGp4Y6fqHuss2l9YjCz/FMaesuW
\r
35 X-Received: by 10.194.243.3 with SMTP id wu3mr16170932wjc.29.1399797297796;
\r
36 Sun, 11 May 2014 01:34:57 -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 cv4sm12741202wjc.34.2014.05.11.01.34.56 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sun, 11 May 2014 01:34:57 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 6/7] emacs: hello: add highlight newly arrived messages option
\r
45 Date: Sun, 11 May 2014 09:34:41 +0100
\r
46 Message-Id: <1399797282-20389-7-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:33 -0000
\r
64 This adds a function that highlights searches which have newly arrived
\r
65 messages (ones which arrived since the previous refresh of
\r
66 notmuch-hello). It does that by getting a full list of matching
\r
67 message ids and checking whether any new messages have appeared. Thus
\r
68 it will be slow on large saved searches.
\r
70 emacs/notmuch-hello.el | 21 +++++++++++++++++++++
\r
71 1 file changed, 21 insertions(+)
\r
73 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
74 index 28e16be..265b879 100644
\r
75 --- a/emacs/notmuch-hello.el
\r
76 +++ b/emacs/notmuch-hello.el
\r
77 @@ -96,6 +96,8 @@ (define-widget 'notmuch-saved-search-plist 'list
\r
78 (const :tag "Default (messages)" nil)
\r
79 (function-item :tag "messages/threads"
\r
80 notmuch-hello-display-count-threads-and-messages)
\r
81 + (function-item :tag "highlight newly arrived messages"
\r
82 + notmuch-hello-display-new-messages)
\r
85 (defcustom notmuch-saved-searches '((:name "inbox" :query "tag:inbox")
\r
86 @@ -507,6 +509,25 @@ (defun notmuch-hello-display-count-threads-and-messages (&rest args)
\r
87 (notmuch-hello-nice-number threads))))
\r
88 (plist-put current :count display)))
\r
90 +(defun notmuch-hello-display-new-messages (&rest args)
\r
91 + "Highlight saved searches which have new messages.
\r
93 +New messages are ones which have appeared since the last time
\r
94 +notmuch hello was refreshed. This will be slow on large queries."
\r
95 + (let* ((current (plist-get args :current))
\r
96 + (old (plist-get args :old))
\r
97 + (query (plist-get current :query))
\r
98 + (name (plist-get current :name))
\r
99 + (new-list (notmuch-call-notmuch-sexp "search"
\r
100 + "--output=messages"
\r
103 + (old-list (plist-get old :message-list)))
\r
104 + (unless (subsetp new-list old-list :test 'equal)
\r
105 + (plist-put current :name (propertize name 'face '(:foreground "red"))))
\r
106 + (plist-put current :count (notmuch-hello-nice-number (length new-list)))
\r
107 + (plist-put current :message-list new-list)))
\r
109 (defun notmuch-hello-batch-message-count (elem-plist options)
\r
110 "Update the message count for a saved search.
\r