Re: [PATCH] Automatically exclude tags in notmuch-show
authorPieter Praet <pieter@praet.org>
Thu, 19 Jan 2012 23:54:43 +0000 (00:54 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:46 +0000 (09:42 -0800)
be/f931bccecb978b935c60344fd12cc85e2ea278 [new file with mode: 0644]

diff --git a/be/f931bccecb978b935c60344fd12cc85e2ea278 b/be/f931bccecb978b935c60344fd12cc85e2ea278
new file mode 100644 (file)
index 0000000..2767171
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0A347431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:31 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id TsPonQAoTfu2 for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Jan 2012 15:56:30 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 44BDE431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:30 -0800 (PST)\r
+Received: by wibhr12 with SMTP id hr12so3989wib.26\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 15:56:29 -0800 (PST)\r
+Received: by 10.180.101.164 with SMTP id fh4mr8122493wib.0.1327017389038;\r
+       Thu, 19 Jan 2012 15:56:29 -0800 (PST)\r
+Received: from localhost ([109.131.97.13])\r
+       by mx.google.com with ESMTPS id l8sm3103914wiy.5.2012.01.19.15.56.28\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 19 Jan 2012 15:56:28 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Austin Clements <amdragon@MIT.EDU>,\r
+       Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH] Automatically exclude tags in notmuch-show\r
+In-Reply-To: <20120119225910.GT16740@mit.edu>\r
+References: <874nvric7c.fsf@qmul.ac.uk>\r
+       <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
+       <20120119225910.GT16740@mit.edu>\r
+User-Agent: Notmuch/0.11+99~gab86e73 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Fri, 20 Jan 2012 00:54:43 +0100\r
+Message-ID: <87fwfbuu2k.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 19 Jan 2012 23:56:31 -0000\r
+\r
+On Thu, 19 Jan 2012 17:59:10 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> LGTM, but should definitely come with a test.\r
+> \r
+\r
+[...]\r
+\r
+> Also, this won't commute with Pieter's patch\r
+> (id:"1327000744-25463-2-git-send-email-pieter@praet.org"), so one or\r
+> the other will have to get updated.\r
+> \r
+\r
+No problem, I'll have to resubmit my entire series anyway,\r
+so go right ahead.\r
+\r
+> Quoth Mark Walters on Jan 19 at 10:03 pm:\r
+> > Add the use of auto_exclude_tags in notmuch-show.c.  As with Austin's\r
+> > patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds\r
+> > the excluded tags to the query so the excluded messages will still\r
+> > appear in the emacs interface, but as a single header line rather than\r
+> > as a matching message.\r
+> > ---\r
+> >  notmuch-show.c |    8 ++++++++\r
+> >  1 files changed, 8 insertions(+), 0 deletions(-)\r
+> > \r
+> > diff --git a/notmuch-show.c b/notmuch-show.c\r
+> > index d14dac9..925dfd6 100644\r
+> > --- a/notmuch-show.c\r
+> > +++ b/notmuch-show.c\r
+> > @@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+> >      char *opt;\r
+> >      const notmuch_show_format_t *format = &format_text;\r
+> >      notmuch_show_params_t params;\r
+> > +    const char **auto_exclude_tags;\r
+> > +    size_t auto_exclude_tags_length;\r
+> >      int mbox = 0;\r
+> >      int format_specified = 0;\r
+> >      int i;\r
+> > +    unsigned int j;\r
+> \r
+> Hah.  The original patch series updated 'count' to use the new\r
+> argument parsing solely so I could steal 'i' for the tag exclude code.\r
+> \r
+> >  \r
+> >      params.entire_thread = 0;\r
+> >      params.raw = 0;\r
+> > @@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+> >    return 1;\r
+> >      }\r
+> >  \r
+> > +    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
+> > +        (config, &auto_exclude_tags_length);\r
+> > +    for (j = 0; j < auto_exclude_tags_length; j++)\r
+> > +        notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]);\r
+> > +\r
+> >      /* if part was requested and format was not specified, use format=raw */\r
+> >      if (params.part >= 0 && !format_specified)\r
+> >    format = &format_raw;\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+\r
+Peace\r
+\r
+-- \r
+Pieter\r