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