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