Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / c9 / 7c72f132d90273dda88f00ec3c60527b6960f9
1 Return-Path: <m.walters@qmul.ac.uk>\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 41000431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 16 Apr 2012 09:02:25 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 mXFOOorU5EBg for <notmuch@notmuchmail.org>;\r
17         Mon, 16 Apr 2012 09:02:23 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 19E05431FAE\r
22         for <notmuch@notmuchmail.org>; Mon, 16 Apr 2012 09:02:23 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1SJoNe-0003iz-0Y; Mon, 16 Apr 2012 17:02:20 +0100\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1SJoNd-0005ct-IM; Mon, 16 Apr 2012 17:02:17 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH 2/3] new: Handle fatal errors in remove_filename and\r
35         _remove_directory\r
36 In-Reply-To: <1330357759-1337-3-git-send-email-amdragon@mit.edu>\r
37 References: <1330357759-1337-1-git-send-email-amdragon@mit.edu>\r
38         <1330357759-1337-3-git-send-email-amdragon@mit.edu>\r
39 User-Agent: Notmuch/0.12+110~gbc97b4a (http://notmuchmail.org) Emacs/23.3.1\r
40         (x86_64-pc-linux-gnu)\r
41 Date: Mon, 16 Apr 2012 17:02:37 +0100\r
42 Message-ID: <87wr5f4qci.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 94.192.233.223\r
46 X-QM-SPAM-Info: Sender has good ham record.  :)\r
47 X-QM-Body-MD5: 5eaeadecc221fe0613c546ee760dc5a3 (of first 20000 bytes)\r
48 X-SpamAssassin-Score: -1.8\r
49 X-SpamAssassin-SpamBar: -\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
51         determine if it is\r
52         spam. We require at least 5.0 points to mark a message as spam.\r
53         This message scored -1.8 points.\r
54         Summary of the scoring: \r
55         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
56         *      medium trust\r
57         *      [138.37.6.40 listed in list.dnswl.org]\r
58         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
59         provider *      (markwalters1009[at]gmail.com)\r
60         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
61         *      domain\r
62         *  0.5 AWL AWL: From: address is in the auto white-list\r
63 X-QM-Scan-Virus: ClamAV says the message is clean\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Mon, 16 Apr 2012 16:02:25 -0000\r
77 \r
78 On Mon, 27 Feb 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
79 > Previously such errors were simply ignored.  Now they cause an\r
80 > immediate cleanup and abort.\r
81 \r
82 This one looks fine except for a minor query.\r
83 \r
84 > ---\r
85 >  notmuch-new.c |   24 ++++++++++++++++++------\r
86 >  1 files changed, 18 insertions(+), 6 deletions(-)\r
87 >\r
88 > diff --git a/notmuch-new.c b/notmuch-new.c\r
89 > index bd9786a..0cbd479 100644\r
90 > --- a/notmuch-new.c\r
91 > +++ b/notmuch-new.c\r
92 > @@ -780,8 +780,10 @@ remove_filename (notmuch_database_t *notmuch,\r
93 >       add_files_state->renamed_messages++;\r
94 >       if (add_files_state->synchronize_flags == TRUE)\r
95 >           notmuch_message_maildir_flags_to_tags (message);\r
96 > -    } else\r
97 > +     status = NOTMUCH_STATUS_SUCCESS;\r
98 > +    } else if (status == NOTMUCH_STATUS_SUCCESS) {\r
99 >       add_files_state->removed_messages++;\r
100 > +    }\r
101 >      notmuch_message_destroy (message);\r
102 >      notmuch_database_end_atomic (notmuch);\r
103 >      return status;\r
104 > @@ -789,12 +791,13 @@ remove_filename (notmuch_database_t *notmuch,\r
105 >  \r
106 >  /* Recursively remove all filenames from the database referring to\r
107 >   * 'path' (or to any of its children). */\r
108 > -static void\r
109 > +static notmuch_status_t\r
110 >  _remove_directory (void *ctx,\r
111 >                  notmuch_database_t *notmuch,\r
112 >                  const char *path,\r
113 >                  add_files_state_t *add_files_state)\r
114 >  {\r
115 > +    notmuch_status_t status;\r
116 >      notmuch_directory_t *directory;\r
117 >      notmuch_filenames_t *files, *subdirs;\r
118 >      char *absolute;\r
119 > @@ -807,8 +810,10 @@ _remove_directory (void *ctx,\r
120 >      {\r
121 >       absolute = talloc_asprintf (ctx, "%s/%s", path,\r
122 >                                   notmuch_filenames_get (files));\r
123 > -     remove_filename (notmuch, absolute, add_files_state);\r
124 > +     status = remove_filename (notmuch, absolute, add_files_state);\r
125 >       talloc_free (absolute);\r
126 > +     if (status)\r
127 > +         return status;\r
128 >      }\r
129 >  \r
130 >      for (subdirs = notmuch_directory_get_child_directories (directory);\r
131 > @@ -817,11 +822,14 @@ _remove_directory (void *ctx,\r
132 >      {\r
133 >       absolute = talloc_asprintf (ctx, "%s/%s", path,\r
134 >                                   notmuch_filenames_get (subdirs));\r
135 > -     _remove_directory (ctx, notmuch, absolute, add_files_state);\r
136 > +     status = _remove_directory (ctx, notmuch, absolute, add_files_state);\r
137 >       talloc_free (absolute);\r
138 > +     if (status)\r
139 > +         return status;\r
140 >      }\r
141 >  \r
142 >      notmuch_directory_destroy (directory);\r
143 > +    return NOTMUCH_STATUS_SUCCESS;\r
144 >  }\r
145 \r
146 In the two "return status" lines above seem to mean we don't call\r
147 notmuch_directory_destroy. Does that matter?\r
148 \r
149 The other query is not actually about this patch: just something that\r
150 came up when reading it. Should notmuch_database_begin_atomic and\r
151 notmuch_database_end_atomic always be paired? One of the (existing)\r
152 error cases in remove_filename seems to return without calling end.\r
153 \r
154 Best wishes\r
155 \r
156 Mark\r
157 \r
158 >  int\r
159 > @@ -939,7 +947,9 @@ notmuch_new_command (void *ctx, int argc, char *argv[])\r
160 >  \r
161 >      gettimeofday (&tv_start, NULL);\r
162 >      for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) {\r
163 > -     remove_filename (notmuch, f->filename, &add_files_state);\r
164 > +     ret = remove_filename (notmuch, f->filename, &add_files_state);\r
165 > +     if (ret)\r
166 > +         goto DONE;\r
167 >       if (do_print_progress) {\r
168 >           do_print_progress = 0;\r
169 >           generic_print_progress ("Cleaned up", "messages",\r
170 > @@ -950,7 +960,9 @@ notmuch_new_command (void *ctx, int argc, char *argv[])\r
171 >  \r
172 >      gettimeofday (&tv_start, NULL);\r
173 >      for (f = add_files_state.removed_directories->head, i = 0; f && !interrupted; f = f->next, i++) {\r
174 > -     _remove_directory (ctx, notmuch, f->filename, &add_files_state);\r
175 > +     ret = _remove_directory (ctx, notmuch, f->filename, &add_files_state);\r
176 > +     if (ret)\r
177 > +         goto DONE;\r
178 >       if (do_print_progress) {\r
179 >           do_print_progress = 0;\r
180 >           generic_print_progress ("Cleaned up", "directories",\r
181 > -- \r
182 > 1.7.7.3\r
183 >\r
184 > _______________________________________________\r
185 > notmuch mailing list\r
186 > notmuch@notmuchmail.org\r
187 > http://notmuchmail.org/mailman/listinfo/notmuch\r