Re: [PATCH 1/4] show: Pass notmuch_message_t instead of path to show_message_body.
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Fri, 9 Dec 2011 19:59:59 +0000 (23:59 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:43 +0000 (09:40 -0800)
60/13661f65efc2d1a2fadac2b0e2bd2103e9d53c [new file with mode: 0644]

diff --git a/60/13661f65efc2d1a2fadac2b0e2bd2103e9d53c b/60/13661f65efc2d1a2fadac2b0e2bd2103e9d53c
new file mode 100644 (file)
index 0000000..2213e1f
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 9EA45429E25\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Dec 2011 12:00:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 KZMmXIPy0+35 for <notmuch@notmuchmail.org>;\r
+       Fri,  9 Dec 2011 12:00:35 -0800 (PST)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 0A4B1431FB6\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Dec 2011 12:00:34 -0800 (PST)\r
+Received: by bkat8 with SMTP id t8so3562540bka.26\r
+       for <notmuch@notmuchmail.org>; Fri, 09 Dec 2011 12:00:32 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=6y7BNmkdU49JxlJZYVus7fWw76/0Ox1Ho/DSoN+Fybk=;\r
+       b=J704yeo8A+vCX31YEbiMtQMmv8t6Cdwq4xsnZGNFa0MUX0JWkl6xVBvGeNA2eIW3jL\r
+       pFZc82C3BHrIPDKXzoSYSh+9+79Cpef+TmO7JVSyCchvIS1bI7qnSrcacqaAd6MjIeH4\r
+       h69gZGi5zpIxmYsDedeFfkUwlHcIc+v3HLOew=\r
+Received: by 10.205.127.2 with SMTP id gy2mr3644351bkc.87.1323460832411;\r
+       Fri, 09 Dec 2011 12:00:32 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id p13sm12345880bkd.4.2011.12.09.12.00.31\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 09 Dec 2011 12:00:31 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH 1/4] show: Pass notmuch_message_t instead of path to\r
+       show_message_body.\r
+In-Reply-To: <20111209195426.GJ3190@mit.edu>\r
+References: <1322446871-14986-1-git-send-email-amdragon@mit.edu>\r
+       <1323027100-10307-1-git-send-email-amdragon@mit.edu>\r
+       <1323027100-10307-2-git-send-email-amdragon@mit.edu>\r
+       <87ty597eh8.fsf@gmail.com> <20111209195426.GJ3190@mit.edu>\r
+User-Agent: Notmuch/0.10.2+82~g96a629c (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 09 Dec 2011 23:59:59 +0400\r
+Message-ID: <87pqfx7by8.fsf@gmail.com>\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: Fri, 09 Dec 2011 20:00:35 -0000\r
+\r
+On Fri, 9 Dec 2011 14:54:26 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Quoth Dmitry Kurochkin on Dec 09 at 11:05 pm:\r
+> > On Sun,  4 Dec 2011 14:31:37 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > >  }\r
+> > >  \r
+> > >  notmuch_status_t\r
+> > > -show_message_body (const char *filename,\r
+> > > +show_message_body (notmuch_message_t *message,\r
+> > >                     const notmuch_show_format_t *format,\r
+> > >                     notmuch_show_params_t *params)\r
+> > \r
+> > Is show_message_body() (or functions that it calls/would call) supposed\r
+> > to modify the message structure?  If not, we should make it const.\r
+> \r
+> That would be nice, but lack of const in libnotmuch makes it difficult\r
+> to do this (for example, notmuch_message_get_filename, which\r
+> show_message_body calls, takes a non-const notmuch_message_t *).\r
+> \r
+> OTOH, since functions like notmuch_message_get_filename lazily compute\r
+> fields of notmuch_message_t and C has no equivalent of C++'s mutable,\r
+> it's not clear making the message const is even the right thing to do.\r
+> \r
+\r
+If there are fields that are computed lazily (I just did not know it),\r
+we can not make it const.\r
+\r
+\r
+The patch looks good.  I think it can be pushed before the rest of the\r
+patches are reviewed/ready.\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+> > I would also make all pointers constant (i.e. const notmuch_message_t\r
+> > *const message), but I can not insist since it is not common in notmuch.\r
+> > \r
+> > Regards,\r
+> >   Dmitry\r