Re: BUG: bad notmuch shared library install_name on Mac OS X
[notmuch-archives.git] / 85 / a1890e1e10839fbb4c3abde73b34b94028894d
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 8F281431FC0\r
6         for <notmuch@notmuchmail.org>; Wed, 31 Jul 2013 11:39:26 -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 RKSg4g+qmZU2 for <notmuch@notmuchmail.org>;\r
18         Wed, 31 Jul 2013 11:39:19 -0700 (PDT)\r
19 Received: from mail-we0-f172.google.com (mail-we0-f172.google.com\r
20         [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id D15D3431FBF\r
23         for <notmuch@notmuchmail.org>; Wed, 31 Jul 2013 11:39:18 -0700 (PDT)\r
24 Received: by mail-we0-f172.google.com with SMTP id t61so945022wes.31\r
25         for <notmuch@notmuchmail.org>; Wed, 31 Jul 2013 11:39:16 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=F6YaVJyFKGrwFVqM6vL3c/UQZaCw/ykxLo8nl1wCiw8=;\r
29         b=Egvf8eH0qbTuADp4UoOTzgBXoU5zsnVuJHawz0JXHHNnF4GUgGACxCyEmewGQHIcju\r
30         TuzXA2nrbWbpG7v03w5E28WuPYVlAaxk9qLWm2fHf4GGA5woRk3hRqToyEDYTSno5zj5\r
31         +JDWMlymQAvP7l6gW0O1nVSCRVJqUFYM1JVRfF1uSgHls0M1KPD66l+hrQjSNe/r8BkK\r
32         xY/q+ZSaywmf4YkLBbXw2c1ErifSSuRDJuWHyb5f/yARFtzI9k7Kg84otwXdAZPBGxDR\r
33         gkSiMVA7KxLFKecD48ASIGEAziQrsP1QIu8HcyMnAA8rhEndaFepkDw5dILfqgAtEpl9\r
34         7tPA==\r
35 X-Received: by 10.180.185.97 with SMTP id fb1mr197662wic.61.1375295955157;\r
36         Wed, 31 Jul 2013 11:39:15 -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 u9sm29541wif.6.2013.07.31.11.39.13\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Wed, 31 Jul 2013 11:39:14 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v2] emacs: bugfix attachment content-type as mime-type\r
45  handling\r
46 Date: Wed, 31 Jul 2013 19:39:05 +0100\r
47 Message-Id: <1375295945-30006-1-git-send-email-markwalters1009@gmail.com>\r
48 X-Mailer: git-send-email 1.7.9.1\r
49 In-Reply-To: <20130731022529.GU2214@mit.edu>\r
50 References: <20130731022529.GU2214@mit.edu>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Wed, 31 Jul 2013 18:39:26 -0000\r
64 \r
65 Notmuch puts attachments in as declared content-type except when the\r
66 content-type is application/octet-stream it tries to guess the type\r
67 from the filename/extension. This means that viewing a pdf (for\r
68 example) which is sent as application/octet-strem invokes the pdf\r
69 viewer rather than just offering to save the part.\r
70 \r
71 Recent changes to the attachment handling (commit 1546387d) changed\r
72 (broke) this. This patch stores the calculated mime-type with the part\r
73 and changes the attachment part handlers can use it instead.\r
74 ---\r
75 \r
76 This is the same as v1 except that it uses the name computed-type\r
77 rather than mime-type for the computed mime type.\r
78 \r
79 We may want to change some of the other uses of the mime-type variable\r
80 name too but the view on irc was that that could wait.\r
81 \r
82 Best wishes\r
83 \r
84 Mark\r
85 \r
86 \r
87  emacs/notmuch-show.el |    7 +++++--\r
88  1 files changed, 5 insertions(+), 2 deletions(-)\r
89 \r
90 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
91 index c4e0a99..82b70ba 100644\r
92 --- a/emacs/notmuch-show.el\r
93 +++ b/emacs/notmuch-show.el\r
94 @@ -892,6 +892,9 @@ If HIDE is non-nil then initially hide this part."\r
95                    (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))\r
96          (content-beg (point)))\r
97  \r
98 +    ;; Store the computed mime-type for later use (e.g. by attachment handlers).\r
99 +    (plist-put part :computed-type mime-type)\r
100 +\r
101      (if (not hide)\r
102          (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)\r
103        (button-put button :notmuch-lazy-part\r
104 @@ -2055,10 +2058,10 @@ caller is responsible for killing this buffer as appropriate."\r
105          (message-id (notmuch-show-get-message-id))\r
106          (nth (plist-get part :id))\r
107          (buf (notmuch-show-generate-part-buffer message-id nth))\r
108 -        (content-type (plist-get part :content-type))\r
109 +        (computed-type (plist-get part :computed-type))\r
110          (filename (plist-get part :filename))\r
111          (disposition (if filename `(attachment (filename . ,filename)))))\r
112 -    (mm-make-handle buf (list content-type) nil nil disposition)))\r
113 +    (mm-make-handle buf (list computed-type) nil nil disposition)))\r
114  \r
115  (defun notmuch-show-apply-to-current-part-handle (fn)\r
116    "Apply FN to an mm-handle for the part containing point.\r
117 -- \r
118 1.7.9.1\r
119 \r