[PATCH v2] emacs: Make the part content available to the mm-inline* checks.

David Edmondson dme at dme.org
Wed Jan 18 09:39:31 PST 2012


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



More information about the notmuch mailing list