Re: [PATCH] Automatically exclude tags in notmuch-show
[notmuch-archives.git] / be / f931bccecb978b935c60344fd12cc85e2ea278
1 Return-Path: <pieter@praet.org>\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 0A347431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:31 -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 TsPonQAoTfu2 for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 15:56:30 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 44BDE431FAE\r
21         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:30 -0800 (PST)\r
22 Received: by wibhr12 with SMTP id hr12so3989wib.26\r
23         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:29 -0800 (PST)\r
24 Received: by 10.180.101.164 with SMTP id fh4mr8122493wib.0.1327017389038;\r
25         Thu, 19 Jan 2012 15:56:29 -0800 (PST)\r
26 Received: from localhost ([109.131.97.13])\r
27         by mx.google.com with ESMTPS id l8sm3103914wiy.5.2012.01.19.15.56.28\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Thu, 19 Jan 2012 15:56:28 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Austin Clements <amdragon@MIT.EDU>,\r
32         Mark Walters <markwalters1009@gmail.com>\r
33 Subject: Re: [PATCH] Automatically exclude tags in notmuch-show\r
34 In-Reply-To: <20120119225910.GT16740@mit.edu>\r
35 References: <874nvric7c.fsf@qmul.ac.uk>\r
36         <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
37         <20120119225910.GT16740@mit.edu>\r
38 User-Agent: Notmuch/0.11+99~gab86e73 (http://notmuchmail.org) Emacs/23.3.1\r
39         (x86_64-unknown-linux-gnu)\r
40 Date: Fri, 20 Jan 2012 00:54:43 +0100\r
41 Message-ID: <87fwfbuu2k.fsf@praet.org>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 Cc: notmuch@notmuchmail.org\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Thu, 19 Jan 2012 23:56:31 -0000\r
58 \r
59 On Thu, 19 Jan 2012 17:59:10 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
60 > LGTM, but should definitely come with a test.\r
61\r
62 \r
63 [...]\r
64 \r
65 > Also, this won't commute with Pieter's patch\r
66 > (id:"1327000744-25463-2-git-send-email-pieter@praet.org"), so one or\r
67 > the other will have to get updated.\r
68\r
69 \r
70 No problem, I'll have to resubmit my entire series anyway,\r
71 so go right ahead.\r
72 \r
73 > Quoth Mark Walters on Jan 19 at 10:03 pm:\r
74 > > Add the use of auto_exclude_tags in notmuch-show.c.  As with Austin's\r
75 > > patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds\r
76 > > the excluded tags to the query so the excluded messages will still\r
77 > > appear in the emacs interface, but as a single header line rather than\r
78 > > as a matching message.\r
79 > > ---\r
80 > >  notmuch-show.c |    8 ++++++++\r
81 > >  1 files changed, 8 insertions(+), 0 deletions(-)\r
82 > > \r
83 > > diff --git a/notmuch-show.c b/notmuch-show.c\r
84 > > index d14dac9..925dfd6 100644\r
85 > > --- a/notmuch-show.c\r
86 > > +++ b/notmuch-show.c\r
87 > > @@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
88 > >      char *opt;\r
89 > >      const notmuch_show_format_t *format = &format_text;\r
90 > >      notmuch_show_params_t params;\r
91 > > +    const char **auto_exclude_tags;\r
92 > > +    size_t auto_exclude_tags_length;\r
93 > >      int mbox = 0;\r
94 > >      int format_specified = 0;\r
95 > >      int i;\r
96 > > +    unsigned int j;\r
97\r
98 > Hah.  The original patch series updated 'count' to use the new\r
99 > argument parsing solely so I could steal 'i' for the tag exclude code.\r
100\r
101 > >  \r
102 > >      params.entire_thread = 0;\r
103 > >      params.raw = 0;\r
104 > > @@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
105 > >     return 1;\r
106 > >      }\r
107 > >  \r
108 > > +    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
109 > > +        (config, &auto_exclude_tags_length);\r
110 > > +    for (j = 0; j < auto_exclude_tags_length; j++)\r
111 > > +        notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]);\r
112 > > +\r
113 > >      /* if part was requested and format was not specified, use format=raw */\r
114 > >      if (params.part >= 0 && !format_specified)\r
115 > >     format = &format_raw;\r
116 > _______________________________________________\r
117 > notmuch mailing list\r
118 > notmuch@notmuchmail.org\r
119 > http://notmuchmail.org/mailman/listinfo/notmuch\r
120 \r
121 \r
122 Peace\r
123 \r
124 -- \r
125 Pieter\r