Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / ad / c981cb264155b4a433e7b3174b3b05c9b0b8fc
1 Return-Path: <imain@redhat.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 861E5431FB6\r
6         for <notmuch@notmuchmail.org>; Tue, 14 Oct 2014 10:32:37 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\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 w8HVTZaooOT4 for <notmuch@notmuchmail.org>;\r
16         Tue, 14 Oct 2014 10:32:31 -0700 (PDT)\r
17 Received: from cmta7.telus.net (cmta7.telus.net [209.171.16.80])\r
18         by olra.theworths.org (Postfix) with ESMTP id 70FC4431FAF\r
19         for <notmuch@notmuchmail.org>; Tue, 14 Oct 2014 10:32:31 -0700 (PDT)\r
20 Received: from ovo.mains.priv ([207.102.88.62]) by cmta7.telus.net with TELUS\r
21         id 35YV1p00B1LiWEf015YV4q; Tue, 14 Oct 2014 11:32:30 -0600\r
22 X-Authority-Analysis: v=2.0 cv=TdpIQ2sh c=1 sm=2\r
23         a=EcQDfIwDZEqJA1f7rVUV8Q==:17 a=S-IsBHyFrF4A:10 a=IkcTkHD0fZMA:10\r
24         a=tsa3CZZnAAAA:8 a=7343-z1_AAAA:8 a=7bbuMW5nppRtDaXMQKkA:9\r
25         a=QEXdDO2ut3YA:10\r
26         a=P87eogJZi2UA:10 a=0c-eHkXYtrgA:10 a=EcQDfIwDZEqJA1f7rVUV8Q==:117\r
27 X-Telus-Outbound-IP: 207.102.88.62\r
28 Received: from ovo.mains.priv (localhost.localdomain [127.0.0.1])\r
29         by ovo.mains.priv (8.14.8/8.14.8) with ESMTP id s9EHWQa2023228;\r
30         Tue, 14 Oct 2014 10:32:28 -0700\r
31 Received: (from imain@localhost)\r
32         by ovo.mains.priv (8.14.8/8.14.8/Submit) id s9EHWPuP023227;\r
33         Tue, 14 Oct 2014 10:32:25 -0700\r
34 X-Authentication-Warning: ovo.mains.priv: imain set sender to imain@redhat.com\r
35         using -f\r
36 Date: Tue, 14 Oct 2014 10:32:25 -0700\r
37 From: Ian Main <imain@stemwinder.org>\r
38 To: Franz Fellner <alpine.art.de@gmail.com>\r
39 Message-ID: <543d5e2927b41_5918e8fe90f4@ovo.mains.priv.notmuch>\r
40 In-Reply-To: <20141014154535.GJ23373@TP_L520.localdomain>\r
41 References: <1412617904-27252-1-git-send-email-imain@stemwinder.org>\r
42         <1412619036-29203-1-git-send-email-imain@stemwinder.org>\r
43         <20141014154535.GJ23373@TP_L520.localdomain>\r
44 Subject: Re: [PATCH] VIM: Make an option to save sent mail locally\r
45 Mime-Version: 1.0\r
46 Content-Type: text/plain;\r
47  charset=utf-8\r
48 Content-Transfer-Encoding: 7bit\r
49 Cc: notmuch@notmuchmail.org\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Tue, 14 Oct 2014 17:32:37 -0000\r
63 \r
64 Franz Fellner wrote:\r
65 > Why not simply use Notmuch::Database.add_message? Would save a\r
66 > system-call.\r
67 > One could easily copy the sent mail into nm_db_path/sent/cur, add it to the db, tag it.\r
68 > Though I don't know enough about maildir handling, but probably rubys\r
69 > Mail module could help here.\r
70 \r
71 So you are saying I'd have to copy the message to the database and then call\r
72 Notmuch::Database.add_message()?  If so I think I'd rather stick with the\r
73 system call..\r
74 \r
75 > Another issue is configuration. Hardcoding "Sent" probably won't fit\r
76 > everyones needs. And (if I understand DOCS correctly) db.add_message\r
77 > doesn't even force you to keep sent mail folder inside db_path; correct\r
78 > me if I'm wrong :) notmuch --insert will put it into folder relative to\r
79 > db_path.\r
80 \r
81 Yeah, I can add it so the folder can be changed.  I figured this was just the\r
82 start of things.  Really we should be able to fcc it to our upstream provider\r
83 sent mailbox too.\r
84 \r
85 The notmuch --insert with --create-folder takes care of making sure the folder\r
86 exists locally.  I think this is why using the CLI is pretty compelling.  You\r
87 know it will do the right thing.\r
88 \r
89 > All in all the feature and the the rest of your work is very much\r
90 > appreciated!\r
91 >\r
92 > Franz\r
93 \r
94 Thanks for the review Franz!  I'll do another round of patch fixing soon I'm sure.\r
95 \r
96     Ian\r
97 \r
98 > On Mon,  6 Oct 2014 11:10:36 -0700, Ian Main <imain@stemwinder.org> wrote:\r
99 > > Add an option to use 'notmuch insert' to save your sent mail.\r
100 > > ---\r
101 > > \r
102 > > Add -inbox as well.\r
103 > > \r
104 > >  vim/notmuch.vim | 17 +++++++++++++++++\r
105 > >  1 file changed, 17 insertions(+)\r
106 > > \r
107 > > diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
108 > > index 331e930..a9044c4 100644\r
109 > > --- a/vim/notmuch.vim\r
110 > > +++ b/vim/notmuch.vim\r
111 > > @@ -58,6 +58,7 @@ let s:notmuch_date_format_default = '%d.%m.%y'\r
112 > >  let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'\r
113 > >  let s:notmuch_reader_default = 'mutt -f %s'\r
114 > >  let s:notmuch_sendmail_default = 'sendmail'\r
115 > > +let s:notmuch_save_sent_locally_default = 1\r
116 > >  let s:notmuch_folders_count_threads_default = 0\r
117 > >  \r
118 > >  function! s:new_file_buffer(type, fname)\r
119 > > @@ -108,6 +109,18 @@ EOF\r
120 > >             echohl None\r
121 > >             return\r
122 > >     endif\r
123 > > +\r
124 > > +   if g:notmuch_save_sent_locally\r
125 > > +           let out = system('cat ' . fname . ' | notmuch insert --create-folder --folder=Sent +sent -unread -inbox')\r
126 > > +           let err = v:shell_error\r
127 > > +           if err\r
128 > > +                   echohl Error\r
129 > > +                   echo 'Eeek! unable to save sent mail'\r
130 > > +                   echo out\r
131 > > +                   echohl None\r
132 > > +                   return\r
133 > > +           endif\r
134 > > +   endif\r
135 > >     call delete(fname)\r
136 > >     echo 'Mail sent successfully.'\r
137 > >     call s:kill_this_buffer()\r
138 > > @@ -388,6 +401,10 @@ endfunction\r
139 > >  "" root\r
140 > >  \r
141 > >  function! s:set_defaults()\r
142 > > +   if !exists('g:notmuch_save_sent_locally')\r
143 > > +           let g:notmuch_save_sent_locally = s:notmuch_save_sent_locally_default\r
144 > > +   endif\r
145 > > +\r
146 > >     if !exists('g:notmuch_date_format')\r
147 > >             if exists('g:notmuch_rb_date_format')\r
148 > >                     let g:notmuch_date_format = g:notmuch_rb_date_format\r
149 > > -- \r
150 > > 1.9.3\r
151 > > \r
152 > > _______________________________________________\r
153 > > notmuch mailing list\r
154 > > notmuch@notmuchmail.org\r
155 > > http://notmuchmail.org/mailman/listinfo/notmuch\r
156 \r
157 \r