From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 00BA3431FAF for ; Wed, 18 Jan 2012 09:33:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F+IWbFQ2lbSs for ; Wed, 18 Jan 2012 09:33:19 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 59ED6431FAE for ; Wed, 18 Jan 2012 09:33:19 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so59812wgb.2 for ; Wed, 18 Jan 2012 09:33:18 -0800 (PST) Received: by 10.180.99.232 with SMTP id et8mr32826305wib.8.1326907998080; Wed, 18 Jan 2012 09:33:18 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id t15sm19818040wiv.6.2012.01.18.09.33.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 09:33:17 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 4905A9FD95; Wed, 18 Jan 2012 17:33:15 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Make the part content available to the mm-inline* checks. Date: Wed, 18 Jan 2012 17:33:13 +0000 Message-Id: <1326907993-11054-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 17:33:20 -0000 The `mm-inlinable-p' and `mm-inlined-p' functions work better if they have access to the data of the relevant part, so load that content before calling either function. This fixes the display of attached image/jpeg parts, for example. --- I dropped this on the floor after discussing it in #notmuch, sorry! emacs/notmuch-show.el | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 2df8d3b..71309c3 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -330,14 +330,17 @@ current buffer, if possible." (with-temp-buffer (let* ((charset (plist-get part :content-charset)) (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset))))) - (if (and (mm-inlinable-p handle) - (mm-inlined-p handle)) - (let ((content (notmuch-show-get-bodypart-content msg part nth))) - (insert content) - (set-buffer display-buffer) - (mm-display-part handle) - t) - nil))))) + (insert (notmuch-show-get-bodypart-content msg part nth)) + (when (and (mm-inlinable-p handle) + (mm-inlined-p handle)) + (set-buffer display-buffer) + + ;; Nonsense required to have the new gnus `shr' HTML + ;; display code work. + (let ((gnus-inhibit-images nil)) + (makunbound 'gnus-summary-buffer) ; Blech. + (mm-display-part handle)) + t))))) (defvar notmuch-show-multipart/alternative-discouraged '( -- 1.7.8.3