Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 7b / 193f5ede6a63b63f41216ce8b8ea3bb29e6543
1 Return-Path: <pieter@praet.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 890F6429E4D\r
6         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:21:22 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 3lwymA7Wr7dK for <notmuch@notmuchmail.org>;\r
16         Sat, 14 Jan 2012 01:21:22 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id D897E429E4A\r
21         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:21:21 -0800 (PST)\r
22 Received: by wibhr12 with SMTP id hr12so1051715wib.26\r
23         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:21:20 -0800 (PST)\r
24 Received: by 10.180.95.199 with SMTP id dm7mr7418812wib.9.1326532880694;\r
25         Sat, 14 Jan 2012 01:21:20 -0800 (PST)\r
26 Received: from localhost ([109.131.75.86])\r
27         by mx.google.com with ESMTPS id q5sm14194810wbo.8.2012.01.14.01.21.19\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Sat, 14 Jan 2012 01:21:20 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Austin Clements <amdragon@MIT.EDU>\r
32 Subject: Re: [PATCH] Output unmodified Content-Type header value for JSON\r
33         format.\r
34 In-Reply-To: <20120112172840.GC18625@mit.edu>\r
35 References: <1321659905-24367-1-git-send-email-dmitry.kurochkin@gmail.com>\r
36         <87fwhkyisj.fsf@servo.finestructure.net> <87wrawq1dz.fsf@gmail.com>\r
37         <87d3coxu7s.fsf@servo.finestructure.net> <87r512pru2.fsf@gmail.com>\r
38         <87ipmewo4z.fsf@servo.finestructure.net>\r
39         <20111123034021.GL9351@mit.edu> <87ipkglui4.fsf@praet.org>\r
40         <20120112172840.GC18625@mit.edu>\r
41 User-Agent: Notmuch/0.10.2+115~gadd29f6 (http://notmuchmail.org) Emacs/23.3.1\r
42         (x86_64-unknown-linux-gnu)\r
43 Date: Sat, 14 Jan 2012 10:19:33 +0100\r
44 Message-ID: <87ehv2proa.fsf@praet.org>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 Cc: notmuch@notmuchmail.org\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Sat, 14 Jan 2012 09:21:22 -0000\r
61 \r
62 On Thu, 12 Jan 2012 12:28:40 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
63 > Quoth Pieter Praet on Jan 12 at  6:07 pm:\r
64 > > On Tue, 22 Nov 2011 22:40:21 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
65 > > > Quoth Jameson Graef Rollins on Nov 20 at 12:10 pm:\r
66 > > > > The open question seems to be how we handle the content encoding\r
67 > > > > parameters.  My argument is that those should either be used by notmuch\r
68 > > > > to properly encode the content for the consumer.  If that's not\r
69 > > > > possible, then just those parameters needed by the consumer to decode\r
70 > > > > the content should be output.\r
71 > > > \r
72 > > > If notmuch is going to include part content in the JSON output (which\r
73 > > > perhaps it shouldn't, as per recent IRC discussions), then it must\r
74 > > > handle content encodings because JSON must be Unicode and therefore\r
75 > > > the content strings in the JSON must be Unicode.\r
76 > > \r
77 > > Having missed the IRC discussions: what is the rationale for not\r
78 > > including (specific types of?) part content in the JSON output ?\r
79 > > Eg. how about inline attached text/x-patch ?\r
80\r
81 > Technically the IRC discussion was about not including *any* part\r
82 > content in the JSON output, and always using show --format=raw or\r
83 > similar to retrieve desired parts.  Currently, notmuch includes part\r
84 > content in the JSON only for text/*, *except* when it's text/html.  I\r
85 > assume non-text parts are omitted because binary data is hard to\r
86 > represent in JSON and text/html is omitted because some people don't\r
87 > need it.  However, this leads to some peculiar asymmetry in the Emacs\r
88 > code where sometimes it pulls part content out of the JSON and\r
89 > sometimes it retrieves it using show --format=raw.  This in turn leads\r
90 > to asymmetry in content encoding handling, since notmuch handles\r
91 > content encoding for parts included in the JSON (and there's no good\r
92 > way around that since JSON is Unicode), but not for parts retrieved as\r
93 > raw.\r
94\r
95 > The idea discussed on IRC was to remove all part content from the JSON\r
96 > output and to always use show to retrieve it, possibly beefing up\r
97 > show's support for content decoding (and possibly introducing a way to\r
98 > retrieve multiple raw parts at once to avoid re-parsing).  This would\r
99 > get the JSON format out of the business of guessing what consumers\r
100 > need, simplify the Emacs code, and normalize content encoding\r
101 > handling.\r
102 \r
103 Full ACK.\r
104 \r
105 One concern though (IIUC): Due to the prevalence of retarded MUA's, not\r
106 outputting 'text/plain' and/or 'text/html' parts is unfortunately all\r
107 too often equivalent to not outputting anything at all, so wouldn't we,\r
108 in essence, be reducing `show --format=json' to an ever-so-slightly\r
109 augmented `search --format=json' ?\r
110 \r
111 \r
112 Peace\r
113 \r
114 -- \r
115 Pieter\r