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 E973D6DE0C3B for ; Sat, 22 Dec 2018 04:08:58 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.343 X-Spam-Level: X-Spam-Status: No, score=0.343 tagged_above=-999 required=5 tests=[AWL=-0.310, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=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 OvK8YCq7AJMm for ; Sat, 22 Dec 2018 04:08:57 -0800 (PST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by arlo.cworth.org (Postfix) with ESMTPS id 90C156DE0C1F for ; Sat, 22 Dec 2018 04:08:57 -0800 (PST) Received: by mail-wr1-f68.google.com with SMTP id z5so7696828wrt.11 for ; Sat, 22 Dec 2018 04:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:subject:in-reply-to:references:from:date:message-id:mime-version :content-transfer-encoding; bh=R2oJmATR+0DVwhUsyGhV/Us24DVEcK4Iwm1oHqZgD3E=; b=gvt/H/xD/VoJXAbNq26YhMs70q0MnDi/j0n9v35c3Ol52dnd0djPNRcx1KSYIPOXTu /Zoq/lMcGGMHCPEFUHexW/uHGPxlHN8ENvtnqJSWLV8JN6RFKfvDVAwdhJAlXmy1+WI3 wDwju0bwrGaz6687G9ZnOpKlekWeduKjlGlRYxf7W8aOzXYijqxWvpPoGSfs3eF9rXKg kz5hEF+jSPOqQyWVTQ5EMpNyH0Lj+O74a57jJ/Tk5PDp0Z9R3dN7FrV3PI+/w8H6AXcz nPZn91wgP2iQ1s5tb7nHIN98DGSm3UUYLQYphEBoAIRHJ/d3TjzIC+vTx8OxoHsiWHlM f6SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:in-reply-to:references:from:date :message-id:mime-version:content-transfer-encoding; bh=R2oJmATR+0DVwhUsyGhV/Us24DVEcK4Iwm1oHqZgD3E=; b=UAfNoXCPD8qbx2cUHGOgDfMtiwsVD/34TyUlKGYcjZ5dmxlU7QiH1eXNSk2C4FYDRD SV4sq3gkaSPcEgcEF0dSA3jE7nIBujD1mYFlPzZGYaajZ0YFIhDTwHRQPXF2vGrF57kS wYZzhIskV8Fq1MPbUzvdyAUldJY6sTl5oQVJq1vkkm/L/lCdSmYW7CIXjlrt6+J7auYx ttA1RDc4hS2azwEmM/adqONTtCpL7axnb7TYe1SFGhBLyJ++asff0jck3zmFBq3z2AIh 80pCsfXh8aG+IsJ00DJwj6frO4y2jFzqdpGrdISVVyWCAn2XVXiwL7YgxI7I3RB411DT mayg== X-Gm-Message-State: AJcUukcBL4YzyFpAgte/wJlWT3af7k0vUTEh//k1ObSz1n3j1GCNYOSP 7xHScr0fq0yt07MVhogmdnoFd5FTPVk= X-Google-Smtp-Source: ALg8bN7dJuXLR1u+PNwqlcLCGfeJEY5H75HLEC3j5aJ4zm9/6xoXRNnUoS85ucl54S2NoFRjoIswaA== X-Received: by 2002:adf:e707:: with SMTP id c7mr5683303wrm.196.1545480533435; Sat, 22 Dec 2018 04:08:53 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id o5sm22464877wmg.25.2018.12.22.04.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Dec 2018 04:08:51 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id d49af556; Sat, 22 Dec 2018 12:08:51 +0000 (UTC) To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH v1 1/3] notmuch: Include the format parameter of text/plain parts In-Reply-To: <87woo2jye6.fsf@tethera.net> References: <20181221144322.27942-1-dme@dme.org> <20181221144322.27942-2-dme@dme.org> <87woo2jye6.fsf@tethera.net> X-HGTTG: heart-of-gold From: David Edmondson Date: Sat, 22 Dec 2018 12:08:51 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Sat, 22 Dec 2018 12:08:59 -0000 On Saturday, 2018-12-22 at 07:41:37 +09, David Bremner wrote: > 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, >> } >>=20=20 >> 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 =3D >> + 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. Will do in a v2. > 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. If notmuch-show.el is newer than notmuch it will never see the =E2=80=9Cfor= mat=E2=80=9D parameter and so will not attempt to fill the flowed text. This is the same as the current behaviour. If notmuch is newer than notmuch-show.el it will include the =E2=80=9Cforma= t=E2=80=9D parameter but the notmuch-show.el will not look for it. This is the same as the current behaviour. I think that it's safe in all cases. dme. --=20 Facts don't do what I want them to.