Re: [PATCH v4 2/4] reply: Add a JSON reply format.
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Fri, 10 Feb 2012 08:39:23 +0000 (12:39 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:19 +0000 (09:44 -0800)
c1/561f8705b0f603dc58923db252adfe5a1efb73 [new file with mode: 0644]

diff --git a/c1/561f8705b0f603dc58923db252adfe5a1efb73 b/c1/561f8705b0f603dc58923db252adfe5a1efb73
new file mode 100644 (file)
index 0000000..33baf8f
--- /dev/null
@@ -0,0 +1,153 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 3512D431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 10 Feb 2012 00:40:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 5eLEd2Brl8D8 for <notmuch@notmuchmail.org>;\r
+       Fri, 10 Feb 2012 00:40:48 -0800 (PST)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id BC150431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 10 Feb 2012 00:40:47 -0800 (PST)\r
+Received: by bkcjk7 with SMTP id jk7so2542739bkc.26\r
+       for <notmuch@notmuchmail.org>; Fri, 10 Feb 2012 00:40:44 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type:content-transfer-encoding;\r
+       bh=ThjjcjlffsiZN4LGTUQTvyPPPC6vruZiPr+/eBAiEGU=;\r
+       b=DxO604tu+7CHKSnPipOfx+uXRj1rJoV79Ripe4scNkNwdPOsv+BjJ8Z9Chxcj8A4fJ\r
+       JhfqV+tgoBuhTCtrU/u2PRAL9u6DEx6IsyhyUEju02M0qmjsXcENrdpP4q2yn8D6feQo\r
+       g949zUodWiLBVZ4Ty8rSZ44DpasJg2L/qV8YM=\r
+Received: by 10.205.127.141 with SMTP id ha13mr2201628bkc.28.1328863244884;\r
+       Fri, 10 Feb 2012 00:40:44 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id ez5sm15429007bkc.15.2012.02.10.00.40.43\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 10 Feb 2012 00:40:43 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+Subject: Re: [PATCH v4 2/4] reply: Add a JSON reply format.\r
+In-Reply-To:\r
+ <CAMoJFUshAUAO6hnYWefXgdBdZe3qavgWokLC8du3VWGYDb9RUQ@mail.gmail.com>\r
+References: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca>\r
+       <1328746916-25447-1-git-send-email-awg+notmuch@xvx.ca>\r
+       <1328746916-25447-3-git-send-email-awg+notmuch@xvx.ca>\r
+       <87mx8sa2tj.fsf@gmail.com>\r
+       <CAMoJFUshAUAO6hnYWefXgdBdZe3qavgWokLC8du3VWGYDb9RUQ@mail.gmail.com>\r
+User-Agent: Notmuch/0.11.1+167~g6e72434 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 10 Feb 2012 12:39:23 +0400\r
+Message-ID: <8762ff9j5w.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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: Fri, 10 Feb 2012 08:40:50 -0000\r
+\r
+Hi Adam.\r
+\r
+On Thu, 9 Feb 2012 21:27:29 -0700, Adam Wolfe Gordon <awg+notmuch@xvx.ca> w=\r
+rote:\r
+> Hi Dmitry,\r
+>=20\r
+> On Thu, Feb 9, 2012 at 00:22, Dmitry Kurochkin\r
+> <dmitry.kurochkin@gmail.com> wrote:\r
+> >> Reply now enforces that only one message is returned, as the semantics\r
+> >> of replying to multiple messages are not wel-defined.\r
+> >\r
+> > s/wel/well/\r
+>=20\r
+> Oops! git filter-branch to the rescue :-).\r
+>=20\r
+> >> Show is modified such that --format=3Djson no longer implies\r
+> >> --entire-thread, as MUAs will use --format=3Djson when constructing\r
+> >> replies. The man page is updated to reflect this change.\r
+> >\r
+> > I did not look into details. =C2=A0But I am surprised that user needs t=\r
+o call\r
+> > notmuch show --format=3Djson to make reply. =C2=A0I would expect notmuc=\r
+h reply\r
+> > to provide all required info (except for bodies).\r
+>=20\r
+> I agree, it would be ideal to include the data from show --format=3Djson\r
+> in the reply JSON. I started down the path of implementing this, but\r
+> realized it requires either copying quite a bit of code from show or\r
+> factoring it out, and both options felt kind of dirty. I'd like show\r
+> and reply to share a function that produces the JSON-formatted body of\r
+> a message, but it doesn't feel right to expose the entire JSON format\r
+> and all the functions that go with it from notmuch-show.c and put the\r
+> structure and all the prototypes in notmuch-client.h.\r
+>=20\r
+\r
+I see.\r
+\r
+> Will Austin's show rewrite make this easier/cleaner? Or am I being too\r
+> squeamish about moving code?\r
+>=20\r
+\r
+It probably will.\r
+\r
+> > Anyway, I think you should put this change in a separate patch.\r
+>=20\r
+> Yeah, if I leave it as is it changes a default behavior, so a separate\r
+> patch would probably be a good idea.\r
+>=20\r
+> > Also, we clearly need a NEWS entry for it and user-customizable Emacs\r
+> > variable changes. =C2=A0Though it can be done after this series is push=\r
+ed, I\r
+> > guess.\r
+>=20\r
+> I don't think there are any emacs customization changes here, unless\r
+> we want to implement the notmuch mode config file that was discussed\r
+> before to give message-citation-line-format and other things nice\r
+> defaults. Or are you suggesting that there should be some new\r
+> customization options? (One I can think of would be the list of\r
+> preferred types for multipart/alternative display, which right now is\r
+> hardcoded in notmuch-show.el.)\r
+>=20\r
+\r
+No.  I thought there were some user-customizable variables that were\r
+moved to notmuch-lib and renamed.  If that is correct, it would not hurt\r
+to document these changes.\r
+\r
+> > Thank you for this work, it is much appreciated.\r
+>=20\r
+> Thanks for taking the time to review these patches! I think as a\r
+> result of everyone's reviews I've pushed the series toward what I\r
+> envisioned/wanted in the first place, rather than the kinda kludgey\r
+> thing I did initially.\r
+>=20\r
+\r
+No need to thank me for review, I did not do it :)\r
+\r
+> Amusingly, I've started a new job since I wrote the original patch and\r
+> no longer receive much HTML-only email, but I like this patch series\r
+> enough to see it through anyway :-).\r
+\r
+Congratulations with the new job :)\r
+\r
+Regards,\r
+  Dmitry\r