--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 61246431FBC\r
+ for <notmuch@notmuchmail.org>; Sun, 8 Jul 2012 01:20:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+ tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 25U3-2NCnBZm for <notmuch@notmuchmail.org>;\r
+ Sun, 8 Jul 2012 01:20:30 -0700 (PDT)\r
+Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com\r
+ [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 79056431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 8 Jul 2012 01:20:30 -0700 (PDT)\r
+Received: by obbup19 with SMTP id up19so14298438obb.26\r
+ for <notmuch@notmuchmail.org>; Sun, 08 Jul 2012 01:20:28 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+ :cc:content-type:x-gm-message-state;\r
+ bh=UnobBbcHrmfPPCDZ9KICABuffucwM2yARooOkwVqEQ0=;\r
+ b=WhntwzGbzlZ2WIV231+plDP3ah0gme0OEmtz8UhyV54Mrn5sHWCvdo0FbZofv0IOX8\r
+ v0EQKgHzzPGc4xrlmFcRTQhYAejt6dv205KXKnhbhu2nN0L69HUOySUlWGwTMwSnsWKe\r
+ 5bcAEzy/RTyR1v43DKKdKUG5UMvv/pXVsLXPctJd7yiaTdOqmOv43k37oQzRkPmSEnSP\r
+ 2+RcqFA6NOXnU+jIbmJWA1kW1rFaBImI8neFJ/SAPa8kQFjs+2vgezUw705vbcgyWY4w\r
+ hbqYWnvZtet95hCtWsOWNmNQv389wv2Qec6u4+oKoH0Gln1oprcP2SJq1pUJtt0gJclb\r
+ Z8kw==\r
+MIME-Version: 1.0\r
+Received: by 10.60.18.168 with SMTP id x8mr36878871oed.18.1341735628469; Sun,\r
+ 08 Jul 2012 01:20:28 -0700 (PDT)\r
+Received: by 10.76.10.102 with HTTP; Sun, 8 Jul 2012 01:20:28 -0700 (PDT)\r
+Received: by 10.76.10.102 with HTTP; Sun, 8 Jul 2012 01:20:28 -0700 (PDT)\r
+In-Reply-To: <87zk7aviy7.fsf@qmul.ac.uk>\r
+References:\r
+ <37899e28dbf67e4620a53279a869be3174c02d6f.1339775602.git.jani@nikula.org>\r
+ <627aea74b0080dcd903b801042a4b2fd3868c049.1339775602.git.jani@nikula.org>\r
+ <87zk7aviy7.fsf@qmul.ac.uk>\r
+Date: Sun, 8 Jul 2012 11:20:28 +0300\r
+Message-ID:\r
+ <CAB+hUn-PnmG+=tDNaDVEhARjAeEUcSb2EOrxV8oUTqDX1MvW-A@mail.gmail.com>\r
+Subject: Re: [PATCH 3/3] emacs: add notmuch hello refresh hook to display\r
+ message count change\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Content-Type: multipart/alternative; boundary=e89a8ff2561a84752f04c44d2bd2\r
+X-Gm-Message-State:\r
+ ALoCoQm6n5GEvDTL9elR1plIrGnFbpd8WENq54d6YILDtkXjMrWmEVXalJJ9FTa202bgfcwRAu8L\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 08 Jul 2012 08:20:31 -0000\r
+\r
+--e89a8ff2561a84752f04c44d2bd2\r
+Content-Type: text/plain; charset=UTF-8\r
+\r
+On Jul 8, 2012 9:57 AM, "Mark Walters" <markwalters1009@gmail.com> wrote:\r
+>\r
+> On Fri, 15 Jun 2012, Jani Nikula <jani@nikula.org> wrote:\r
+> > Add a notmuch hello refresh hook to display a message about change in\r
+> > message count in the database since the notmuch-hello buffer was last\r
+> > refreshed manually (no-display is nil).\r
+> >\r
+> > Signed-off-by: Jani Nikula <jani@nikula.org>\r
+>\r
+> Hi\r
+>\r
+> I just have a couple of comments/queries. First, since it breaks\r
+> existing hooks I think it needs a NEWS item.\r
+\r
+Sure.\r
+\r
+> Secondly, I, personally, would much prefer the hook with the slight\r
+> tweak that it counts inbox messages rather than all messages. Is that\r
+> an option that could be put in the defcustom?\r
+\r
+I suppose the query could be customizable. That's simple enough; for\r
+anything non-trivial people can write their own hooks.\r
+\r
+BR,\r
+Jani.\r
+\r
+>\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+> > ---\r
+> > emacs/notmuch-hello.el | 27 +++++++++++++++++++++++++++\r
+> > 1 file changed, 27 insertions(+)\r
+> >\r
+> > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+> > index bc43178..bcca044 100644\r
+> > --- a/emacs/notmuch-hello.el\r
+> > +++ b/emacs/notmuch-hello.el\r
+> > @@ -148,6 +148,7 @@ International Bureau of Weights and Measures."\r
+> > (defcustom notmuch-hello-refresh-hook nil\r
+> > "Functions called after updating a `notmuch-hello' buffer."\r
+> > :type 'hook\r
+> > + :options '(notmuch-hello-refresh-status-message)\r
+> > :group 'notmuch-hello\r
+> > :group 'notmuch-hooks)\r
+> >\r
+> > @@ -749,6 +750,32 @@ following:\r
+> > (let ((fill-column (- (window-width) notmuch-hello-indent)))\r
+> > (center-region start (point)))))\r
+> >\r
+> > +(defvar notmuch-hello-refresh-count 0\r
+> > + "Number of messages in the database when `notmuch-hello' was last\r
+run.\r
+> > +\r
+> > +Used internally by `notmuch-hello-refresh-status-message'.")\r
+> > +\r
+> > +(defun notmuch-hello-refresh-status-message (no-display)\r
+> > + "Hook to display a status message when refreshing notmuch-hello\r
+buffer.\r
+> > +\r
+> > +Display a status message about the difference in message count in\r
+> > +the database since the last call."\r
+> > + (unless no-display\r
+> > + (let* ((new-count\r
+> > + (string-to-number (car (process-lines notmuch-command\r
+"count"))))\r
+> > + (diff-count (- new-count notmuch-hello-refresh-count)))\r
+> > + (cond\r
+> > + ((= notmuch-hello-refresh-count 0)\r
+> > + (message "You have %s messages."\r
+> > + (notmuch-hello-nice-number new-count)))\r
+> > + ((> diff-count 0)\r
+> > + (message "You have %s more messages since last refresh."\r
+> > + (notmuch-hello-nice-number diff-count)))\r
+> > + ((< diff-count 0)\r
+> > + (message "You have %s fewer messages since last refresh."\r
+> > + (notmuch-hello-nice-number (- diff-count)))))\r
+> > + (setq notmuch-hello-refresh-count new-count))))\r
+> > +\r
+> > ;;;###autoload\r
+> > (defun notmuch-hello (&optional no-display)\r
+> > "Run notmuch and display saved searches, known tags, etc."\r
+> > --\r
+> > 1.7.9.5\r
+> >\r
+> > _______________________________________________\r
+> > notmuch mailing list\r
+> > notmuch@notmuchmail.org\r
+> > http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--e89a8ff2561a84752f04c44d2bd2\r
+Content-Type: text/html; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+<p><br>\r
+On Jul 8, 2012 9:57 AM, "Mark Walters" <<a href=3D"mailto:mark=\r
+walters1009@gmail.com">markwalters1009@gmail.com</a>> wrote:<br>\r
+><br>\r
+> On Fri, 15 Jun 2012, Jani Nikula <<a href=3D"mailto:jani@nikula.org=\r
+">jani@nikula.org</a>> wrote:<br>\r
+> > Add a notmuch hello refresh hook to display a message about chang=\r
+e in<br>\r
+> > message count in the database since the notmuch-hello buffer was =\r
+last<br>\r
+> > refreshed manually (no-display is nil).<br>\r
+> ><br>\r
+> > Signed-off-by: Jani Nikula <<a href=3D"mailto:jani@nikula.org"=\r
+>jani@nikula.org</a>><br>\r
+><br>\r
+> Hi<br>\r
+><br>\r
+> I just have a couple of comments/queries. First, since it breaks<br>\r
+> existing hooks I think it needs a NEWS item.</p>\r
+<p>Sure.</p>\r
+<p>> Secondly, I, personally, would much prefer the hook with the slight=\r
+<br>\r
+> tweak that it counts inbox messages rather than all messages. Is that<=\r
+br>\r
+> an option that could be put in the defcustom?</p>\r
+<p>I suppose the query could be customizable. That's simple enough; for=\r
+ anything non-trivial people can write their own hooks.</p>\r
+<p>BR,<br>\r
+Jani.</p>\r
+<p>><br>\r
+> Best wishes<br>\r
+><br>\r
+> Mark<br>\r
+><br>\r
+> > ---<br>\r
+> > =C2=A0emacs/notmuch-hello.el | =C2=A0 27 ++++++++++++++++++++++++=\r
++++<br>\r
+> > =C2=A01 file changed, 27 insertions(+)<br>\r
+> ><br>\r
+> > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el<br>\r
+> > index bc43178..bcca044 100644<br>\r
+> > --- a/emacs/notmuch-hello.el<br>\r
+> > +++ b/emacs/notmuch-hello.el<br>\r
+> > @@ -148,6 +148,7 @@ International Bureau of Weights and Measures.=\r
+"<br>\r
+> > =C2=A0(defcustom notmuch-hello-refresh-hook nil<br>\r
+> > =C2=A0 =C2=A0"Functions called after updating a `notmuch-hel=\r
+lo' buffer."<br>\r
+> > =C2=A0 =C2=A0:type 'hook<br>\r
+> > + =C2=A0:options '(notmuch-hello-refresh-status-message)<br>\r
+> > =C2=A0 =C2=A0:group 'notmuch-hello<br>\r
+> > =C2=A0 =C2=A0:group 'notmuch-hooks)<br>\r
+> ><br>\r
+> > @@ -749,6 +750,32 @@ following:<br>\r
+> > =C2=A0 =C2=A0 =C2=A0(let ((fill-column (- (window-width) notmuch-=\r
+hello-indent)))<br>\r
+> > =C2=A0 =C2=A0 =C2=A0 =C2=A0(center-region start (point)))))<br>\r
+> ><br>\r
+> > +(defvar notmuch-hello-refresh-count 0<br>\r
+> > + =C2=A0"Number of messages in the database when `notmuch-he=\r
+llo' was last run.<br>\r
+> > +<br>\r
+> > +Used internally by `notmuch-hello-refresh-status-message'.&q=\r
+uot;)<br>\r
+> > +<br>\r
+> > +(defun notmuch-hello-refresh-status-message (no-display)<br>\r
+> > + =C2=A0"Hook to display a status message when refreshing no=\r
+tmuch-hello buffer.<br>\r
+> > +<br>\r
+> > +Display a status message about the difference in message count i=\r
+n<br>\r
+> > +the database since the last call."<br>\r
+> > + =C2=A0(unless no-display<br>\r
+> > + =C2=A0 =C2=A0(let* ((new-count<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-to-number (car (process-lin=\r
+es notmuch-command "count"))))<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(diff-count (- new-count notmuch-hel=\r
+lo-refresh-count)))<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0(cond<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 ((=3D notmuch-hello-refresh-count 0)<br>\r
+> > + =C2=A0 =C2=A0 (message "You have %s messages."<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=\r
+nice-number new-count)))<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 ((> diff-count 0)<br>\r
+> > + =C2=A0 =C2=A0 (message "You have %s more messages since la=\r
+st refresh."<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=\r
+nice-number diff-count)))<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 ((< diff-count 0)<br>\r
+> > + =C2=A0 =C2=A0 (message "You have %s fewer messages since l=\r
+ast refresh."<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-hello-=\r
+nice-number (- diff-count)))))<br>\r
+> > + =C2=A0 =C2=A0 =C2=A0(setq notmuch-hello-refresh-count new-count=\r
+))))<br>\r
+> > +<br>\r
+> > =C2=A0;;;###autoload<br>\r
+> > =C2=A0(defun notmuch-hello (&optional no-display)<br>\r
+> > =C2=A0 =C2=A0"Run notmuch and display saved searches, known =\r
+tags, etc."<br>\r
+> > --<br>\r
+> > 1.7.9.5<br>\r
+> ><br>\r
+> > _______________________________________________<br>\r
+> > notmuch mailing list<br>\r
+> > <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.or=\r
+g</a><br>\r
+> > <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http:=\r
+//notmuchmail.org/mailman/listinfo/notmuch</a><br>\r
+</p>\r
+\r
+--e89a8ff2561a84752f04c44d2bd2--\r