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 890F6429E4D for ; Sat, 14 Jan 2012 01:21:22 -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 3lwymA7Wr7dK for ; Sat, 14 Jan 2012 01:21:22 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D897E429E4A for ; Sat, 14 Jan 2012 01:21:21 -0800 (PST) Received: by wibhr12 with SMTP id hr12so1051715wib.26 for ; Sat, 14 Jan 2012 01:21:20 -0800 (PST) Received: by 10.180.95.199 with SMTP id dm7mr7418812wib.9.1326532880694; Sat, 14 Jan 2012 01:21:20 -0800 (PST) Received: from localhost ([109.131.75.86]) by mx.google.com with ESMTPS id q5sm14194810wbo.8.2012.01.14.01.21.19 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jan 2012 01:21:20 -0800 (PST) From: Pieter Praet To: Austin Clements Subject: Re: [PATCH] Output unmodified Content-Type header value for JSON format. In-Reply-To: <20120112172840.GC18625@mit.edu> 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> User-Agent: Notmuch/0.10.2+115~gadd29f6 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Sat, 14 Jan 2012 10:19:33 +0100 Message-ID: <87ehv2proa.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Sat, 14 Jan 2012 09:21:22 -0000 On Thu, 12 Jan 2012 12:28:40 -0500, Austin Clements wrote: > Quoth Pieter Praet on Jan 12 at 6:07 pm: > > On Tue, 22 Nov 2011 22:40:21 -0500, Austin Clements wrote: > > > Quoth Jameson Graef Rollins on Nov 20 at 12:10 pm: > > > > The open question seems to be how we handle the content encoding > > > > parameters. My argument is that those should either be used by notmuch > > > > to properly encode the content for the consumer. If that's not > > > > possible, then just those parameters needed by the consumer to decode > > > > the content should be output. > > > > > > If notmuch is going to include part content in the JSON output (which > > > perhaps it shouldn't, as per recent IRC discussions), then it must > > > handle content encodings because JSON must be Unicode and therefore > > > the content strings in the JSON must be Unicode. > > > > Having missed the IRC discussions: what is the rationale for not > > including (specific types of?) part content in the JSON output ? > > Eg. how about inline attached text/x-patch ? > > 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. > > 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. Full ACK. One concern though (IIUC): Due to the prevalence of retarded MUA's, not outputting 'text/plain' and/or 'text/html' parts is unfortunately all too often equivalent to not outputting anything at all, so wouldn't we, in essence, be reducing `show --format=json' to an ever-so-slightly augmented `search --format=json' ? Peace -- Pieter