1 Return-Path: <jani@nikula.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 61246431FBC
\r
6 for <notmuch@notmuchmail.org>; Sun, 8 Jul 2012 01:20:31 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5
\r
12 tests=[HTML_MESSAGE=0.001, 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 25U3-2NCnBZm for <notmuch@notmuchmail.org>;
\r
16 Sun, 8 Jul 2012 01:20:30 -0700 (PDT)
\r
17 Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com
\r
18 [209.85.214.181]) (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 79056431FAE
\r
21 for <notmuch@notmuchmail.org>; Sun, 8 Jul 2012 01:20:30 -0700 (PDT)
\r
22 Received: by obbup19 with SMTP id up19so14298438obb.26
\r
23 for <notmuch@notmuchmail.org>; Sun, 08 Jul 2012 01:20:28 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
27 :cc:content-type:x-gm-message-state;
\r
28 bh=UnobBbcHrmfPPCDZ9KICABuffucwM2yARooOkwVqEQ0=;
\r
29 b=WhntwzGbzlZ2WIV231+plDP3ah0gme0OEmtz8UhyV54Mrn5sHWCvdo0FbZofv0IOX8
\r
30 v0EQKgHzzPGc4xrlmFcRTQhYAejt6dv205KXKnhbhu2nN0L69HUOySUlWGwTMwSnsWKe
\r
31 5bcAEzy/RTyR1v43DKKdKUG5UMvv/pXVsLXPctJd7yiaTdOqmOv43k37oQzRkPmSEnSP
\r
32 2+RcqFA6NOXnU+jIbmJWA1kW1rFaBImI8neFJ/SAPa8kQFjs+2vgezUw705vbcgyWY4w
\r
33 hbqYWnvZtet95hCtWsOWNmNQv389wv2Qec6u4+oKoH0Gln1oprcP2SJq1pUJtt0gJclb
\r
36 Received: by 10.60.18.168 with SMTP id x8mr36878871oed.18.1341735628469; Sun,
\r
37 08 Jul 2012 01:20:28 -0700 (PDT)
\r
38 Received: by 10.76.10.102 with HTTP; Sun, 8 Jul 2012 01:20:28 -0700 (PDT)
\r
39 Received: by 10.76.10.102 with HTTP; Sun, 8 Jul 2012 01:20:28 -0700 (PDT)
\r
40 In-Reply-To: <87zk7aviy7.fsf@qmul.ac.uk>
\r
42 <37899e28dbf67e4620a53279a869be3174c02d6f.1339775602.git.jani@nikula.org>
\r
43 <627aea74b0080dcd903b801042a4b2fd3868c049.1339775602.git.jani@nikula.org>
\r
44 <87zk7aviy7.fsf@qmul.ac.uk>
\r
45 Date: Sun, 8 Jul 2012 11:20:28 +0300
\r
47 <CAB+hUn-PnmG+=tDNaDVEhARjAeEUcSb2EOrxV8oUTqDX1MvW-A@mail.gmail.com>
\r
48 Subject: Re: [PATCH 3/3] emacs: add notmuch hello refresh hook to display
\r
49 message count change
\r
50 From: Jani Nikula <jani@nikula.org>
\r
51 To: Mark Walters <markwalters1009@gmail.com>
\r
52 Content-Type: multipart/alternative; boundary=e89a8ff2561a84752f04c44d2bd2
\r
54 ALoCoQm6n5GEvDTL9elR1plIrGnFbpd8WENq54d6YILDtkXjMrWmEVXalJJ9FTa202bgfcwRAu8L
\r
55 Cc: notmuch@notmuchmail.org
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Sun, 08 Jul 2012 08:20:31 -0000
\r
70 --e89a8ff2561a84752f04c44d2bd2
\r
71 Content-Type: text/plain; charset=UTF-8
\r
73 On Jul 8, 2012 9:57 AM, "Mark Walters" <markwalters1009@gmail.com> wrote:
\r
75 > On Fri, 15 Jun 2012, Jani Nikula <jani@nikula.org> wrote:
\r
76 > > Add a notmuch hello refresh hook to display a message about change in
\r
77 > > message count in the database since the notmuch-hello buffer was last
\r
78 > > refreshed manually (no-display is nil).
\r
80 > > Signed-off-by: Jani Nikula <jani@nikula.org>
\r
84 > I just have a couple of comments/queries. First, since it breaks
\r
85 > existing hooks I think it needs a NEWS item.
\r
89 > Secondly, I, personally, would much prefer the hook with the slight
\r
90 > tweak that it counts inbox messages rather than all messages. Is that
\r
91 > an option that could be put in the defcustom?
\r
93 I suppose the query could be customizable. That's simple enough; for
\r
94 anything non-trivial people can write their own hooks.
\r
105 > > emacs/notmuch-hello.el | 27 +++++++++++++++++++++++++++
\r
106 > > 1 file changed, 27 insertions(+)
\r
108 > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
109 > > index bc43178..bcca044 100644
\r
110 > > --- a/emacs/notmuch-hello.el
\r
111 > > +++ b/emacs/notmuch-hello.el
\r
112 > > @@ -148,6 +148,7 @@ International Bureau of Weights and Measures."
\r
113 > > (defcustom notmuch-hello-refresh-hook nil
\r
114 > > "Functions called after updating a `notmuch-hello' buffer."
\r
116 > > + :options '(notmuch-hello-refresh-status-message)
\r
117 > > :group 'notmuch-hello
\r
118 > > :group 'notmuch-hooks)
\r
120 > > @@ -749,6 +750,32 @@ following:
\r
121 > > (let ((fill-column (- (window-width) notmuch-hello-indent)))
\r
122 > > (center-region start (point)))))
\r
124 > > +(defvar notmuch-hello-refresh-count 0
\r
125 > > + "Number of messages in the database when `notmuch-hello' was last
\r
128 > > +Used internally by `notmuch-hello-refresh-status-message'.")
\r
130 > > +(defun notmuch-hello-refresh-status-message (no-display)
\r
131 > > + "Hook to display a status message when refreshing notmuch-hello
\r
134 > > +Display a status message about the difference in message count in
\r
135 > > +the database since the last call."
\r
136 > > + (unless no-display
\r
137 > > + (let* ((new-count
\r
138 > > + (string-to-number (car (process-lines notmuch-command
\r
140 > > + (diff-count (- new-count notmuch-hello-refresh-count)))
\r
142 > > + ((= notmuch-hello-refresh-count 0)
\r
143 > > + (message "You have %s messages."
\r
144 > > + (notmuch-hello-nice-number new-count)))
\r
145 > > + ((> diff-count 0)
\r
146 > > + (message "You have %s more messages since last refresh."
\r
147 > > + (notmuch-hello-nice-number diff-count)))
\r
148 > > + ((< diff-count 0)
\r
149 > > + (message "You have %s fewer messages since last refresh."
\r
150 > > + (notmuch-hello-nice-number (- diff-count)))))
\r
151 > > + (setq notmuch-hello-refresh-count new-count))))
\r
154 > > (defun notmuch-hello (&optional no-display)
\r
155 > > "Run notmuch and display saved searches, known tags, etc."
\r
159 > > _______________________________________________
\r
160 > > notmuch mailing list
\r
161 > > notmuch@notmuchmail.org
\r
162 > > http://notmuchmail.org/mailman/listinfo/notmuch
\r
164 --e89a8ff2561a84752f04c44d2bd2
\r
165 Content-Type: text/html; charset=UTF-8
\r
166 Content-Transfer-Encoding: quoted-printable
\r
169 On Jul 8, 2012 9:57 AM, "Mark Walters" <<a href=3D"mailto:mark=
\r
170 walters1009@gmail.com">markwalters1009@gmail.com</a>> wrote:<br>
\r
172 > On Fri, 15 Jun 2012, Jani Nikula <<a href=3D"mailto:jani@nikula.org=
\r
173 ">jani@nikula.org</a>> wrote:<br>
\r
174 > > Add a notmuch hello refresh hook to display a message about chang=
\r
176 > > message count in the database since the notmuch-hello buffer was =
\r
178 > > refreshed manually (no-display is nil).<br>
\r
180 > > Signed-off-by: Jani Nikula <<a href=3D"mailto:jani@nikula.org"=
\r
181 >jani@nikula.org</a>><br>
\r
185 > I just have a couple of comments/queries. First, since it breaks<br>
\r
186 > existing hooks I think it needs a NEWS item.</p>
\r
188 <p>> Secondly, I, personally, would much prefer the hook with the slight=
\r
190 > tweak that it counts inbox messages rather than all messages. Is that<=
\r
192 > an option that could be put in the defcustom?</p>
\r
193 <p>I suppose the query could be customizable. That's simple enough; for=
\r
194 anything non-trivial people can write their own hooks.</p>
\r
198 > Best wishes<br>
\r
203 > > =C2=A0emacs/notmuch-hello.el | =C2=A0 27 ++++++++++++++++++++++++=
\r
205 > > =C2=A01 file changed, 27 insertions(+)<br>
\r
207 > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el<br>
\r
208 > > index bc43178..bcca044 100644<br>
\r
209 > > --- a/emacs/notmuch-hello.el<br>
\r
210 > > +++ b/emacs/notmuch-hello.el<br>
\r
211 > > @@ -148,6 +148,7 @@ International Bureau of Weights and Measures.=
\r
213 > > =C2=A0(defcustom notmuch-hello-refresh-hook nil<br>
\r
214 > > =C2=A0 =C2=A0"Functions called after updating a `notmuch-hel=
\r
215 lo' buffer."<br>
\r
216 > > =C2=A0 =C2=A0:type 'hook<br>
\r
217 > > + =C2=A0:options '(notmuch-hello-refresh-status-message)<br>
\r
218 > > =C2=A0 =C2=A0:group 'notmuch-hello<br>
\r
219 > > =C2=A0 =C2=A0:group 'notmuch-hooks)<br>
\r
221 > > @@ -749,6 +750,32 @@ following:<br>
\r
222 > > =C2=A0 =C2=A0 =C2=A0(let ((fill-column (- (window-width) notmuch-=
\r
223 hello-indent)))<br>
\r
224 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(center-region start (point)))))<br>
\r
226 > > +(defvar notmuch-hello-refresh-count 0<br>
\r
227 > > + =C2=A0"Number of messages in the database when `notmuch-he=
\r
228 llo' was last run.<br>
\r
230 > > +Used internally by `notmuch-hello-refresh-status-message'.&q=
\r
233 > > +(defun notmuch-hello-refresh-status-message (no-display)<br>
\r
234 > > + =C2=A0"Hook to display a status message when refreshing no=
\r
235 tmuch-hello buffer.<br>
\r
237 > > +Display a status message about the difference in message count i=
\r
239 > > +the database since the last call."<br>
\r
240 > > + =C2=A0(unless no-display<br>
\r
241 > > + =C2=A0 =C2=A0(let* ((new-count<br>
\r
242 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-to-number (car (process-lin=
\r
243 es notmuch-command "count"))))<br>
\r
244 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(diff-count (- new-count notmuch-hel=
\r
245 lo-refresh-count)))<br>
\r
246 > > + =C2=A0 =C2=A0 =C2=A0(cond<br>
\r
247 > > + =C2=A0 =C2=A0 =C2=A0 ((=3D notmuch-hello-refresh-count 0)<br>
\r
248 > > + =C2=A0 =C2=A0 (message "You have %s messages."<br>
\r
249 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=
\r
250 nice-number new-count)))<br>
\r
251 > > + =C2=A0 =C2=A0 =C2=A0 ((> diff-count 0)<br>
\r
252 > > + =C2=A0 =C2=A0 (message "You have %s more messages since la=
\r
253 st refresh."<br>
\r
254 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=
\r
255 nice-number diff-count)))<br>
\r
256 > > + =C2=A0 =C2=A0 =C2=A0 ((< diff-count 0)<br>
\r
257 > > + =C2=A0 =C2=A0 (message "You have %s fewer messages since l=
\r
258 ast refresh."<br>
\r
259 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=
\r
260 nice-number (- diff-count)))))<br>
\r
261 > > + =C2=A0 =C2=A0 =C2=A0(setq notmuch-hello-refresh-count new-count=
\r
264 > > =C2=A0;;;###autoload<br>
\r
265 > > =C2=A0(defun notmuch-hello (&optional no-display)<br>
\r
266 > > =C2=A0 =C2=A0"Run notmuch and display saved searches, known =
\r
267 tags, etc."<br>
\r
269 > > 1.7.9.5<br>
\r
271 > > _______________________________________________<br>
\r
272 > > notmuch mailing list<br>
\r
273 > > <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.or=
\r
275 > > <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http:=
\r
276 //notmuchmail.org/mailman/listinfo/notmuch</a><br>
\r
279 --e89a8ff2561a84752f04c44d2bd2--
\r