From ed09baa3dd435c5c19512d4e9e4c976444573869 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 6 Oct 2014 19:24:00 +2000 Subject: [PATCH] Re: [PATCH 06/11] lib: Internal support for querying and creating ghost messages --- fd/63c99f5bc8ee9c9e45d0d55f70f1c749c34de7 | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 fd/63c99f5bc8ee9c9e45d0d55f70f1c749c34de7 diff --git a/fd/63c99f5bc8ee9c9e45d0d55f70f1c749c34de7 b/fd/63c99f5bc8ee9c9e45d0d55f70f1c749c34de7 new file mode 100644 index 000000000..9930e559c --- /dev/null +++ b/fd/63c99f5bc8ee9c9e45d0d55f70f1c749c34de7 @@ -0,0 +1,78 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4E76E431FBC + for ; Sun, 5 Oct 2014 16:24:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id PMSMuwXFtKRm for ; + Sun, 5 Oct 2014 16:24:00 -0700 (PDT) +Received: from outgoing.csail.mit.edu (outgoing.csail.mit.edu [128.30.2.149]) + by olra.theworths.org (Postfix) with ESMTP id BBAED431FAE + for ; Sun, 5 Oct 2014 16:24:00 -0700 (PDT) +Received: from [104.131.20.129] (helo=awakeningjr) + by outgoing.csail.mit.edu with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) + (Exim 4.72) (envelope-from ) + id 1Xav9k-0000Nh-Bd; Sun, 05 Oct 2014 19:24:00 -0400 +Received: from amthrax by awakeningjr with local (Exim 4.84) + (envelope-from ) + id 1Xav9k-0004da-3G; Sun, 05 Oct 2014 19:24:00 -0400 +Date: Sun, 5 Oct 2014 19:24:00 -0400 +From: Austin Clements +To: David Bremner +Subject: Re: [PATCH 06/11] lib: Internal support for querying and creating + ghost messages +Message-ID: <20141005232400.GC7970@csail.mit.edu> +References: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> + <1412345958-8278-7-git-send-email-aclements@csail.mit.edu> + <87fvf2q5p5.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87fvf2q5p5.fsf@maritornes.cs.unb.ca> +User-Agent: Mutt/1.5.23 (2014-03-12) +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 05 Oct 2014 23:24:06 -0000 + +Quoth David Bremner on Oct 05 at 10:30 am: +> Austin Clements writes: +> +> > + message->flags &= ~(1 << NOTMUCH_MESSAGE_FLAG_GHOST); +> +> What do you think about using bit set / clear / read macros? I don't +> insist, but I wonder if it would make this part more readable. + +I'm used to reading this stuff, so either way is fine with me. Do we +have bit set / clear / read macros? + +> > + else if (*i == "Tghost") +> > + message->flags |= (1 << NOTMUCH_MESSAGE_FLAG_GHOST); +> > + else +> +> It makes me faintly unhappy to have the prefix hardcoded here. +> Not sure if there is a sensible solution. + +I agree, but I also don't want to construct the test string every time +or deconstruct the term string every time. I could move the "T" +prefix string to a #define and use that both here and in +BOOLEAN_PREFIX_INTERNAL, but that solution may be worse than the +problem. What do you think? -- 2.26.2