[PATCH 4/7] Use notmuch_database_destroy instead of notmuch_database_close
[notmuch-archives.git] / 0a / b7367bf58ac87a5219e8a91b10eab90ac7906c
1 Return-Path: <amdragon@mit.edu>\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 E410B431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:59:29 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 0JFMskQZueQX for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 14:59:29 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4BA94431FAE\r
20         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:59:29 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fad6d000000920-d7-4f18a050a176\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id D9.05.02336.050A81F4; Thu, 19 Jan 2012 17:59:29 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0JMxSwt030607; \r
27         Thu, 19 Jan 2012 17:59:28 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0JMxR1x020507\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 19 Jan 2012 17:59:28 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1Ro0wo-0004N4-1c; Thu, 19 Jan 2012 17:59:10 -0500\r
37 Date: Thu, 19 Jan 2012 17:59:10 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH] Automatically exclude tags in notmuch-show\r
41 Message-ID: <20120119225910.GT16740@mit.edu>\r
42 References: <874nvric7c.fsf@qmul.ac.uk>\r
43         <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT0Q1cIOFv8NbZYvVcHovrN2cyOzB5\r
51         7Jx1l93j2apbzAFMUVw2Kak5mWWpRfp2CVwZC5b+Yy9o4q/4/8mzgfEGdxcjJ4eEgInEo9ZX\r
52         jBC2mMSFe+vZuhi5OIQE9jFKTD0zA8rZwCixdGc3lHOSSeLsuvmMEM4SRolZ72cxg/SzCKhK\r
53         tD1fwwpiswloSGzbvxxsroiAjsTtQwvYQWxmAWmJb7+bmUBsYQF7iclLF4P18gLV3DnRydLF\r
54         yAE0NF3i9ANniLCgxMmZT1ggWrUkbvx7yQRSAjJm+T8OkDCngJfEmtYpYFtFBVQkppzcxjaB\r
55         UWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuol5tZopeaUrqJERTQnJI8\r
56         OxjfHFQ6xCjAwajEw8vlKuEvxJpYVlyZe4hRkoNJSZR303ygEF9SfkplRmJxRnxRaU5q8SFG\r
57         CQ5mJRHehj6gHG9KYmVValE+TEqag0VJnFdF650f0LuJJanZqakFqUUwWRkODiUJXieQoYJF\r
58         qempFWmZOSUIaSYOTpDhPEDD14DU8BYXJOYWZ6ZD5E8x6nJ8+d12nlGIJS8/L1VKnLcXpEgA\r
59         pCijNA9uDiwRvWIUB3pLmHc1SBUPMInBTXoFtIQJaIlHkxjIkpJEhJRUAyNfcda0yoodBi/Z\r
60         wr78uFYnO9F9W8SfU29j/5RPPLZM7n61QG216Dzb2Ztm/Lb+FfnlU/x/5cXp90MbEuVXGa+r\r
61         ruo01xJ1uqvwec32H193JO0vjRZ8d/bGDUvFYm+dcy7LvBuijLeapc2f9/R/k0OIcOP5PUZH\r
62         vQqdQsOvVGyS9NyzyophdY0SS3FGoqEWc1FxIgCB5IqFHwMAAA==\r
63 Cc: notmuch@notmuchmail.org\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: Thu, 19 Jan 2012 22:59:30 -0000\r
77 \r
78 LGTM, but should definitely come with a test.\r
79 \r
80 Also, this won't commute with Pieter's patch\r
81 (id:"1327000744-25463-2-git-send-email-pieter@praet.org"), so one or\r
82 the other will have to get updated.\r
83 \r
84 Quoth Mark Walters on Jan 19 at 10:03 pm:\r
85 > Add the use of auto_exclude_tags in notmuch-show.c.  As with Austin's\r
86 > patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds\r
87 > the excluded tags to the query so the excluded messages will still\r
88 > appear in the emacs interface, but as a single header line rather than\r
89 > as a matching message.\r
90 > ---\r
91 >  notmuch-show.c |    8 ++++++++\r
92 >  1 files changed, 8 insertions(+), 0 deletions(-)\r
93\r
94 > diff --git a/notmuch-show.c b/notmuch-show.c\r
95 > index d14dac9..925dfd6 100644\r
96 > --- a/notmuch-show.c\r
97 > +++ b/notmuch-show.c\r
98 > @@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
99 >      char *opt;\r
100 >      const notmuch_show_format_t *format = &format_text;\r
101 >      notmuch_show_params_t params;\r
102 > +    const char **auto_exclude_tags;\r
103 > +    size_t auto_exclude_tags_length;\r
104 >      int mbox = 0;\r
105 >      int format_specified = 0;\r
106 >      int i;\r
107 > +    unsigned int j;\r
108 \r
109 Hah.  The original patch series updated 'count' to use the new\r
110 argument parsing solely so I could steal 'i' for the tag exclude code.\r
111 \r
112 >  \r
113 >      params.entire_thread = 0;\r
114 >      params.raw = 0;\r
115 > @@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
116 >       return 1;\r
117 >      }\r
118 >  \r
119 > +    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
120 > +        (config, &auto_exclude_tags_length);\r
121 > +    for (j = 0; j < auto_exclude_tags_length; j++)\r
122 > +        notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]);\r
123 > +\r
124 >      /* if part was requested and format was not specified, use format=raw */\r
125 >      if (params.part >= 0 && !format_specified)\r
126 >       format = &format_raw;\r