From f1fe5aab6c06fa36f1f61fe99e892ad72f445f0e Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Mon, 28 Jan 2013 17:52:19 +0200 Subject: [PATCH] [PATCH 4/5] Introduce g:notmuch_rb_folders_count_threads --- 6e/9b6e7d93fc3668113bd49b395c1104ae18dc44 | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 6e/9b6e7d93fc3668113bd49b395c1104ae18dc44 diff --git a/6e/9b6e7d93fc3668113bd49b395c1104ae18dc44 b/6e/9b6e7d93fc3668113bd49b395c1104ae18dc44 new file mode 100644 index 000000000..ea1b491cf --- /dev/null +++ b/6e/9b6e7d93fc3668113bd49b395c1104ae18dc44 @@ -0,0 +1,96 @@ +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 7623E431FAE + for ; Mon, 28 Jan 2013 07:57:09 -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 dQR6ynY4rYJk for ; + Mon, 28 Jan 2013 07:57:08 -0800 (PST) +Received: from shutemov.name (shutemov.name [204.155.152.216]) + by olra.theworths.org (Postfix) with ESMTP id 231CB431FB6 + for ; Mon, 28 Jan 2013 07:57:08 -0800 (PST) +Received: by shutemov.name (Postfix, from userid 1000) + id 4342E333DC; Mon, 28 Jan 2013 17:52:25 +0200 (EET) +From: "Kirill A. Shutemov" +To: Felipe Contreras +Subject: [PATCH 4/5] Introduce g:notmuch_rb_folders_count_threads +Date: Mon, 28 Jan 2013 17:52:19 +0200 +Message-Id: <1359388340-27136-5-git-send-email-kirill@shutemov.name> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1359388340-27136-1-git-send-email-kirill@shutemov.name> +References: <1359388340-27136-1-git-send-email-kirill@shutemov.name> +Cc: notmuch@notmuchmail.org +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: Mon, 28 Jan 2013 15:57:09 -0000 + +From: "Kirill A. Shutemov" + +If the option set, folders list shows count of threads, not messages + +Signed-off-by: Kirill A. Shutemov +--- + notmuch-ruby.vim | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/notmuch-ruby.vim b/notmuch-ruby.vim +index 81da9b3..cda5df4 100644 +--- a/notmuch-ruby.vim ++++ b/notmuch-ruby.vim +@@ -53,6 +53,7 @@ let s:notmuch_rb_date_format_default = '%d.%m.%y' + let s:notmuch_rb_datetime_format_default = '%d.%m.%y %H:%M:%S' + let s:notmuch_rb_reader_default = 'terminal -e "mutt -f %s"' + let s:notmuch_rb_sendmail_default = '/usr/sbin/sendmail' ++let s:notmuch_rb_folders_count_threads_default = 0 + + if !exists('g:notmuch_rb_date_format') + let g:notmuch_rb_date_format = s:notmuch_rb_date_format_default +@@ -70,6 +71,10 @@ if !exists('g:notmuch_rb_sendmail') + let g:notmuch_rb_sendmail = s:notmuch_rb_sendmail_default + endif + ++if !exists('g:notmuch_rb_folders_count_threads') ++ let g:notmuch_rb_folders_count_threads = s:notmuch_rb_folders_count_threads_default ++endif ++ + function! s:new_file_buffer(type, fname) + exec printf('edit %s', a:fname) + execute printf('set filetype=notmuch-%s', a:type) +@@ -536,12 +541,15 @@ ruby << EOF + def folders_render() + $curbuf.render do |b| + folders = VIM::evaluate('g:notmuch_rb_folders') ++ count_threads = VIM::evaluate('g:notmuch_rb_folders_count_threads') + $searches.clear + do_read do |db| + folders.each do |name, search| + q = db.query(search) + $searches << search +- b << "%9d %-20s (%s)" % [q.search_messages.count, name, search] ++ count = count_threads == 0 ? ++ q.search_messages.count : q.search_threads.count ++ b << "%9d %-20s (%s)" % [count, name, search] + end + end + end +-- +1.7.10.4 + -- 2.26.2