Re: message-default-mail-headers not working in notmuch 0.22
[notmuch-archives.git] / 9c / 163a0d09910475a79f341cdd8988e245bee31f
1 Return-Path: <dme@dme.org>\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 21CF9431FC7\r
6         for <notmuch@notmuchmail.org>; Mon, 12 May 2014 06:58:47 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id veUIdAVJoUZu for <notmuch@notmuchmail.org>;\r
16         Mon, 12 May 2014 06:58:40 -0700 (PDT)\r
17 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com\r
18         [209.85.212.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C6F50431FC2\r
21         for <notmuch@notmuchmail.org>; Mon, 12 May 2014 06:58:39 -0700 (PDT)\r
22 Received: by mail-wi0-f174.google.com with SMTP id r20so4517656wiv.13\r
23         for <notmuch@notmuchmail.org>; Mon, 12 May 2014 06:58:37 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
27         :from:date:message-id:mime-version:content-type;\r
28         bh=Sqxap8cx20K/O0+JdFRsREY5AdjKgP4vEgwpw4wf20w=;\r
29         b=cZRrCMawU/ak+yHZQL2EzK8yIklKtsNsKnVUrRLU9OtHvXm2p4MDBSJIYrhZSEh01d\r
30         qNzsNl2HNlwsP8cK018m94+8xaS7arqKnrZGcFEmtvbS4aCseOkXpg7E13qIlY8oPwO2\r
31         lgGS1kE/G3fleVdd/I9KxDEE2uj8b0en4+zL65SblH2p/2y8jm8y0UXXa1ht26L8Ov8h\r
32         tZ4lzU4NOb8dKbjNuDNRQyvv7KUXeWFFx/3fOQNGvCfku9UvbTbC+E0Luvm2/tu8sH80\r
33         Ulp7C3COxMm8GMSx8gODXkl+mDLvVMjfH0rryPTI8rphJ7B+4Pt1QpeXhMtCqwsbuMdk\r
34         W3LQ==\r
35 X-Gm-Message-State:\r
36  ALoCoQnaWIxzkWjJjccMrLtEOhW+PJD4U5RqoIUcDYx2R16onA+6RySctLubwnD6XYoxjW2Fgr1y\r
37 X-Received: by 10.180.14.199 with SMTP id r7mr16055266wic.0.1399903117436;\r
38         Mon, 12 May 2014 06:58:37 -0700 (PDT)\r
39 Received: from localhost ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8])\r
40         by mx.google.com with ESMTPSA id\r
41         ej2sm18053459wjd.21.2014.05.12.06.58.33 for <multiple recipients>\r
42         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
43         Mon, 12 May 2014 06:58:34 -0700 (PDT)\r
44 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
45 Subject: Re: [PATCH 6/7] emacs: hello: add highlight newly arrived messages\r
46         option\r
47 In-Reply-To: <1399797282-20389-7-git-send-email-markwalters1009@gmail.com>\r
48 References: <1399797282-20389-1-git-send-email-markwalters1009@gmail.com>\r
49         <1399797282-20389-7-git-send-email-markwalters1009@gmail.com>\r
50 User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1\r
51         (x86_64-pc-linux-gnu)\r
52 From: David Edmondson <dme@dme.org>\r
53 Date: Mon, 12 May 2014 14:58:28 +0100\r
54 Message-ID: <cunlhu76quz.fsf@hotblack-desiato.hh.sledj.net>\r
55 MIME-Version: 1.0\r
56 Content-Type: multipart/signed; boundary="=-=-=";\r
57         micalg=pgp-sha1; protocol="application/pgp-signature"\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Mon, 12 May 2014 13:58:48 -0000\r
71 \r
72 --=-=-=\r
73 Content-Type: text/plain\r
74 Content-Transfer-Encoding: quoted-printable\r
75 \r
76 On Sun, May 11 2014, Mark Walters wrote:\r
77 > This adds a function that highlights searches which have newly arrived\r
78 > messages (ones which arrived since the previous refresh of\r
79 > notmuch-hello). It does that by getting a full list of matching\r
80 > message ids and checking whether any new messages have appeared. Thus\r
81 > it will be slow on large saved searches.\r
82 > ---\r
83 >  emacs/notmuch-hello.el |   21 +++++++++++++++++++++\r
84 >  1 file changed, 21 insertions(+)\r
85 >\r
86 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
87 > index 28e16be..265b879 100644\r
88 > --- a/emacs/notmuch-hello.el\r
89 > +++ b/emacs/notmuch-hello.el\r
90 > @@ -96,6 +96,8 @@ (define-widget 'notmuch-saved-search-plist 'list\r
91 >                                   (const :tag "Default (messages)" nil)\r
92 >                                   (function-item :tag "messages/threads"\r
93 >                                                  notmuch-hello-display-count-threads-and-messages)\r
94 > +                                 (function-item :tag "highlight newly arrived messages"\r
95 > +                                                notmuch-hello-display-new-messages)\r
96 >                                   function)))))\r
97 >=20=20\r
98 >  (defcustom notmuch-saved-searches '((:name "inbox" :query "tag:inbox")\r
99 > @@ -507,6 +509,25 @@ (defun notmuch-hello-display-count-threads-and-messa=\r
100 ges (&rest args)\r
101 >                         (notmuch-hello-nice-number threads))))\r
102 >      (plist-put current :count display)))\r
103 >=20=20\r
104 > +(defun notmuch-hello-display-new-messages (&rest args)\r
105 > +  "Highlight saved searches which have new messages.\r
106 > +\r
107 > +New messages are ones which have appeared since the last time\r
108 > +notmuch hello was refreshed. This will be slow on large queries."\r
109 > +  (let* ((current (plist-get args :current))\r
110 > +      (old (plist-get args :old))\r
111 > +      (query (plist-get current :query))\r
112 > +      (name (plist-get current :name))\r
113 > +      (new-list (notmuch-call-notmuch-sexp "search"\r
114 > +                                           "--output=3Dmessages"\r
115 > +                                           "--format=3Dsexp"\r
116 > +                                           query))\r
117 > +      (old-list (plist-get old :message-list)))\r
118 > +    (unless (subsetp new-list old-list :test 'equal)\r
119 > +      (plist-put current :name (propertize name 'face '(:foreground "red=\r
120 "))))\r
121 > +    (plist-put current :count (notmuch-hello-nice-number (length new-lis=\r
122 t)))\r
123 > +    (plist-put current :message-list new-list)))\r
124 \r
125 I wonder if it would be better to store a hash value derived from the\r
126 message list rather than the list itself. The list could be large.\r
127 \r
128 > +\r
129 >  (defun notmuch-hello-batch-message-count (elem-plist options)\r
130 >    "Update the message count for a saved search.\r
131 >=20=20\r
132 > --=20\r
133 > 1.7.10.4\r
134 >\r
135 > _______________________________________________\r
136 > notmuch mailing list\r
137 > notmuch@notmuchmail.org\r
138 > http://notmuchmail.org/mailman/listinfo/notmuch\r
139 \r
140 --=-=-=\r
141 Content-Type: application/pgp-signature; name="signature.asc"\r
142 \r
143 -----BEGIN PGP SIGNATURE-----\r
144 Version: GnuPG v1\r
145 \r
146 iKYEARECAGYFAlNw04RfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl\r
147 bnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1M0Y5NDJDMEExNjc3MDE4OURGMUYyMDY5\r
148 RUNEMEFCRjA0OTY1MTYACgkQaezQq/BJZRbrdACgiT712Cb8m2ZHfF/q8+1vlhTG\r
149 5mQAn0q2cyqZ4EyAfg+LSX3vXjgfPk2M\r
150 =+NxA\r
151 -----END PGP SIGNATURE-----\r
152 --=-=-=--\r