--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\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 5BC83431FDE\r
+ for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 14:25:02 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ 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 He7YdcA5VSdB for <notmuch@notmuchmail.org>;\r
+ Sat, 5 Apr 2014 14:24:57 -0700 (PDT)\r
+Received: from mail-we0-f173.google.com (mail-we0-f173.google.com\r
+ [74.125.82.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 9B7FF431FAF\r
+ for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 14:24:52 -0700 (PDT)\r
+Received: by mail-we0-f173.google.com with SMTP id w61so4950022wes.4\r
+ for <notmuch@notmuchmail.org>; Sat, 05 Apr 2014 14:24:51 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=UWuT3ixcgYokK94vpuueVIlsaznA24sP2RjU8bwoyYE=;\r
+ b=iEEawt6oVNLpgzgZHvN4nqJUPhdu838taKdwBbFv/rzzDiGShlVLA1T5ekYfeC9AIQ\r
+ Xokp0k7DCAlcfCvnnsS8wijim031e03bLaRRZyFouF3Dc/b7821CO6m/nbj5wy7LFni5\r
+ x7WB5S4Hi6oKVKZYfL6U0kSfzldnvg57GdhE2vXyBNubtrPY+o682y0Gc/CCvzMTKUyn\r
+ JFg0B3RgXuaUM6deFDNx2OYVf8NFZOh7cig3nq2/YyJH/H5Np1QXD+kowjgV/VAKGOhC\r
+ HCFL3/qObNMvrvpcxJVz1BwU07Fw5NGl/ThOrwvzmrDKCTIccGtpWdtlsczowtTq8/Fn\r
+ qTSQ==\r
+X-Received: by 10.194.24.194 with SMTP id w2mr30614493wjf.25.1396733090103;\r
+ Sat, 05 Apr 2014 14:24:50 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id q2sm13065203wix.5.2014.04.05.14.24.49\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sat, 05 Apr 2014 14:24:49 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/5] emacs: hello: switch notmuch-hello-insert-buttons to\r
+ plists\r
+Date: Sat, 5 Apr 2014 22:24:24 +0100\r
+Message-Id: <1396733065-32602-5-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1396733065-32602-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1396733065-32602-1-git-send-email-markwalters1009@gmail.com>\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: Sat, 05 Apr 2014 21:25:02 -0000\r
+\r
+Switching notmuch-hello-insert-buttons to plists means we can easily\r
+pass extra options through to the buttons.\r
+---\r
+ emacs/notmuch-hello.el | 33 +++++++++++++++++++--------------\r
+ 1 file changed, 19 insertions(+), 14 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index c729af2..aa40e6f 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -425,7 +425,9 @@ (defun notmuch-hello-query-counts (query-list &rest options)\r
+ these is a plist but other options are available for backwards\r
+ compatibility: see notmuch-saved-search-get for details.\r
+ \r
+-The result is the list of elements of the form (NAME QUERY COUNT).\r
++The result is a list of plists each of which includes the\r
++pairs :name NAME, :query QUERY and :count COUNT, together with\r
++any pairs in the original saved-search.\r
+ \r
+ The values :show-empty-searches, :filter and :filter-count from\r
+ options will be handled as specified for\r
+@@ -455,23 +457,26 @@ (defun notmuch-hello-query-counts (query-list &rest options)\r
+ #'identity\r
+ (mapcar\r
+ (lambda (elem)\r
+- (let ((name (notmuch-saved-search-get elem :name))\r
+- (search-query (notmuch-saved-search-get elem :query))\r
+- (message-count (prog1 (read (current-buffer))\r
++ (let* ((elem-plist (notmuch-hello-saved-search-to-plist elem))\r
++ (search-query (plist-get elem-plist :query))\r
++ (filtered-query (notmuch-hello-filtered-query\r
++ search-query (plist-get options :filter)))\r
++ (message-count (prog1 (read (current-buffer))\r
+ (forward-line 1))))\r
+ (and (or (plist-get options :show-empty-searches) (> message-count 0))\r
+- (list name (notmuch-hello-filtered-query\r
+- search-query (plist-get options :filter))\r
+- message-count))))\r
++ (setq elem-plist (plist-put elem-plist :query filtered-query))\r
++ (plist-put elem-plist :count message-count))))\r
+ query-list))))\r
+ \r
+ (defun notmuch-hello-insert-buttons (searches)\r
+ "Insert buttons for SEARCHES.\r
+ \r
+-SEARCHES must be a list containing lists of the form (NAME QUERY COUNT), where\r
+-QUERY is the query to start when the button for the corresponding entry is\r
+-activated. COUNT should be the number of messages matching the query.\r
+-Such a list can be computed with `notmuch-hello-query-counts'."\r
++SEARCHES must be a list of plists each of which should contain at\r
++least pairs for :name NAME :query QUERY and :count COUNT, where\r
++QUERY is the query to start when the button for the corresponding\r
++entry is activated, and COUNT should be the number of messages\r
++matching the query. Such a plist can be computed with\r
++`notmuch-hello-query-counts'."\r
+ (let* ((widest (notmuch-hello-longest-label searches))\r
+ (tags-and-width (notmuch-hello-tags-per-line widest))\r
+ (tags-per-line (car tags-and-width))\r
+@@ -489,9 +494,9 @@ (defun notmuch-hello-insert-buttons (searches)\r
+ (when elem\r
+ (if (> column-indent 0)\r
+ (widget-insert (make-string column-indent ? )))\r
+- (let* ((name (first elem))\r
+- (query (second elem))\r
+- (msg-count (third elem)))\r
++ (let* ((name (plist-get elem :name))\r
++ (query (plist-get elem :query))\r
++ (msg-count (plist-get elem :count)))\r
+ (widget-insert (format "%8s "\r
+ (notmuch-hello-nice-number msg-count)))\r
+ (widget-create 'push-button\r
+-- \r
+1.7.10.4\r
+\r