1 Return-Path: <awg@lagos.xvx.ca>
\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 4694E431E82
\r
6 for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 07:28:20 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 b3ZihutUlTxE for <notmuch@notmuchmail.org>;
\r
16 Wed, 15 Feb 2012 07:28:16 -0800 (PST)
\r
17 Received: from smtp-out-04.shaw.ca (smtp-out-04.shaw.ca [64.59.134.12])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 38C5C431E62
\r
19 for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 07:28:16 -0800 (PST)
\r
20 Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd6ml3no-ssvc.prod.shaw.ca)
\r
22 by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 15 Feb 2012 08:28:15 -0700
\r
23 X-Cloudmark-SP-Filtered: true
\r
24 X-Cloudmark-SP-Result: v=1.1 cv=gFGh1ScE7ROJHT2jhivHYaSHya8441O0LZB7wkhlVyo=
\r
26 a=GuGD3HYh8EwA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17
\r
27 a=7343-z1_AAAA:8 a=KPYzJtzO6UYUsjaoUWAA:9 a=1Gp0VBkJN0Nkp562nnIA:7
\r
28 a=LeJ0sXklI-6OQo_M:21 a=QwJ6v9fs0PehMnJs:21
\r
29 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
\r
30 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])
\r
31 by pd6ml3no-dmz.prod.shaw.ca with ESMTP; 15 Feb 2012 08:28:15 -0700
\r
32 Received: by lagos.xvx.ca (Postfix, from userid 1000)
\r
33 id E65CE800420A; Wed, 15 Feb 2012 08:28:14 -0700 (MST)
\r
34 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH] emacs: Add the option of counting threads in notmuch-hello
\r
37 Date: Wed, 15 Feb 2012 08:28:08 -0700
\r
38 Message-Id: <1329319688-16056-1-git-send-email-awg+notmuch@xvx.ca>
\r
39 X-Mailer: git-send-email 1.7.5.4
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Wed, 15 Feb 2012 15:28:20 -0000
\r
54 Add a customizable variable, notmuch-hello-count-threads, which when
\r
55 set causes notmuch-hello to display thread counts instead of message
\r
56 counts. The default remains message counts.
\r
58 emacs/notmuch-hello.el | 17 ++++++++++++++---
\r
59 1 files changed, 14 insertions(+), 3 deletions(-)
\r
61 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
62 index d17a30f..9bbf725 100644
\r
63 --- a/emacs/notmuch-hello.el
\r
64 +++ b/emacs/notmuch-hello.el
\r
65 @@ -151,6 +151,11 @@ International Bureau of Weights and Measures."
\r
66 :group 'notmuch-hello
\r
67 :group 'notmuch-hooks)
\r
69 +(defcustom notmuch-hello-count-threads nil
\r
70 + "If non-nil, count threads instead of messages in `notmuch-hello'."
\r
72 + :group 'notmuch-hello)
\r
74 (defvar notmuch-hello-url "http://notmuchmail.org"
\r
75 "The `notmuch' web site.")
\r
77 @@ -232,7 +237,9 @@ diagonal."
\r
78 nil nil #'notmuch-hello-search-continuation))
\r
80 (defun notmuch-saved-search-count (search)
\r
81 - (car (process-lines notmuch-command "count" search)))
\r
82 + (if notmuch-hello-count-threads
\r
83 + (car (process-lines notmuch-command "count" "--output=threads" search))
\r
84 + (car (process-lines notmuch-command "count" search))))
\r
86 (defun notmuch-hello-tags-per-line (widest)
\r
87 "Determine how many tags to show per line and how wide they
\r
88 @@ -453,8 +460,12 @@ Complete list of currently available key bindings:
\r
89 (notmuch-hello-update))
\r
90 :help-echo "Refresh"
\r
91 (notmuch-hello-nice-number
\r
92 - (string-to-number (car (process-lines notmuch-command "count")))))
\r
93 - (widget-insert " messages.\n"))
\r
94 + (if notmuch-hello-count-threads
\r
95 + (string-to-number (car (process-lines notmuch-command "count" "--output=threads")))
\r
96 + (string-to-number (car (process-lines notmuch-command "count"))))))
\r
97 + (if notmuch-hello-count-threads
\r
98 + (widget-insert " threads.\n")
\r
99 + (widget-insert " messages.\n")))
\r
101 (let ((found-target-pos nil)
\r
102 (final-target-pos nil)
\r