Re: [PATCH v2] emacs: insert quotable parts in reply as they are displayed in show...
[notmuch-archives.git] / c7 / 721d6f8e3d4fb91350e8126aa0ede6cf76078d
1 Return-Path: <amdragon@mit.edu>\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 5BF93431FD2\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Sep 2013 00:14:03 -0700 (PDT)\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 rZQswIS7T7Be for <notmuch@notmuchmail.org>;\r
16         Sun,  1 Sep 2013 00:13:55 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4AD58407BC7\r
20         for <notmuch@notmuchmail.org>; Fri, 30 Aug 2013 10:18:16 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7f078e000000937-46-5220d3d4a619\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id B1.25.02359.4D3D0225; Fri, 30 Aug 2013 13:18:12 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r7UHIA8h005553; \r
27         Fri, 30 Aug 2013 13:18:11 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7UHI73T028805\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Fri, 30 Aug 2013 13:18:09 -0400\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1VFSKl-0003MR-Gg; Fri, 30 Aug 2013 13:18:07 -0400\r
37 Date: Fri, 30 Aug 2013 13:18:07 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH v2] emacs: insert quotable parts in reply as they are\r
41         displayed in show view\r
42 Message-ID: <20130830171807.GB20236@mit.edu>\r
43 References: <1377633044-22044-1-git-send-email-jani@nikula.org>\r
44         <1377791611-29506-1-git-send-email-jani@nikula.org>\r
45         <87ppsvp1i9.fsf@qmul.ac.uk>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 Content-Disposition: inline\r
49 In-Reply-To: <87ppsvp1i9.fsf@qmul.ac.uk>\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)\r
51 X-Brightmail-Tracker:\r
52  H4sIAAAAAAAAA01SW0hTYRzv2znbzuZOHI+an7pKhpGYc1ZSi0JkFoz1ooIvQeSZ+9xGu3XO\r
53         XGqEYiC2wjQDdaZoKuYy1KyVL5ZTCI2gtPBG+qJiWkGC0UNK5zhvb7//97t9NwKjn4pjCavD\r
54         jVgHY1NJ5DgtTT+u/jIRn5M63arUltdlap81KbST0w2Y9kdXszgD1w/4vkn1w+utuH5mflWq\r
55         X/LPYFn4FfkFE7JZPYjVpOfJLd7yfszVHl70arEZLwOTpBcQBKTS4PCIzgtkPDwEP831SLxA\r
56         TtDUIIBjwfui0NAHYG3NKBYaPojgcs2UNDS0AxhYWMYFP04dg/dez21hCZUIA287gYAjqWQ4\r
57         G2yRChijEOyYXRUJOIIywof++i0NyWvKF/5sN9QC2D3g2ybC4WjDAh4yJ8Gpze8iYd8YFQc7\r
58         NwlhWcZ3dTxZ2sqPohLgo9GApBrQvn1u3z63b8/dAjA/OGyyl6jtjNXGoXw1l884HIhVn0qx\r
59         W90pyFT4AgjXL4sh34BfQ6ogoAigUpB5HfE5tJjxcMX2IIghRKoo8vxnfumg0WkqtjCc5Rpb\r
60         aENcEEACU0WSv9t4jjQxxSWIde5QcQSuiiYXFz9m05SZcaPrCLkQu8MqCUIFyQT+yelwFplR\r
61         UYHV5t6jRYRMCFfw4ZGChuRcjJ2zmkP8GDhN/OtqWgPE4J3mNUDjDqcDxUaTYYKUEqSWQsdu\r
62         2s4HWwHR/OEiyI1xXqXgv99u3gpfJeKrqp1HhCo3s0fFloESZbcT16aCbG9BxcStpquGizF1\r
63         qXMRmYn95xqnlLoKCEx5a+Mpz3PfMZWlRs3tXHHD0IrxbvaAverGfL2hB19PPBp4sNxYcPOn\r
64         7m+vOv2l2X827ERlWsWlrsBlg+eMIstjq2LaSzUbUY+TDxj62nondK73X8W9s2MjGiWZocI5\r
65         C3MyCWM55j/TLyYvOwMAAA==\r
66 Cc: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
67 X-BeenThere: notmuch@notmuchmail.org\r
68 X-Mailman-Version: 2.1.13\r
69 Precedence: list\r
70 List-Id: "Use and development of the notmuch mail system."\r
71         <notmuch.notmuchmail.org>\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
75 List-Post: <mailto:notmuch@notmuchmail.org>\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
78         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
79 X-List-Received-Date: Sun, 01 Sep 2013 07:14:03 -0000\r
80 \r
81 Quoth Mark Walters on Aug 30 at  5:49 pm:\r
82\r
83 > > In reply, insert quotable parts using notmuch-show-insert-bodypart\r
84 > > instead of calling notmuch-mm-display-part-inline directly to render\r
85 > > the quoted parts as they are rendered in show view.\r
86 > >\r
87 > > The notable change is that replies to text/calendar parts quote the\r
88 > > pretty printed output of icalendar-import-buffer rather than the ugly\r
89 > > raw vcalendar.\r
90\r
91 > I slightly worry that some text-properties or similar from notmuch-show\r
92 > could make their way into the reply buffer: in particular it would be\r
93 > very bad if any invisible character made it into the buffer. I don't\r
94 > think this is actually a problem currently but just in case (and to\r
95 > avoid future problems) how about the following on top of the parent\r
96 > patch?\r
97 \r
98 I haven't tested this, but I like the idea.  It won't actually help\r
99 with invisible text (though we could fix that in the future if\r
100 necessary), but there are plenty of other properties and overlays you\r
101 wouldn't want bleeding into the reply buffer.  This puts a clear wall\r
102 between the potentially interactive but read-only show output and the\r
103 plain but editable reply text.\r
104 \r
105 > Best wishes\r
106\r
107 > Mark\r
108\r
109 > ---\r
110 >  emacs/notmuch-mua.el |    8 +++++---\r
111 >  1 files changed, 5 insertions(+), 3 deletions(-)\r
112\r
113 > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
114 > index e7cc94e..9e4a232 100644\r
115 > --- a/emacs/notmuch-mua.el\r
116 > +++ b/emacs/notmuch-mua.el\r
117 > @@ -134,9 +134,11 @@ list."\r
118 >      (narrow-to-region (point-min) (point))\r
119 >      ;; We don't want hooks, such as notmuch-wash-*, to be run on the\r
120 >      ;; quotable part.\r
121 > -    (let ((notmuch-show-insert-text/plain-hook nil))\r
122 > -      ;; Show the part but do not add buttons.\r
123 > -      (notmuch-show-insert-bodypart message part 0 'no-buttons))\r
124 > +    (insert (with-temp-buffer\r
125 > +           (let ((notmuch-show-insert-text/plain-hook nil))\r
126 > +             ;; Show the part but do not add buttons.\r
127 > +             (notmuch-show-insert-bodypart message part 0 'no-buttons))\r
128 > +           (buffer-substring-no-properties (point-min) (point-max))))\r
129 >      (goto-char (point-max))))\r
130 >  \r
131 >  ;; There is a bug in emacs 23's message.el that results in a newline\r