X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;fp=emacs%2Fnotmuch-show.el;h=54cf00c6392128c10f45499b78a02ee7525de0ff;hb=0646d4855bff8b1f7ab10d5207cd66c9e75ea810;hp=107ce1b8bd2716a815216d50e649cdd4cac3b9dc;hpb=bfcfa947f8a989594d73a40a056cbb0bd37188ab;p=notmuch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 107ce1b8..54cf00c6 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1109,14 +1109,18 @@ is t, hide the part initially and show the button." (and deep button) (and high button) (and long button)))) - (content-beg (point))) + (content-beg (point)) + (part-data (list msg part mime-type nth depth button))) ;; Store the computed mime-type for later use (e.g. by attachment handlers). (plist-put part :computed-type mime-type) - (if show-part - (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button) + (cond + (show-part + (apply #'notmuch-show-insert-bodypart-internal part-data) + (when (and button (string-match "^image/" mime-type)) + (button-put button :notmuch-redisplay-data part-data))) + (t (when button - (button-put button :notmuch-lazy-part - (list msg part mime-type nth depth button)))) + (button-put button :notmuch-lazy-part part-data)))) ;; Some of the body part handlers leave point somewhere up in the ;; part, so we make sure that we're down at the end. (goto-char (point-max))