(defun mime-display-image (entity situation)
(message "Decoding image...")
(let ((gl (image-normalize (cdr (assq 'image-format situation))
- (with-temp-buffer
- (insert-buffer-substring
- (mime-entity-buffer entity)
- (mime-entity-body-start entity)
- (mime-entity-body-end entity))
- (mime-decode-region
- (point-min)(point-max)
- (mime-entity-encoding entity))
- (buffer-string)))))
+ (mime-entity-content entity))))
(cond ((image-invalid-glyph-p gl)
(setq gl nil)
(message "Invalid glyph!")
((eq (aref gl 0) 'xbm)
(let ((xbm-file
(make-temp-name
- (expand-file-name "tm" mime-temp-directory))))
+ (expand-file-name "tm" temporary-file-directory))))
(with-temp-buffer
(insert (aref gl 2))
(write-region (point-min)(point-max) xbm-file)