Re: How does notmuch track mails?
[notmuch-archives.git] / 0b / 027057727dfe567ff50fa2cc466c38df7cea00
1 Return-Path: <felipe.contreras@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 64768431FAF\r
6         for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:03:54 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \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 u4j0GMEUADA6 for <notmuch@notmuchmail.org>;\r
17         Sat,  2 Nov 2013 07:03:49 -0700 (PDT)\r
18 Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com\r
19         [209.85.214.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 2FF24431FC3\r
22         for <notmuch@notmuchmail.org>; Sat,  2 Nov 2013 07:03:12 -0700 (PDT)\r
23 Received: by mail-ob0-f175.google.com with SMTP id wm4so5550809obc.6\r
24         for <notmuch@notmuchmail.org>; Sat, 02 Nov 2013 07:03:11 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
27         bh=r/du2J/bmZ2YJ8fGvUcMS5dYvOq/yYyH4PxNGmD8LBE=;\r
28         b=qk5wjgKjr81qIrDcX5UuBkofvMLt155yK1qad2FA6qtx/lW+p44QH/XTocEhS5FyFw\r
29         PRVIPtxSBph9h0zzmEvx2QElKnKeouq4l0MLEBGbiXIoF0QwKoeTMS4BMALYsY8HFGpo\r
30         sFXgtq+g55evIFRrMwBwH1eMWtGV2thHCIr+LjXYhuGckIQAj81EjnP1pgKotty2s993\r
31         QSJxVo6bAG0dJiqD+kQ+fJnnChU+oScvNyY1bB0dtWoVZYSi4vKRbLM8H1pAuNQjluou\r
32         VEkRnhgaQjaSShZZu0KdfDQiKZuRfE9tZHa6F90NEX4I7NgFZE22ZR7QEZUnRMFc/3Cn\r
33         RLiA==\r
34 X-Received: by 10.60.39.67 with SMTP id n3mr6441829oek.2.1383400991718;\r
35         Sat, 02 Nov 2013 07:03:11 -0700 (PDT)\r
36 Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241])\r
37         by mx.google.com with ESMTPSA id j9sm5189597oef.8.2013.11.02.07.03.10\r
38         for <multiple recipients>\r
39         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
40         Sat, 02 Nov 2013 07:03:10 -0700 (PDT)\r
41 From: Felipe Contreras <felipe.contreras@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 14/21] vim: add option to compose new messages\r
44 Date: Sat,  2 Nov 2013 07:55:47 -0600\r
45 Message-Id: <1383400554-1832-15-git-send-email-felipe.contreras@gmail.com>\r
46 X-Mailer: git-send-email 1.8.4.2+fc1\r
47 In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\r
48 References: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Sat, 02 Nov 2013 14:03:54 -0000\r
62 \r
63 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
64 ---\r
65  vim/notmuch.vim | 33 +++++++++++++++++++++++++++++++++\r
66  1 file changed, 33 insertions(+)\r
67 \r
68 diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
69 index 8383fd6..42c5f18 100644\r
70 --- a/vim/notmuch.vim\r
71 +++ b/vim/notmuch.vim\r
72 @@ -12,6 +12,7 @@ let g:notmuch_rb_folders_maps = {\r
73         \ '<Enter>':    'folders_show_search()',\r
74         \ 's':          'folders_search_prompt()',\r
75         \ '=':          'folders_refresh()',\r
76 +       \ 'c':          'compose()',\r
77         \ }\r
78  \r
79  let g:notmuch_rb_search_maps = {\r
80 @@ -24,6 +25,7 @@ let g:notmuch_rb_search_maps = {\r
81         \ 's':          'search_search_prompt()',\r
82         \ '=':          'search_refresh()',\r
83         \ '?':          'search_info()',\r
84 +       \ 'c':          'compose()',\r
85         \ }\r
86  \r
87  let g:notmuch_rb_show_maps = {\r
88 @@ -38,6 +40,7 @@ let g:notmuch_rb_show_maps = {\r
89         \ 'r':          'show_reply()',\r
90         \ '?':          'show_info()',\r
91         \ '<Tab>':      'show_next_msg()',\r
92 +       \ 'c':          'compose()',\r
93         \ }\r
94  \r
95  let g:notmuch_rb_compose_maps = {\r
96 @@ -148,6 +151,14 @@ function! s:show_reply()\r
97         startinsert!\r
98  endfunction\r
99  \r
100 +function! s:compose()\r
101 +       ruby open_compose\r
102 +       let b:compose_done = 0\r
103 +       call s:set_map(g:notmuch_rb_compose_maps)\r
104 +       autocmd BufUnload <buffer> call s:compose_unload()\r
105 +       startinsert!\r
106 +endfunction\r
107 +\r
108  function! s:show_info()\r
109         ruby vim_puts get_message.inspect\r
110  endfunction\r
111 @@ -578,6 +589,28 @@ ruby << EOF\r
112                 open_compose_helper(lines, cur)\r
113         end\r
114  \r
115 +       def open_compose()\r
116 +               lines = []\r
117 +\r
118 +               lines << "Date: #{Time.now().strftime('%a, %-d %b %Y %T %z')}"\r
119 +               lines << "From: #{$email}"\r
120 +               lines << "To: "\r
121 +               cur = lines.count\r
122 +\r
123 +               lines << "Cc: "\r
124 +               lines << "Bcc: "\r
125 +               lines << "Message-Id: #{generate_message_id}"\r
126 +               lines << "Subject: "\r
127 +               lines << "Mime-Version: 1.0"\r
128 +               lines << "Content-Type: text/plain; charset=utf-8"\r
129 +               lines << "Content-Transfer-Encoding: 7bit"\r
130 +               lines << ""\r
131 +               lines << ""\r
132 +               lines << ""\r
133 +\r
134 +               open_compose_helper(lines, cur)\r
135 +       end\r
136 +\r
137         def folders_render()\r
138                 $curbuf.render do |b|\r
139                         folders = VIM::evaluate('g:notmuch_rb_folders')\r
140 -- \r
141 1.8.4.2+fc1\r
142 \r