Re: [PATCH] Output unmodified Content-Type header value for JSON format.
authorDavid Edmondson <dme@dme.org>
Sun, 15 Jan 2012 11:52:40 +0000 (11:52 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:11 +0000 (09:42 -0800)
51/077c6abedb6954b870e7f9c8fb1b36fdd3ef9c [new file with mode: 0644]

diff --git a/51/077c6abedb6954b870e7f9c8fb1b36fdd3ef9c b/51/077c6abedb6954b870e7f9c8fb1b36fdd3ef9c
new file mode 100644 (file)
index 0000000..038e01f
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <dme@dme.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 020A8431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 03:52:54 -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 DIJbW07cdw77 for <notmuch@notmuchmail.org>;\r
+       Sun, 15 Jan 2012 03:52:49 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6FFCC431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 03:52:49 -0800 (PST)\r
+Received: by werh12 with SMTP id h12so657351wer.26\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 03:52:48 -0800 (PST)\r
+Received: by 10.216.136.38 with SMTP id v38mr1988744wei.23.1326628368283;\r
+       Sun, 15 Jan 2012 03:52:48 -0800 (PST)\r
+Received: from hotblack-desiato.hh.sledj.net\r
+       (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
+       by mx.google.com with ESMTPS id fq7sm18194101wbb.1.2012.01.15.03.52.46\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 15 Jan 2012 03:52:46 -0800 (PST)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+       id BEA1F9FEF2; Sun, 15 Jan 2012 11:52:44 +0000 (GMT)\r
+To: Pieter Praet <pieter@praet.org>, Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH] Output unmodified Content-Type header value for JSON\r
+       format.\r
+In-Reply-To: <87ehv2proa.fsf@praet.org>\r
+References: <1321659905-24367-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <87fwhkyisj.fsf@servo.finestructure.net> <87wrawq1dz.fsf@gmail.com>\r
+       <87d3coxu7s.fsf@servo.finestructure.net> <87r512pru2.fsf@gmail.com>\r
+       <87ipmewo4z.fsf@servo.finestructure.net>\r
+       <20111123034021.GL9351@mit.edu> <87ipkglui4.fsf@praet.org>\r
+       <20120112172840.GC18625@mit.edu> <87ehv2proa.fsf@praet.org>\r
+User-Agent: Notmuch/0.10.2+186~gd0f7804 (http://notmuchmail.org)\r
+       Emacs/24.0.92.1 (x86_64-pc-linux-gnu)\r
+From: David Edmondson <dme@dme.org>\r
+Date: Sun, 15 Jan 2012 11:52:40 +0000\r
+Message-ID: <cun1ur16v3r.fsf@hotblack-desiato.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\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: Sun, 15 Jan 2012 11:52:54 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+> Technically the IRC discussion was about not including *any* part\r
+> content in the JSON output, and always using show --format=raw or\r
+> similar to retrieve desired parts.  Currently, notmuch includes part\r
+> content in the JSON only for text/*, *except* when it's text/html.  I\r
+> assume non-text parts are omitted because binary data is hard to\r
+> represent in JSON and text/html is omitted because some people don't\r
+> need it.  However, this leads to some peculiar asymmetry in the Emacs\r
+> code where sometimes it pulls part content out of the JSON and\r
+> sometimes it retrieves it using show --format=raw.  This in turn leads\r
+> to asymmetry in content encoding handling, since notmuch handles\r
+> content encoding for parts included in the JSON (and there's no good\r
+> way around that since JSON is Unicode), but not for parts retrieved as\r
+> raw.\r
+\r
+Including the text output in the JSON results in significantly fewer\r
+calls to 'notmuch' during the building of a typical `notmuch-show-mode'\r
+buffer. Someone with one of those older, crankier computers could easily\r
+test how much effect this has by changing\r
+`notmuch-show-get-bodypart-content' slightly.\r
+\r
+> The idea discussed on IRC was to remove all part content from the JSON\r
+> output and to always use show to retrieve it, possibly beefing up\r
+> show's support for content decoding (and possibly introducing a way to\r
+> retrieve multiple raw parts at once to avoid re-parsing).  This would\r
+> get the JSON format out of the business of guessing what consumers\r
+> need, simplify the Emacs code, and normalize content encoding\r
+> handling.\r
+\r
+Is there a real problem being solved here? Having a clean structure is\r
+nice, except when it's not.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk8SvgkACgkQaezQq/BJZRZLzwCfcogTyL3tMTxkO9Nr4bOdE6qO\r
+SSgAn0bQ/tyZLpmX/Dvi/6xlzZyC/gXt\r
+=Gn23\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r