Re: alot: can't read sent emails, after encryption
[notmuch-archives.git] / 43 / 3bc380b7d0eba769f5748e085387d34a37ea85
1 Return-Path: <jani@nikula.org>\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 91588431FDC\r
6         for <notmuch@notmuchmail.org>; Mon, 19 Aug 2013 01:38:22 -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 DZq697wWaxWv for <notmuch@notmuchmail.org>;\r
16         Mon, 19 Aug 2013 01:38:15 -0700 (PDT)\r
17 Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com\r
18         [209.85.214.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id CE7C3431FBD\r
21         for <notmuch@notmuchmail.org>; Mon, 19 Aug 2013 01:38:14 -0700 (PDT)\r
22 Received: by mail-bk0-f41.google.com with SMTP id na10so1334627bkb.14\r
23         for <notmuch@notmuchmail.org>; Mon, 19 Aug 2013 01:38:13 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
27         bh=e/LQhyA7rjusE9XyBJ0qgcGNiPMc7WR0DpiIINMgpEk=;\r
28         b=MwuUGhN/2ErSWqOi6qax5FcesD9EPFfBQo8r2/JU57XONDNR3fvO4D8+P5X7FYPWoe\r
29         U2BIOqOsT/81Kc4Hm8Q8JgAFLvLh/PxKU8I2vwz0BXWeMviDPtjuo8dKMEHfqSzjGwDV\r
30         SfsPo8EUDxSjfiI9Umxp9X26GuBnbPe8unwCXN2tKedKakngt8kHG/Gaq/ue3IIlXheR\r
31         kcCR/bDuYtNGHntSgr5cZeq2wC6tpfwEY1HRf5r5GbFVdXGk7wfkpPePOSBi2i25AmJ2\r
32         X+5Cukuxbu2LkHlSsgskALXIrvQ6X+FQxH3ibIyLvzdOxzVMbo3XI/1an8VXSSn4Jj7y\r
33         k10Q==\r
34 X-Gm-Message-State:\r
35  ALoCoQknIJg+P1EgcjWdisQh/UAZIWu1jdhL68FoukG1kvU5tc3cbv0E/zAE5abiAIEVazD9hjW4\r
36 X-Received: by 10.205.10.200 with SMTP id pb8mr7149161bkb.16.1376901493489;\r
37         Mon, 19 Aug 2013 01:38:13 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
39         [88.195.111.91]) by mx.google.com with ESMTPSA id\r
40         if11sm1421624bkc.15.1969.12.31.16.00.00\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Mon, 19 Aug 2013 01:38:12 -0700 (PDT)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH] emacs: insert quotable parts in reply as they are displayed\r
46         in show view\r
47 Date: Mon, 19 Aug 2013 11:38:15 +0300\r
48 Message-Id: <1376901495-17349-1-git-send-email-jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.10.4\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Mon, 19 Aug 2013 08:38:22 -0000\r
63 \r
64 In reply, insert quotable parts using notmuch-show-insert-bodypart\r
65 instead of calling notmuch-mm-display-part-inline directly to render\r
66 the quoted parts as they are rendered in show view.\r
67 \r
68 The notable change is that replies to text/calendar parts quote the\r
69 pretty printed output of icalendar-import-buffer rather than the ugly\r
70 raw vcalendar.\r
71 ---\r
72  emacs/notmuch-mua.el  |    7 ++++---\r
73  emacs/notmuch-show.el |    9 ++++++---\r
74  2 files changed, 10 insertions(+), 6 deletions(-)\r
75 \r
76 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
77 index 2baae5f..24b0d0f 100644\r
78 --- a/emacs/notmuch-mua.el\r
79 +++ b/emacs/notmuch-mua.el\r
80 @@ -130,9 +130,10 @@ list."\r
81  (defun notmuch-mua-insert-quotable-part (message part)\r
82    (save-restriction\r
83      (narrow-to-region (point) (point))\r
84 -    (notmuch-mm-display-part-inline message part (plist-get part :id)\r
85 -                                   (plist-get part :content-type)\r
86 -                                   notmuch-show-process-crypto)\r
87 +    ;; We don't want hooks, such as notmuch-wash-*, to be run on the\r
88 +    ;; quotable part.\r
89 +    (let ((notmuch-show-insert-text/plain-hook nil))\r
90 +      (notmuch-show-insert-bodypart message part 0 nil t))\r
91      (goto-char (point-max))))\r
92  \r
93  ;; There is a bug in emacs 23's message.el that results in a newline\r
94 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
95 index 82b70ba..1fb48aa 100644\r
96 --- a/emacs/notmuch-show.el\r
97 +++ b/emacs/notmuch-show.el\r
98 @@ -874,7 +874,7 @@ message at DEPTH in the current thread."\r
99        ;; showable this returns nil.\r
100        (notmuch-show-create-part-overlays button part-beg part-end))))\r
101  \r
102 -(defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
103 +(defun notmuch-show-insert-bodypart (msg part depth &optional hide quote)\r
104    "Insert the body part PART at depth DEPTH in the current thread.\r
105  \r
106  If HIDE is non-nil then initially hide this part."\r
107 @@ -887,8 +887,11 @@ If HIDE is non-nil then initially hide this part."\r
108                         content-type))\r
109          (nth (plist-get part :id))\r
110          (beg (point))\r
111 -        ;; We omit the part button for the first (or only) part if this is text/plain.\r
112 -        (button (unless (and (string= mime-type "text/plain") (<= nth 1))\r
113 +        ;; We omit the part button for the first (or only) part if\r
114 +        ;; this is text/plain, or we're inserting the part for\r
115 +        ;; quoting in reply.\r
116 +        (button (unless (or quote\r
117 +                            (and (string= mime-type "text/plain") (<= nth 1)))\r
118                    (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))\r
119          (content-beg (point)))\r
120  \r
121 -- \r
122 1.7.10.4\r
123 \r