X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=4cc5aa57d91cc204b2800bf8e38c75f057231dc5;hb=refs%2Ftags%2F0.38.1_pre0;hp=54cf00c6392128c10f45499b78a02ee7525de0ff;hpb=0646d4855bff8b1f7ab10d5207cd66c9e75ea810;p=notmuch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 54cf00c6..4cc5aa57 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -644,8 +644,24 @@ message at DEPTH in the current thread." (when show (button-put button :notmuch-lazy-part nil) (notmuch-show-lazy-part lazy-part button)) - ;; else there must be an overlay. - (overlay-put overlay 'invisible (not show)) + (let* ((part (plist-get properties :notmuch-part)) + (undisplayer (plist-get part :undisplayer)) + (mime-type (plist-get part :computed-type)) + (redisplay-data (button-get button + :notmuch-redisplay-data)) + (imagep (string-match "^image/" mime-type))) + (cond + ((and imagep (not show) undisplayer) + ;; call undisplayer thunk created by gnus. + (funcall undisplayer) + ;; there is an extra newline left + (delete-region + (+ 1 (button-end button)) + (+ 2 (button-end button)))) + ((and imagep show redisplay-data) + (notmuch-show-lazy-part redisplay-data button)) + (t + (overlay-put overlay 'invisible (not show))))) t))))))) ;;; Part content ID handling