Re: [PATCH v2] emacs: insert quotable parts in reply as they are displayed in show...
authorAustin Clements <amdragon@MIT.EDU>
Fri, 30 Aug 2013 17:18:07 +0000 (13:18 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:46 +0000 (09:56 -0800)
c7/721d6f8e3d4fb91350e8126aa0ede6cf76078d [new file with mode: 0644]

diff --git a/c7/721d6f8e3d4fb91350e8126aa0ede6cf76078d b/c7/721d6f8e3d4fb91350e8126aa0ede6cf76078d
new file mode 100644 (file)
index 0000000..d875878
--- /dev/null
@@ -0,0 +1,131 @@
+Return-Path: <amdragon@mit.edu>\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 5BF93431FD2\r
+       for <notmuch@notmuchmail.org>; Sun,  1 Sep 2013 00:14:03 -0700 (PDT)\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 rZQswIS7T7Be for <notmuch@notmuchmail.org>;\r
+       Sun,  1 Sep 2013 00:13:55 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4AD58407BC7\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Aug 2013 10:18:16 -0700 (PDT)\r
+X-AuditID: 1209190d-b7f078e000000937-46-5220d3d4a619\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id B1.25.02359.4D3D0225; Fri, 30 Aug 2013 13:18:12 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r7UHIA8h005553; \r
+       Fri, 30 Aug 2013 13:18:11 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7UHI73T028805\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+       Fri, 30 Aug 2013 13:18:09 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1VFSKl-0003MR-Gg; Fri, 30 Aug 2013 13:18:07 -0400\r
+Date: Fri, 30 Aug 2013 13:18:07 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH v2] emacs: insert quotable parts in reply as they are\r
+       displayed in show view\r
+Message-ID: <20130830171807.GB20236@mit.edu>\r
+References: <1377633044-22044-1-git-send-email-jani@nikula.org>\r
+       <1377791611-29506-1-git-send-email-jani@nikula.org>\r
+       <87ppsvp1i9.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87ppsvp1i9.fsf@qmul.ac.uk>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA01SW0hTYRzv2znbzuZOHI+an7pKhpGYc1ZSi0JkFoz1ooIvQeSZ+9xGu3XO\r
+       XGqEYiC2wjQDdaZoKuYy1KyVL5ZTCI2gtPBG+qJiWkGC0UNK5zhvb7//97t9NwKjn4pjCavD\r
+       jVgHY1NJ5DgtTT+u/jIRn5M63arUltdlap81KbST0w2Y9kdXszgD1w/4vkn1w+utuH5mflWq\r
+       X/LPYFn4FfkFE7JZPYjVpOfJLd7yfszVHl70arEZLwOTpBcQBKTS4PCIzgtkPDwEP831SLxA\r
+       TtDUIIBjwfui0NAHYG3NKBYaPojgcs2UNDS0AxhYWMYFP04dg/dez21hCZUIA287gYAjqWQ4\r
+       G2yRChijEOyYXRUJOIIywof++i0NyWvKF/5sN9QC2D3g2ybC4WjDAh4yJ8Gpze8iYd8YFQc7\r
+       NwlhWcZ3dTxZ2sqPohLgo9GApBrQvn1u3z63b8/dAjA/OGyyl6jtjNXGoXw1l884HIhVn0qx\r
+       W90pyFT4AgjXL4sh34BfQ6ogoAigUpB5HfE5tJjxcMX2IIghRKoo8vxnfumg0WkqtjCc5Rpb\r
+       aENcEEACU0WSv9t4jjQxxSWIde5QcQSuiiYXFz9m05SZcaPrCLkQu8MqCUIFyQT+yelwFplR\r
+       UYHV5t6jRYRMCFfw4ZGChuRcjJ2zmkP8GDhN/OtqWgPE4J3mNUDjDqcDxUaTYYKUEqSWQsdu\r
+       2s4HWwHR/OEiyI1xXqXgv99u3gpfJeKrqp1HhCo3s0fFloESZbcT16aCbG9BxcStpquGizF1\r
+       qXMRmYn95xqnlLoKCEx5a+Mpz3PfMZWlRs3tXHHD0IrxbvaAverGfL2hB19PPBp4sNxYcPOn\r
+       7m+vOv2l2X827ERlWsWlrsBlg+eMIstjq2LaSzUbUY+TDxj62nondK73X8W9s2MjGiWZocI5\r
+       C3MyCWM55j/TLyYvOwMAAA==\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>, 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: Sun, 01 Sep 2013 07:14:03 -0000\r
+\r
+Quoth Mark Walters on Aug 30 at  5:49 pm:\r
+> \r
+> > In reply, insert quotable parts using notmuch-show-insert-bodypart\r
+> > instead of calling notmuch-mm-display-part-inline directly to render\r
+> > the quoted parts as they are rendered in show view.\r
+> >\r
+> > The notable change is that replies to text/calendar parts quote the\r
+> > pretty printed output of icalendar-import-buffer rather than the ugly\r
+> > raw vcalendar.\r
+> \r
+> I slightly worry that some text-properties or similar from notmuch-show\r
+> could make their way into the reply buffer: in particular it would be\r
+> very bad if any invisible character made it into the buffer. I don't\r
+> think this is actually a problem currently but just in case (and to\r
+> avoid future problems) how about the following on top of the parent\r
+> patch?\r
+\r
+I haven't tested this, but I like the idea.  It won't actually help\r
+with invisible text (though we could fix that in the future if\r
+necessary), but there are plenty of other properties and overlays you\r
+wouldn't want bleeding into the reply buffer.  This puts a clear wall\r
+between the potentially interactive but read-only show output and the\r
+plain but editable reply text.\r
+\r
+> Best wishes\r
+> \r
+> Mark\r
+> \r
+> ---\r
+>  emacs/notmuch-mua.el |    8 +++++---\r
+>  1 files changed, 5 insertions(+), 3 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> index e7cc94e..9e4a232 100644\r
+> --- a/emacs/notmuch-mua.el\r
+> +++ b/emacs/notmuch-mua.el\r
+> @@ -134,9 +134,11 @@ list."\r
+>      (narrow-to-region (point-min) (point))\r
+>      ;; We don't want hooks, such as notmuch-wash-*, to be run on the\r
+>      ;; quotable part.\r
+> -    (let ((notmuch-show-insert-text/plain-hook nil))\r
+> -      ;; Show the part but do not add buttons.\r
+> -      (notmuch-show-insert-bodypart message part 0 'no-buttons))\r
+> +    (insert (with-temp-buffer\r
+> +          (let ((notmuch-show-insert-text/plain-hook nil))\r
+> +            ;; Show the part but do not add buttons.\r
+> +            (notmuch-show-insert-bodypart message part 0 'no-buttons))\r
+> +          (buffer-substring-no-properties (point-min) (point-max))))\r
+>      (goto-char (point-max))))\r
+>  \r
+>  ;; There is a bug in emacs 23's message.el that results in a newline\r