Re: [PATCH 2/3] show: output Reply-To headers
[notmuch-archives.git] / f5 / 01b6c369c73ebf946fb262b65d4e843e8484d5
1 Return-Path: <dme@dme.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 00BA3431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:33:20 -0800 (PST)\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 F+IWbFQ2lbSs for <notmuch@notmuchmail.org>;\r
16         Wed, 18 Jan 2012 09:33:19 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  59ED6431FAE    for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:33:19 -0800\r
21  (PST)\r
22 Received: by wgbdt12 with SMTP id dt12so59812wgb.2\r
23         for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:33:18 -0800 (PST)\r
24 Received: by 10.180.99.232 with SMTP id et8mr32826305wib.8.1326907998080;\r
25         Wed, 18 Jan 2012 09:33:18 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id t15sm19818040wiv.6.2012.01.18.09.33.16\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Wed, 18 Jan 2012 09:33:17 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 4905A9FD95; Wed, 18 Jan 2012 17:33:15 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH] emacs: Make the part content available to the mm-inline*\r
36         checks.\r
37 Date: Wed, 18 Jan 2012 17:33:13 +0000\r
38 Message-Id: <1326907993-11054-1-git-send-email-dme@dme.org>\r
39 X-Mailer: git-send-email 1.7.8.3\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Wed, 18 Jan 2012 17:33:20 -0000\r
53 \r
54 The `mm-inlinable-p' and `mm-inlined-p' functions work better if they\r
55 have access to the data of the relevant part, so load that content\r
56 before calling either function.\r
57 \r
58 This fixes the display of attached image/jpeg parts, for example.\r
59 ---\r
60 \r
61 I dropped this on the floor after discussing it in #notmuch, sorry!\r
62 \r
63  emacs/notmuch-show.el |   19 +++++++++++--------\r
64  1 files changed, 11 insertions(+), 8 deletions(-)\r
65 \r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
67 index 2df8d3b..71309c3 100644\r
68 --- a/emacs/notmuch-show.el\r
69 +++ b/emacs/notmuch-show.el\r
70 @@ -330,14 +330,17 @@ current buffer, if possible."\r
71      (with-temp-buffer\r
72        (let* ((charset (plist-get part :content-charset))\r
73              (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))\r
74 -       (if (and (mm-inlinable-p handle)\r
75 -                (mm-inlined-p handle))\r
76 -           (let ((content (notmuch-show-get-bodypart-content msg part nth)))\r
77 -             (insert content)\r
78 -             (set-buffer display-buffer)\r
79 -             (mm-display-part handle)\r
80 -             t)\r
81 -         nil)))))\r
82 +       (insert (notmuch-show-get-bodypart-content msg part nth))\r
83 +       (when (and (mm-inlinable-p handle)\r
84 +                  (mm-inlined-p handle))\r
85 +         (set-buffer display-buffer)\r
86 +\r
87 +         ;; Nonsense required to have the new gnus `shr' HTML\r
88 +         ;; display code work.\r
89 +         (let ((gnus-inhibit-images nil))\r
90 +           (makunbound 'gnus-summary-buffer) ; Blech.\r
91 +           (mm-display-part handle))\r
92 +         t)))))\r
93  \r
94  (defvar notmuch-show-multipart/alternative-discouraged\r
95    '(\r
96 -- \r
97 1.7.8.3\r
98 \r