1 Return-Path: <alpine.art.de@gmail.com>
\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 B6F1F431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 18 Oct 2014 13:31:50 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id KRw8hCgx9K-M for <notmuch@notmuchmail.org>;
\r
17 Sat, 18 Oct 2014 13:31:43 -0700 (PDT)
\r
18 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com
\r
19 [74.125.82.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 50356431FB6 for <notmuch@notmuchmail.org>; Sat, 18 Oct 2014 13:31:43 -0700
\r
23 Received: by mail-wg0-f43.google.com with SMTP id m15so2996051wgh.14
\r
24 for <notmuch@notmuchmail.org>; Sat, 18 Oct 2014 13:31:42 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=date:from:to:message-id:in-reply-to:references:subject:mime-version
\r
27 :content-type:content-transfer-encoding;
\r
28 bh=yBT4SoiHm0D4+jzcJQUVtX7Dko8VjUf6R1T++zwnev0=;
\r
29 b=V0lvmy+KJGwHFSQqpQRAXiD9nR6JmWGW+MZZoJjzUj8BT5pS1m9X5Re6o9hxkr2a4r
\r
30 Gi8aWJy3us7WZatLK3q874Z1y/j4ez+bhpD4A6CCPIFl7FQy/41JK2QGeKy9mXdX7CnP
\r
31 IBK/il0K5DzdW0UJbCv6jb/L3L3sCHxBE7b0lCPIubwu4FzaLekrxAeYb8GYxiRgx2oS
\r
32 sKBbuK0e6DG3BLqnkSjW0o5VZMtzra/nD3YhApS++FvltblWB18oVtOqFmOT3oF6aaFk
\r
33 26+AFTVgZUBKC4MXlylL0Vmu6PjiTY/MNZv73OIBhpM1pJWKErq9KvMJDI0iJEF59QQo
\r
35 X-Received: by 10.180.101.102 with SMTP id ff6mr8398485wib.34.1413664302216;
\r
36 Sat, 18 Oct 2014 13:31:42 -0700 (PDT)
\r
37 Received: from localhost (p5B00C687.dip0.t-ipconnect.de. [91.0.198.135])
\r
38 by mx.google.com with ESMTPSA id yr9sm6158028wjc.31.2014.10.18.13.31.40
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 18 Oct 2014 13:31:41 -0700 (PDT)
\r
42 Date: Sat, 18 Oct 2014 22:31:52 +0200
\r
43 From: Franz Fellner <alpine.art.de@gmail.com>
\r
44 To: Ian Main <imain@stemwinder.org>, Ian Main <imain@stemwinder.org>,
\r
45 notmuch@notmuchmail.org
\r
46 Message-ID: <5442ce38e11bf_255f136de9416@TP_L520.notmuch>
\r
47 In-Reply-To: <1412621414-31793-1-git-send-email-imain@stemwinder.org>
\r
48 References: <1412621414-31793-1-git-send-email-imain@stemwinder.org>
\r
49 Subject: RE: [PATCH] VIM: Improve search list
\r
51 Content-Type: text/plain;
\r
53 Content-Transfer-Encoding: 7bit
\r
54 X-BeenThere: notmuch@notmuchmail.org
\r
55 X-Mailman-Version: 2.1.13
\r
57 List-Id: "Use and development of the notmuch mail system."
\r
58 <notmuch.notmuchmail.org>
\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
62 List-Post: <mailto:notmuch@notmuchmail.org>
\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
66 X-List-Received-Date: Sat, 18 Oct 2014 20:31:50 -0000
\r
73 > Make the width of the search name column expand/contract with the
\r
74 > length of the longest search name string.
\r
76 > Fix syntax highlighting to make the above work right.
\r
78 > Add the ability to use a blank search pattern to create a spacer
\r
79 > to break up searches into groups.
\r
81 > vim/notmuch.txt | 4 ++++
\r
82 > vim/notmuch.vim | 16 ++++++++++++++--
\r
83 > vim/syntax/notmuch-folders.vim | 2 +-
\r
84 > 3 files changed, 19 insertions(+), 3 deletions(-)
\r
86 > diff --git a/vim/notmuch.txt b/vim/notmuch.txt
\r
87 > index 4374102..3a73912 100644
\r
88 > --- a/vim/notmuch.txt
\r
89 > +++ b/vim/notmuch.txt
\r
90 > @@ -94,11 +94,15 @@ You can add the following configurations to your `.vimrc`, or
\r
91 > *g:notmuch_folders*
\r
93 > The first thing you might want to do is set your custom searches.
\r
95 > +Adding an empty set of strings results in a blank line which allows you
\r
96 > +to break up searches into groups.
\r
98 > let g:notmuch_folders = [
\r
99 > \ [ 'new', 'tag:inbox and tag:unread' ],
\r
100 > \ [ 'inbox', 'tag:inbox' ],
\r
101 > \ [ 'unread', 'tag:unread' ],
\r
103 > \ [ 'to-do', 'tag:to-do' ],
\r
104 > \ [ 'to-me', 'to:john.doe and tag:new' ],
\r
106 > diff --git a/vim/notmuch.vim b/vim/notmuch.vim
\r
107 > index 331e930..61a7260 100644
\r
108 > --- a/vim/notmuch.vim
\r
109 > +++ b/vim/notmuch.vim
\r
110 > @@ -374,7 +374,9 @@ function! s:folders_show_search()
\r
112 > n = $curbuf.line_number
\r
113 > s = $searches[n - 1]
\r
114 > - VIM::command("call s:search('#{s}')")
\r
115 > + if s.length > 0
\r
116 > + VIM::command("call s:search('#{s}')")
\r
121 > @@ -633,11 +635,21 @@ ruby << EOF
\r
122 > folders = VIM::evaluate('g:notmuch_folders')
\r
123 > count_threads = VIM::evaluate('g:notmuch_folders_count_threads') == 1
\r
125 > + longest_name = 0
\r
126 > + folders.each do |name, search|
\r
127 > + if name.length > longest_name
\r
128 > + longest_name = name.length
\r
131 > folders.each do |name, search|
\r
132 > q = $curbuf.query(search)
\r
133 > $searches << search
\r
134 > count = count_threads ? q.search_threads.count : q.search_messages.count
\r
135 > - b << "%9d %-20s (%s)" % [count, name, search]
\r
139 > + b << "%9d %-#{longest_name + 1}s (%s)" % [count, name, search]
\r
144 > diff --git a/vim/syntax/notmuch-folders.vim b/vim/syntax/notmuch-folders.vim
\r
145 > index 9477f86..03209c1 100644
\r
146 > --- a/vim/syntax/notmuch-folders.vim
\r
147 > +++ b/vim/syntax/notmuch-folders.vim
\r
149 > " notmuch folders mode syntax file
\r
151 > syntax region nmFoldersCount start='^' end='\%10v'
\r
152 > -syntax region nmFoldersName start='\%11v' end='\%31v'
\r
153 > +syntax region nmFoldersName start='\%11v' end=' ('me=e-1
\r
154 > syntax match nmFoldersSearch /([^()]\+)$/
\r
156 > highlight link nmFoldersCount Statement
\r
160 > _______________________________________________
\r
161 > notmuch mailing list
\r
162 > notmuch@notmuchmail.org
\r
163 > http://notmuchmail.org/mailman/listinfo/notmuch
\r