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 2DC09431FAF for ; Wed, 18 Jan 2012 09:39:37 -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 gN8swHa3KYBt for ; Wed, 18 Jan 2012 09:39:36 -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 A276B431FAE for ; Wed, 18 Jan 2012 09:39:36 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so66508wgb.2 for ; Wed, 18 Jan 2012 09:39:35 -0800 (PST) Received: by 10.180.19.6 with SMTP id a6mr38488746wie.14.1326908375483; Wed, 18 Jan 2012 09:39:35 -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 di5sm57336768wib.3.2012.01.18.09.39.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 09:39:34 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 98CF29FD95; Wed, 18 Jan 2012 17:39:32 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v2] emacs: Make the part content available to the mm-inline* checks. Date: Wed, 18 Jan 2012 17:39:31 +0000 Message-Id: <1326908371-11949-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1326907993-11054-1-git-send-email-dme@dme.org> References: <1326907993-11054-1-git-send-email-dme@dme.org> 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:39:37 -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. --- Removed the cruft that crept into the previous patch. emacs/notmuch-show.el | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 2df8d3b..f280df2 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -330,14 +330,12 @@ 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) + (mm-display-part handle) + t))))) (defvar notmuch-show-multipart/alternative-discouraged '( -- 1.7.8.3