From be07f2f084ec15cb7ef72b3f9bb49a5a0818122b Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Fri, 10 Feb 2012 21:27:29 +1700 Subject: [PATCH] Re: [PATCH v4 2/4] reply: Add a JSON reply format. --- 00/7066770be574b33ad3e402a1f26baaead79a26 | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 00/7066770be574b33ad3e402a1f26baaead79a26 diff --git a/00/7066770be574b33ad3e402a1f26baaead79a26 b/00/7066770be574b33ad3e402a1f26baaead79a26 new file mode 100644 index 000000000..2c0be57dc --- /dev/null +++ b/00/7066770be574b33ad3e402a1f26baaead79a26 @@ -0,0 +1,120 @@ +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 C4F9D431FB6 + for ; Thu, 9 Feb 2012 20:27:31 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 0YdkEIxHcFsB for ; + Thu, 9 Feb 2012 20:27:31 -0800 (PST) +Received: from mail-lpp01m020-f181.google.com (mail-lpp01m020-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id DF2B2431FAE + for ; Thu, 9 Feb 2012 20:27:30 -0800 (PST) +Received: by lbbgn5 with SMTP id gn5so1368423lbb.26 + for ; Thu, 09 Feb 2012 20:27:29 -0800 (PST) +MIME-Version: 1.0 +Received: by 10.152.123.68 with SMTP id ly4mr3052300lab.13.1328848049088; Thu, + 09 Feb 2012 20:27:29 -0800 (PST) +Sender: awg@xvx.ca +Received: by 10.112.90.20 with HTTP; Thu, 9 Feb 2012 20:27:29 -0800 (PST) +X-Originating-IP: [96.52.216.56] +In-Reply-To: <87mx8sa2tj.fsf@gmail.com> +References: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca> + <1328746916-25447-1-git-send-email-awg+notmuch@xvx.ca> + <1328746916-25447-3-git-send-email-awg+notmuch@xvx.ca> + <87mx8sa2tj.fsf@gmail.com> +Date: Thu, 9 Feb 2012 21:27:29 -0700 +X-Google-Sender-Auth: TIS98BnxoTlkJAolME_OyVN1q1Y +Message-ID: + +Subject: Re: [PATCH v4 2/4] reply: Add a JSON reply format. +From: Adam Wolfe Gordon +To: Dmitry Kurochkin +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: quoted-printable +X-Gm-Message-State: + ALoCoQkH0/0VaDrio0eFWD9t/wbwLVVOO2lN1vLxwks4eduoP/qD+1u4OGG4KJ3bES8OxN1xwwsd +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: Fri, 10 Feb 2012 04:27:31 -0000 + +Hi Dmitry, + +On Thu, Feb 9, 2012 at 00:22, Dmitry Kurochkin + wrote: +>> Reply now enforces that only one message is returned, as the semantics +>> of replying to multiple messages are not wel-defined. +> +> s/wel/well/ + +Oops! git filter-branch to the rescue :-). + +>> Show is modified such that --format=3Djson no longer implies +>> --entire-thread, as MUAs will use --format=3Djson when constructing +>> replies. The man page is updated to reflect this change. +> +> I did not look into details. =A0But I am surprised that user needs to cal= +l +> notmuch show --format=3Djson to make reply. =A0I would expect notmuch rep= +ly +> to provide all required info (except for bodies). + +I agree, it would be ideal to include the data from show --format=3Djson +in the reply JSON. I started down the path of implementing this, but +realized it requires either copying quite a bit of code from show or +factoring it out, and both options felt kind of dirty. I'd like show +and reply to share a function that produces the JSON-formatted body of +a message, but it doesn't feel right to expose the entire JSON format +and all the functions that go with it from notmuch-show.c and put the +structure and all the prototypes in notmuch-client.h. + +Will Austin's show rewrite make this easier/cleaner? Or am I being too +squeamish about moving code? + +> Anyway, I think you should put this change in a separate patch. + +Yeah, if I leave it as is it changes a default behavior, so a separate +patch would probably be a good idea. + +> Also, we clearly need a NEWS entry for it and user-customizable Emacs +> variable changes. =A0Though it can be done after this series is pushed, I +> guess. + +I don't think there are any emacs customization changes here, unless +we want to implement the notmuch mode config file that was discussed +before to give message-citation-line-format and other things nice +defaults. Or are you suggesting that there should be some new +customization options? (One I can think of would be the list of +preferred types for multipart/alternative display, which right now is +hardcoded in notmuch-show.el.) + +> Thank you for this work, it is much appreciated. + +Thanks for taking the time to review these patches! I think as a +result of everyone's reviews I've pushed the series toward what I +envisioned/wanted in the first place, rather than the kinda kludgey +thing I did initially. + +Amusingly, I've started a new job since I wrote the original patch and +no longer receive much HTML-only email, but I like this patch series +enough to see it through anyway :-). -- 2.26.2