unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: Make the part content available to `mm-inlinable-p'.
Date: Thu, 19 Jan 2012 13:37:33 +0400	[thread overview]
Message-ID: <87boq06nj6.fsf@gmail.com> (raw)
In-Reply-To: <1326965647-1222-1-git-send-email-dme@dme.org>

[and again with reply to all]

On Thu, 19 Jan 2012 09:34:07 +0000, David Edmondson <dme@dme.org> 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

  reply	other threads:[~2012-01-19  9:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 17:33 [PATCH] emacs: Make the part content available to the mm-inline* checks David Edmondson
2012-01-18 17:35 ` David Edmondson
2012-01-18 17:39 ` [PATCH v2] " David Edmondson
2012-01-18 18:04   ` Dmitry Kurochkin
2012-01-18 18:30     ` David Edmondson
2012-01-18 19:00       ` Dmitry Kurochkin
2012-01-18 19:35         ` Austin Clements
2012-01-18 19:59           ` Dmitry Kurochkin
2012-01-20 20:13           ` Jameson Graef Rollins
2012-01-23  8:00             ` David Edmondson
2012-01-19  7:39         ` David Edmondson
2012-01-19  9:23           ` Dmitry Kurochkin
2012-01-19  9:34             ` [PATCH] emacs: Make the part content available to `mm-inlinable-p' David Edmondson
2012-01-19  9:37               ` Dmitry Kurochkin [this message]
2012-01-19 17:31               ` Aaron Ecay
2012-01-20 14:18               ` Tomi Ollila
2012-01-20 20:04               ` Jameson Graef Rollins
2012-01-23  8:02                 ` David Edmondson
2012-01-26 12:28               ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87boq06nj6.fsf@gmail.com \
    --to=dmitry.kurochkin@gmail.com \
    --cc=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).