Re: [PATCH v4 09/16] index encrypted parts when asked.
[notmuch-archives.git] / d1 / 2b7188941ae3f32beac82c5f76a898c5f3723a
1 Return-Path: <markwalters1009@gmail.com>\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 E4C1B431FDC\r
6         for <notmuch@notmuchmail.org>; Sat,  4 May 2013 06:01:37 -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.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id uDe3ueVzlkbw for <notmuch@notmuchmail.org>;\r
18         Sat,  4 May 2013 06:01:33 -0700 (PDT)\r
19 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
20  [74.125.82.41])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  266E9431FBC    for <notmuch@notmuchmail.org>; Sat,  4 May 2013 06:01:30 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f41.google.com with SMTP id y10so1469269wgg.2\r
25         for <notmuch@notmuchmail.org>; Sat, 04 May 2013 06:01:29 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references; bh=+5bHoQkju9hjtsqoot94GVCpbkWLkKiOxO701YFRpWQ=;\r
29         b=O1e9YhwJpNJwY3uKcxL6U3Z+LqDKTeSvkEu1xDDkjbBU/kaNfq5KrwKyaPR7Apuy7d\r
30         n1HQYR0NcJnQe7SolQIXZ5uNFbiiIIiqoeAguHKToPBb4Jyc9L72/TrH88uFnz+M8Gqp\r
31         x85bFBuS32fgMaSCdbhnvweUw4i2mRKD5tEbUcFRvpJTbPjhTIqgDyr0gsQqccsCm2pM\r
32         o/Y4frSe6C57LZuO3bN5qgzfFTaXmXV6nIRd3ol69tSjrXNdnKNKb9f9jleD2dFapvZU\r
33         L9BQUg/jwjhhgd3dc58p0OvBE3fpICyHtgtvApD0mJqNvUrwMfi2FzefxaEYsmOA5I/8\r
34         GgZQ==\r
35 X-Received: by 10.194.62.18 with SMTP id u18mr18082928wjr.53.1367672489106;\r
36         Sat, 04 May 2013 06:01:29 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id ek7sm2797774wic.4.2013.05.04.06.01.27\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sat, 04 May 2013 06:01:28 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 2/4] emacs: show: handle inline patch fake parts at top level\r
45 Date: Sat,  4 May 2013 14:01:15 +0100\r
46 Message-Id: <1367672478-12247-3-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>\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: Sat, 04 May 2013 13:01:38 -0000\r
63 \r
64 The inline patch fake part handler also modifies the content-type so\r
65 handle this in notmuch-show-insert-bodypart too.\r
66 ---\r
67  emacs/notmuch-show.el |    4 +++-\r
68  emacs/notmuch-wash.el |    2 +-\r
69  2 files changed, 4 insertions(+), 2 deletions(-)\r
70 \r
71 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
72 index 3b9a2ad..f984143 100644\r
73 --- a/emacs/notmuch-show.el\r
74 +++ b/emacs/notmuch-show.el\r
75 @@ -814,7 +814,7 @@ message at DEPTH in the current thread."\r
76  \r
77  ;; Handler for wash generated inline patch fake parts.\r
78  (defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)\r
79 -  (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))\r
80 +  (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type))\r
81  \r
82  (defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)\r
83    ;; text/html handler to work around bugs in renderers and our\r
84 @@ -888,6 +888,8 @@ If HIDE is non-nil then initially hide this part."\r
85    (let* ((content-type (downcase (plist-get part :content-type)))\r
86          (mime-type (or (and (string= content-type "application/octet-stream")\r
87                              (notmuch-show-get-mime-type-of-application/octet-stream part))\r
88 +                       (and (string= content-type "inline patch")\r
89 +                            "text/x-diff")\r
90                         content-type))\r
91          (nth (plist-get part :id))\r
92          (beg (point)))\r
93 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
94 index 80c475c..8a68819 100644\r
95 --- a/emacs/notmuch-wash.el\r
96 +++ b/emacs/notmuch-wash.el\r
97 @@ -365,7 +365,7 @@ for error."\r
98           (setq patch-end (match-beginning 0)))\r
99        (save-restriction\r
100         (narrow-to-region patch-start patch-end)\r
101 -       (setq part (plist-put part :content-type "inline-patch-fake-part"))\r
102 +       (setq part (plist-put part :content-type "inline patch"))\r
103         (setq part (plist-put part :content (buffer-string)))\r
104         (setq part (plist-put part :id -1))\r
105         (setq part (plist-put part :filename\r
106 -- \r
107 1.7.9.1\r
108 \r