-;;; mime-play.el --- decoder for mime-view.el
+;;; mime-play.el --- Playback processing module for mime-view.el
-;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1995/9/26 (separated from tm-view.el)
;; Renamed: 1997/2/21 from tm-play.el
-;; Version: $Id: mime-play.el,v 0.51 1997-09-05 11:42:36 morioka Exp $
;; Keywords: MIME, multimedia, mail, news
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of SEMI (Secretariat of Emacs MIME Interfaces).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
)
(setq mime-preview/after-decoded-position (point))
(set-buffer raw-buffer)
- (mime-display-content cinfo mode)
+ (mime-playback-entity cinfo mode)
(if (eq (current-buffer) raw-buffer)
(progn
(set-buffer the-buf)
))
))))
-(defun mime-display-content (cinfo &optional mode)
+(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"))
(funcall method beg end ret)
)
((and (listp method)(stringp (car method)))
- (mime-article/start-external-method-region beg end ret)
+ (mime-activate-external-method beg end ret)
)
(t
(mime-show-echo-buffer
;;; @ external decoder
;;;
-(defun mime-article/start-external-method-region (beg end cal)
+(defun mime-activate-external-method (beg end cal)
(save-excursion
(save-restriction
(narrow-to-region beg end)
(list (car method)
mime-echo-buffer-name (car method)
)
- (mime-article/make-method-args cal
- (cdr (cdr method)))
+ (mime-make-external-method-args
+ cal (cdr (cdr method)))
))
(apply (function start-process) args)
(mime-show-echo-buffer)
))
))))
-(defun mime-article/make-method-args (cal format)
+(defun mime-make-external-method-args (cal format)
(mapcar (function
(lambda (arg)
(if (stringp arg)
)
+;;; @ 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
;;;
(pop-to-buffer mother)
))
-(defun mime-display-message/rfc822 (beg end cal)
+(defun mime-method-to-display-message/rfc822 (beg end cal)
(let* ((cnum (mime-article/point-content-number beg))
(new-name (format "%s-%s" (buffer-name) cnum))
(mother mime-view-buffer)
(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
(re-search-forward "^$")
(goto-char (1+ (match-end 0)))
(setq file (concat root-dir "/" number))
- (mime-article::write-region (point) (point-max) file)
+ (mime-article::write-region (point) end file)
(let ((total-file (concat root-dir "/CT")))
(setq total
(if total
(get-buffer-create mime-temp-buffer-name))
(erase-buffer)
(insert total)
- (write-file total-file)
+ (write-region (point-min)(point-max) total-file)
(kill-buffer (current-buffer))
))
(string-to-number total)
(goto-char (point-max))
(setq i (1+ i))
))
- (as-binary-output-file (write-file (concat root-dir "/FULL")))
+ (as-binary-output-file
+ (write-region (point-min)(point-max)
+ (expand-file-name "FULL" root-dir)))
(let ((i 1))
(while (<= i total)
(let ((file (format "%s/%d" root-dir i)))
(dired dir)
))
-(defun mime-display-message/external-ftp (beg end cal)
+(defun mime-method-to-display-message/external-ftp (beg end cal)
(let* ((site (cdr (assoc "site" cal)))
(directory (cdr (assoc "directory" cal)))
(name (cdr (assoc "name" cal)))
;;; @ rot13-47
;;;
-(defun mime-display-caesar (start end cal)
+(defun mime-method-to-display-caesar (start end cal)
"Internal method for mime-view to display ROT13-47-48 message."
(let* ((cnum (mime-article/point-content-number start))
(new-name (format "%s-%s" (buffer-name) cnum))