[PATCH] emacs: Add the option of counting threads in notmuch-hello
authorAdam Wolfe Gordon <awg+notmuch@xvx.ca>
Wed, 15 Feb 2012 15:28:08 +0000 (08:28 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:32 +0000 (09:44 -0800)
9c/bb3025a3b5602d743344b12d5d81ee560e3ea0 [new file with mode: 0644]

diff --git a/9c/bb3025a3b5602d743344b12d5d81ee560e3ea0 b/9c/bb3025a3b5602d743344b12d5d81ee560e3ea0
new file mode 100644 (file)
index 0000000..52d2ab4
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <awg@lagos.xvx.ca>\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 4694E431E82\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 07:28:20 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 b3ZihutUlTxE for <notmuch@notmuchmail.org>;\r
+       Wed, 15 Feb 2012 07:28:16 -0800 (PST)\r
+Received: from smtp-out-04.shaw.ca (smtp-out-04.shaw.ca [64.59.134.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 38C5C431E62\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 07:28:16 -0800 (PST)\r
+Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd6ml3no-ssvc.prod.shaw.ca)\r
+       ([10.0.144.222])\r
+       by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 15 Feb 2012 08:28:15 -0700\r
+X-Cloudmark-SP-Filtered: true\r
+X-Cloudmark-SP-Result: v=1.1 cv=gFGh1ScE7ROJHT2jhivHYaSHya8441O0LZB7wkhlVyo=\r
+       c=1 sm=1\r
+       a=GuGD3HYh8EwA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
+       a=7343-z1_AAAA:8 a=KPYzJtzO6UYUsjaoUWAA:9 a=1Gp0VBkJN0Nkp562nnIA:7\r
+       a=LeJ0sXklI-6OQo_M:21 a=QwJ6v9fs0PehMnJs:21\r
+       a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
+Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
+       by pd6ml3no-dmz.prod.shaw.ca with ESMTP; 15 Feb 2012 08:28:15 -0700\r
+Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
+       id E65CE800420A; Wed, 15 Feb 2012 08:28:14 -0700 (MST)\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Add the option of counting threads in notmuch-hello\r
+Date: Wed, 15 Feb 2012 08:28:08 -0700\r
+Message-Id: <1329319688-16056-1-git-send-email-awg+notmuch@xvx.ca>\r
+X-Mailer: git-send-email 1.7.5.4\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: Wed, 15 Feb 2012 15:28:20 -0000\r
+\r
+Add a customizable variable, notmuch-hello-count-threads, which when\r
+set causes notmuch-hello to display thread counts instead of message\r
+counts. The default remains message counts.\r
+---\r
+ emacs/notmuch-hello.el |   17 ++++++++++++++---\r
+ 1 files changed, 14 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index d17a30f..9bbf725 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -151,6 +151,11 @@ International Bureau of Weights and Measures."\r
+   :group 'notmuch-hello\r
+   :group 'notmuch-hooks)\r
+ \r
++(defcustom notmuch-hello-count-threads nil\r
++  "If non-nil, count threads instead of messages in `notmuch-hello'."\r
++  :type 'boolean\r
++  :group 'notmuch-hello)\r
++\r
+ (defvar notmuch-hello-url "http://notmuchmail.org"\r
+   "The `notmuch' web site.")\r
+ \r
+@@ -232,7 +237,9 @@ diagonal."\r
+                 nil nil #'notmuch-hello-search-continuation))\r
+ \r
+ (defun notmuch-saved-search-count (search)\r
+-  (car (process-lines notmuch-command "count" search)))\r
++  (if notmuch-hello-count-threads\r
++      (car (process-lines notmuch-command "count" "--output=threads" search))\r
++    (car (process-lines notmuch-command "count" search))))\r
+ \r
+ (defun notmuch-hello-tags-per-line (widest)\r
+   "Determine how many tags to show per line and how wide they\r
+@@ -453,8 +460,12 @@ Complete list of currently available key bindings:\r
+                              (notmuch-hello-update))\r
+                    :help-echo "Refresh"\r
+                    (notmuch-hello-nice-number\r
+-                    (string-to-number (car (process-lines notmuch-command "count")))))\r
+-      (widget-insert " messages.\n"))\r
++                    (if notmuch-hello-count-threads\r
++                        (string-to-number (car (process-lines notmuch-command "count" "--output=threads")))\r
++                      (string-to-number (car (process-lines notmuch-command "count"))))))\r
++      (if notmuch-hello-count-threads\r
++        (widget-insert " threads.\n")\r
++      (widget-insert " messages.\n")))\r
+ \r
+     (let ((found-target-pos nil)\r
+         (final-target-pos nil)\r
+-- \r
+1.7.5.4\r
+\r