Re: [PATCH v5.2 7/7] emacs: Use the new JSON reply format and message-cite-original
authorAdam Wolfe Gordon <awg+notmuch@xvx.ca>
Sat, 18 Feb 2012 02:22:07 +0000 (19:22 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:38 +0000 (09:44 -0800)
b9/2c1acdedafb04aa64449e87a6576ae78fb35fa [new file with mode: 0644]

diff --git a/b9/2c1acdedafb04aa64449e87a6576ae78fb35fa b/b9/2c1acdedafb04aa64449e87a6576ae78fb35fa
new file mode 100644 (file)
index 0000000..aba0da2
--- /dev/null
@@ -0,0 +1,132 @@
+Return-Path: <awg@xvx.ca>\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 17C82431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 18:22:10 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 JfwEsjjJqwNF for <notmuch@notmuchmail.org>;\r
+       Fri, 17 Feb 2012 18:22:09 -0800 (PST)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5F2C1431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 18:22:09 -0800 (PST)\r
+Received: by lahd3 with SMTP id d3so4645976lah.26\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 18:22:07 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of awg@xvx.ca designates 10.152.123.68\r
+       as permitted sender) client-ip=10.152.123.68; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of awg@xvx.ca designates\r
+       10.152.123.68 as permitted sender) smtp.mail=awg@xvx.ca\r
+Received: from mr.google.com ([10.152.123.68])\r
+       by 10.152.123.68 with SMTP id ly4mr8237667lab.13.1329531727932\r
+       (num_hops = 1); Fri, 17 Feb 2012 18:22:07 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.152.123.68 with SMTP id ly4mr6879914lab.13.1329531727829; Fri,\r
+       17 Feb 2012 18:22:07 -0800 (PST)\r
+Sender: awg@xvx.ca\r
+Received: by 10.112.90.20 with HTTP; Fri, 17 Feb 2012 18:22:07 -0800 (PST)\r
+X-Originating-IP: [96.52.216.56]\r
+In-Reply-To: <20120217200017.GG5991@mit.edu>\r
+References: <1329361957-28493-1-git-send-email-awg+notmuch@xvx.ca>\r
+       <1329361957-28493-8-git-send-email-awg+notmuch@xvx.ca>\r
+       <20120217200017.GG5991@mit.edu>\r
+Date: Fri, 17 Feb 2012 19:22:07 -0700\r
+X-Google-Sender-Auth: FxZHoDEOlYKfKKDBHysktGvvlKg\r
+Message-ID:\r
+ <CAMoJFUs5jnu7=5PtrNib9J6P_FnxD8bK2L+oQiBdgXPJXhvMJg@mail.gmail.com>\r
+Subject: Re: [PATCH v5.2 7/7] emacs: Use the new JSON reply format and\r
+       message-cite-original\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: Austin Clements <amdragon@mit.edu>\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Gm-Message-State:\r
+ ALoCoQnC4Wnr2Z5GwLVPvuX+ioA2RiG3XgCKSOVmiTkJ8hSCk5LevU3T0EOObbUvY1lIvZbCIJ9J\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: Sat, 18 Feb 2012 02:22:10 -0000\r
+\r
+On Fri, Feb 17, 2012 at 13:00, Austin Clements <amdragon@mit.edu> wrote:\r
+> One general comment that affects a lot of things in this patch: I\r
+> think you should use the same JSON parsing settings that\r
+> notmuch-query-get-threads uses. =A0Besides consistency and more\r
+> opportunities for code reuse, using lists instead of vectors for JSON\r
+> arrays will simplify a lot of this code without any drawbacks.\r
+\r
+I pretty much agree. The only reason I stuck with alists was, as you\r
+mention below, to be compatible with certain mail functions. Given the\r
+things you've pointed out, I think the small hassle of making those\r
+work with plists is worthwhile, so I'll give it a go.\r
+\r
+Clarification on a couple of things follow, otherwise I'll make all\r
+these changes for the next version.\r
+\r
+>> + =A0 =A0 (goto-char (point-max)))\r
+>> +\r
+>> + =A0 =A0 =A0(let ((from (cdr (assq 'From original-headers)))\r
+>> + =A0 =A0 =A0 =A0 (date (cdr (assq 'Date original-headers)))\r
+>> + =A0 =A0 =A0 =A0 (start (point)))\r
+>> +\r
+>> + =A0 =A0 (insert "From: " from "\n")\r
+>> + =A0 =A0 (insert "Date: " date "\n\n")\r
+>\r
+> Sorry; I'm having trouble following the diff. =A0What are the inserts\r
+> for?\r
+\r
+The function message-cite-original cites an original message, which is\r
+in the marked region. It assumes the headers of the original message\r
+will be part of the marked region, but the only ones it actually uses\r
+are From and Date.\r
+\r
+This could probably use a comment in the code.\r
+\r
+>> + =A0 =A0 (push-mark)\r
+>\r
+> It's unfortunate that message-cite-original depends on the mark.\r
+> Since you're about to push the mark for the user anyway, maybe this\r
+> should be a set-mark so that only one mark gets pushed?\r
+\r
+Probably the right thing to do.\r
+\r
+>> + =A0 =A0 (goto-char start)\r
+>> + =A0 =A0 ;; Quote the original message according to the user's configur=\r
+ed style.\r
+>> + =A0 =A0 (message-cite-original))))\r
+>\r
+> message-cite-original-without-signature?\r
+\r
+Perhaps it should be configurable (notmuch-reply-cite-function or\r
+somesuch). I believe message-cite-original matches the behavior of the\r
+old reply, which didn't strip signatures, but I don't have strong\r
+feelings either way.\r
+\r
+>> + =A0(push-mark)\r
+>\r
+> Is message-cite-original guaranteed to leave point in a reasonable\r
+> place for this or should we create our own marker above (probably\r
+> after the if re-search-backward..) and use it here to get point to the\r
+> right place?\r
+\r
+In my experience, it leaves the point at the end of the quoted region,\r
+but the documentation doesn't make any guarantees. Probably safer to\r
+set a marker.\r