(cdr (or (assq major-mode mime-raw-representation-type-alist)
(assq t mime-raw-representation-type-alist))))))
-(defsubst mime-entity-cooked-p (entity)
- (eq (mime-entity-representation-type entity) 'cooked))
-
(defun mime-entity-situation (entity)
"Return situation of ENTITY."
(append (or (mime-entity-content-type entity)
)))
(defun mime-view-buffer (&optional raw-buffer preview-buffer mother
- default-keymap-or-function)
+ default-keymap-or-function
+ representation-type)
+ "View RAW-BUFFER in MIME-View mode.
+Optional argument PREVIEW-BUFFER is either nil or a name of preview
+buffer.
+Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
+function. If it is a keymap, keymap of MIME-View mode will be added
+to it. If it is a function, it will be bound as default binding of
+keymap of MIME-View mode.
+Optional argument REPRESENTATION-TYPE is representation-type of
+message. It must be nil, `binary' or `cooked'. If it is nil,
+`binary' is used as default."
(interactive)
+ (or raw-buffer
+ (setq raw-buffer (current-buffer)))
+ (or representation-type
+ (setq representation-type
+ (save-excursion
+ (set-buffer raw-buffer)
+ (cdr (or (assq major-mode mime-raw-representation-type-alist)
+ (assq t mime-raw-representation-type-alist)))
+ )))
+ (if (eq representation-type 'binary)
+ (setq representation-type 'buffer)
+ )
(mime-display-message
- (mime-parse-buffer raw-buffer)
+ (mime-open-entity representation-type raw-buffer)
preview-buffer mother default-keymap-or-function))
(defun mime-view-mode (&optional mother ctl encoding
and decode current content as `play mode'
"
(interactive)
- (let ((message
- (save-excursion
- (if raw-buffer (set-buffer raw-buffer))
- (or mime-view-redisplay
- (setq mime-message-structure (mime-parse-message ctl)))
- )))
- (or (mime-entity-encoding message)
- (mime-entity-set-encoding-internal message encoding))
- (mime-display-message message preview-buffer
- mother default-keymap-or-function)
- ))
+ (unless mime-view-redisplay
+ (save-excursion
+ (if raw-buffer (set-buffer raw-buffer))
+ (let ((type
+ (cdr
+ (or (assq major-mode mime-raw-representation-type-alist)
+ (assq t mime-raw-representation-type-alist)))))
+ (if (eq type 'binary)
+ (setq type 'buffer)
+ )
+ (setq mime-message-structure (mime-open-entity type raw-buffer))
+ (or (mime-entity-content-type mime-message-structure)
+ (mime-entity-set-content-type-internal
+ mime-message-structure ctl))
+ )
+ (or (mime-entity-encoding mime-message-structure)
+ (mime-entity-set-encoding-internal mime-message-structure encoding))
+ ))
+ (mime-display-message mime-message-structure preview-buffer
+ mother default-keymap-or-function)
+ )
;;; @@ playing