Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7689F431FAF for ; Thu, 19 Jan 2012 01:38:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 q1jSV5CqyIVC for ; Thu, 19 Jan 2012 01:38:30 -0800 (PST) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 98A68431FAE for ; Thu, 19 Jan 2012 01:38:30 -0800 (PST) Received: by bkty12 with SMTP id y12so2545422bkt.26 for ; Thu, 19 Jan 2012 01:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=7eXz8qylw5tq+WSowO08Vuh9tcH8WOo9KGFyEwCqIbk=; b=UAZuOO6o8ZmyyaWYSuIaCzjAQ4MysZhCemRcnYKGW+X73AaoHVTMeVOLm5fjRls5BX G3tRJIfJLvFWBaIsJMdgwnmJ2XNh0mv+bJHzxChUIXB/C6sbnSR6b/jWnF9HQMhlN+lD U+pV0qwf0X4TH3ivMWgNDFzRNj29zARh56aC0= Received: by 10.204.152.136 with SMTP id g8mr9655924bkw.127.1326965909123; Thu, 19 Jan 2012 01:38:29 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id sp6sm37370921bkb.2.2012.01.19.01.38.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 01:38:28 -0800 (PST) From: Dmitry Kurochkin To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: Make the part content available to `mm-inlinable-p'. In-Reply-To: <1326965647-1222-1-git-send-email-dme@dme.org> References: <87k44o6o6e.fsf@gmail.com> <1326965647-1222-1-git-send-email-dme@dme.org> User-Agent: Notmuch/0.11+73~g8a5402e (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 19 Jan 2012 13:37:33 +0400 Message-ID: <87boq06nj6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Thu, 19 Jan 2012 09:38:31 -0000 [and again with reply to all] On Thu, 19 Jan 2012 09:34:07 +0000, David Edmondson wrote: > The `mm-inlinable-p' function works better if it has access to the > data of the relevant part, so load that content before calling it. > > Don't load the content for parts that the user has indicated no desire > to inline. > > This fixes the display of attached image/jpeg parts, for example. > --- > > Updated as described in id:"cunboq06szv.fsf@hotblack-desiato.hh.sledj.net". > Looks good to me. Regards, Dmitry > emacs/notmuch-show.el | 17 +++++++++-------- > 1 files changed, 9 insertions(+), 8 deletions(-) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 2df8d3b..7e9c9b4 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -330,14 +330,15 @@ 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))))) > + ;; If the user wants the part inlined, insert the content and > + ;; test whether we are able to inline it (which includes both > + ;; capability and suitability tests). > + (when (mm-inlined-p handle) > + (insert (notmuch-show-get-bodypart-content msg part nth)) > + (when (mm-inlinable-p handle) > + (set-buffer display-buffer) > + (mm-display-part handle) > + t)))))) > > (defvar notmuch-show-multipart/alternative-discouraged > '( > -- > 1.7.8.3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch