From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E35CF6DE0C45 for ; Fri, 21 Dec 2018 14:41:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.002 X-Spam-Level: X-Spam-Status: No, score=-0.002 tagged_above=-999 required=5 tests=[AWL=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iARGcttXFqUh for ; Fri, 21 Dec 2018 14:41:55 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id B25396DE0C3D for ; Fri, 21 Dec 2018 14:41:55 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gaTUN-0007bp-So; Fri, 21 Dec 2018 17:41:51 -0500 Received: (nullmailer pid 16277 invoked by uid 1000); Fri, 21 Dec 2018 22:41:37 -0000 From: David Bremner To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH v1 1/3] notmuch: Include the format parameter of text/plain parts In-Reply-To: <20181221144322.27942-2-dme@dme.org> References: <20181221144322.27942-1-dme@dme.org> <20181221144322.27942-2-dme@dme.org> Date: Sat, 22 Dec 2018 07:41:37 +0900 Message-ID: <87woo2jye6.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Fri, 21 Dec 2018 22:41:57 -0000 David Edmondson writes: > During formatted output, if a content type of a text/plain part > has a "format" paramter, include it in the output. > --- > notmuch-show.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/notmuch-show.c b/notmuch-show.c > index 07e9a5db..92d18bb8 100644 > --- a/notmuch-show.c > +++ b/notmuch-show.c > @@ -708,6 +708,19 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, > } > > if (GMIME_IS_PART (node->part)) { > + /* Include the format parameter of text/plain parts if it > + * exists, allowing the UI to adapt the display of the part as > + * appropriate. > + */ > + if (g_mime_content_type_is_type (content_type, "text", "plain")) { > + const char *format = > + g_mime_object_get_content_type_parameter (node->part, "format"); > + if (format) { > + sp->map_key (sp, "format"); > + sp->string (sp, format); > + } > + } > + > /* For non-HTML text parts, we include the content in the > * JSON. Since JSON must be Unicode, we handle charset > * decoding here and do not report a charset to the caller. We need to update devel/schemata for this change. Have you thought about the failure modes for mismatched notmuch.el <-> notmuch? Since you don't bump the format version, the emacs side has no way of knowing if the notmuch side supports the 'format' key. That's probably fine since the key is optional.