;;; @ content decoder
;;;
-(defvar mime-preview/after-decoded-position nil)
+(defvar mime-preview-after-decoded-position nil)
-(defun mime-view-play-current-entity (&optional mode)
+(defun mime-preview-play-current-entity (&optional mode)
"Play current entity.
It decodes current entity to call internal or external method. The
method is selected from variable `mime-acting-condition'.
(let ((the-buf (current-buffer))
(raw-buffer (get-text-property (point) 'mime-view-raw-buffer))
)
- (setq mime-preview/after-decoded-position (point))
+ (setq mime-preview-after-decoded-position (point))
(set-buffer raw-buffer)
(mime-playback-entity cinfo mode)
(if (eq (current-buffer) raw-buffer)
(progn
(set-buffer the-buf)
- (goto-char mime-preview/after-decoded-position)
+ (goto-char mime-preview-after-decoded-position)
))
))))
(defun mime-playback-entity (cinfo &optional mode)
(let ((beg (mime-entity-info-point-min cinfo))
(end (mime-entity-info-point-max cinfo))
- (ctype (or (mime-entity-info-type/subtype cinfo) "text/plain"))
+ (c-type (mime-entity-info-media-type cinfo))
+ (c-subtype (mime-entity-info-media-subtype cinfo))
(params (mime-entity-info-parameters cinfo))
(encoding (mime-entity-info-encoding cinfo))
)
+ (or c-type
+ (setq c-type 'text
+ c-subtype 'plain))
;; Check for VM
(if (< beg (point-min))
(setq beg (point-min))
(setq end (point-max))
)
(let (method cal ret)
- (setq cal (list* (cons 'type ctype)
+ (setq cal (list* (cons 'type c-type)
+ (cons 'subtype c-subtype)
(cons 'encoding encoding)
(cons 'major-mode major-mode)
params))
)
+;;; @ file extraction
+;;;
+
+(defun mime-method-to-save (beg end cal)
+ (goto-char beg)
+ (let* ((name
+ (save-restriction
+ (narrow-to-region beg end)
+ (mime-article/get-filename cal)
+ ))
+ (encoding (cdr (assq 'encoding cal)))
+ (filename
+ (if (and name (not (string-equal name "")))
+ (expand-file-name name
+ (call-interactively
+ (function
+ (lambda (dir)
+ (interactive "DDirectory: ")
+ dir))))
+ (call-interactively
+ (function
+ (lambda (file)
+ (interactive "FFilename: ")
+ (expand-file-name file))))))
+ )
+ (if (file-exists-p filename)
+ (or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
+ (error "")))
+ (re-search-forward "\n\n")
+ (mime-write-decoded-region (match-end 0)(point-max) filename encoding)
+ ))
+
+
;;; @ mail/news message
;;;
(write-region start end file)
))
-(defun mime-display-message/partial (beg end cal)
+(defun mime-method-to-store-message/partial (beg end cal)
(goto-char beg)
(let* ((root-dir
(expand-file-name