Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / db / 305186e420d87573c3b03196f6951752984629
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 7759C431FC0\r
6         for <notmuch@notmuchmail.org>; Tue, 30 Jul 2013 09:15:14 -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 U8p2OVj7dLnx for <notmuch@notmuchmail.org>;\r
18         Tue, 30 Jul 2013 09:15:07 -0700 (PDT)\r
19 Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com\r
20  [74.125.82.48])        (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  C0EC5431FBF    for <notmuch@notmuchmail.org>; Tue, 30 Jul 2013 09:15:06 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f48.google.com with SMTP id f12so5579926wgh.15\r
25         for <notmuch@notmuchmail.org>; Tue, 30 Jul 2013 09:15:05 -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=bcay4ULQWLHUKCBhZdxcsVLmgxszGt+VYI7h+Jg50M0=;\r
29         b=gEHAAhl7t9blskjE83GDa1uSZVyL6Eu/3nSpWRKtvxZZSjWCGN6xwJY9HVFkgfD8GN\r
30         NUkLCajt1mGMy7ZyxyuSpjb+VqFNDS/yY0fBQgTyRnbbEVVwm+mTJwCfBi5ltr0RGYX0\r
31         nNkGHQgbqUDYEfVVHdKY3NoD9uTnwMGg1Sv5PFyataf0iF/rhXwVQkfuGD9VCCqTKseO\r
32         PbfYukNsLMsjN549Ja9sV0nu+zJOJyg3EK+c4359gVnBd0laH11VLnRzyNGsEXgNSHsO\r
33         9dDyije0PgBX+ZGR1959CUbwJuf2CEFspCS4YJ5QsXswC6Jq1prWtFiJv70cpTsg6ecf\r
34         V3wg==\r
35 X-Received: by 10.194.219.198 with SMTP id pq6mr47256898wjc.58.1375200905629; \r
36         Tue, 30 Jul 2013 09:15:05 -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 i1sm29550731wiz.6.2013.07.30.09.15.04\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Tue, 30 Jul 2013 09:15:04 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH] emacs: bugfix attachment content-type as mime-type handling\r
45 Date: Tue, 30 Jul 2013 17:15:00 +0100\r
46 Message-Id: <1375200900-5650-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <87li4om623.fsf@qmul.ac.uk>\r
49 References: <87li4om623.fsf@qmul.ac.uk>\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: Tue, 30 Jul 2013 16:15:14 -0000\r
63 \r
64 Notmuch puts attachments in as declared content-type except when the\r
65 content-type is application/octet-stream it tries to guess the type\r
66 from the filename/extension. This means that viewing a pdf (for\r
67 example) which is sent as application/octet-strem invokes the pdf\r
68 viewer rather than just offering to save the part.\r
69 \r
70 Recent changes to the attachment handling (commit 1546387d) changed\r
71 (broke) this. This patch stores the calculated mime-type with the part\r
72 and changes the attachment part handlers can use it instead.\r
73 ---\r
74 This seems to fix the bug for me. I am not sure I like the naming\r
75 (mime-type/content-type). Maybe it would be better to be explicit with\r
76 something like calculated-content-type but probably that should be a\r
77 more wholesale renaming.\r
78 \r
79 Best wishes\r
80 \r
81 Mark\r
82 \r
83 \r
84  emacs/notmuch-show.el |    7 +++++--\r
85  1 files changed, 5 insertions(+), 2 deletions(-)\r
86 \r
87 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
88 index c4e0a99..9f47f5e 100644\r
89 --- a/emacs/notmuch-show.el\r
90 +++ b/emacs/notmuch-show.el\r
91 @@ -892,6 +892,9 @@ If HIDE is non-nil then initially hide this part."\r
92                    (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))\r
93          (content-beg (point)))\r
94  \r
95 +    ;; Store the calculated mime-type for later use (e.g. by attachment handlers).\r
96 +    (plist-put part :mime-type mime-type)\r
97 +\r
98      (if (not hide)\r
99          (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)\r
100        (button-put button :notmuch-lazy-part\r
101 @@ -2055,10 +2058,10 @@ caller is responsible for killing this buffer as appropriate."\r
102          (message-id (notmuch-show-get-message-id))\r
103          (nth (plist-get part :id))\r
104          (buf (notmuch-show-generate-part-buffer message-id nth))\r
105 -        (content-type (plist-get part :content-type))\r
106 +        (mime-type (plist-get part :mime-type))\r
107          (filename (plist-get part :filename))\r
108          (disposition (if filename `(attachment (filename . ,filename)))))\r
109 -    (mm-make-handle buf (list content-type) nil nil disposition)))\r
110 +    (mm-make-handle buf (list mime-type) nil nil disposition)))\r
111  \r
112  (defun notmuch-show-apply-to-current-part-handle (fn)\r
113    "Apply FN to an mm-handle for the part containing point.\r
114 -- \r
115 1.7.9.1\r
116 \r