;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el)
-;; Version: $Revision: 7.69 $
+;; Version: $Revision: 7.79 $
;; Keywords: mail, news, MIME, multimedia
;; This file is part of tm (Tools for MIME).
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with This program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Code:
(require 'tl-list)
(require 'tl-atype)
(require 'tl-misc)
-(require 'tl-822)
+(require 'std11)
(require 'mel)
(require 'tm-ew-d)
(require 'tm-def)
;;;
(defconst mime-viewer/RCS-ID
- "$Id: tm-view.el,v 7.69 1996/08/16 05:03:42 morioka Exp $")
+ "$Id: tm-view.el,v 7.79 1996/12/16 15:06:08 morioka Exp $")
(defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
(defconst mime/viewer-version mime-viewer/version)
(defvar mime/content-decoding-condition
'(((type . "text/plain")
- (method "tm-plain" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "text/html")
(method "tm-html" nil 'file 'type 'encoding 'mode 'name)
- (mode . "play"))
+ (mode . "play")
+ )
((type . "text/x-rot13-47")
- (method . mime-article/decode-caesar))
-
+ (method . mime-article/decode-caesar)
+ (mode . "play")
+ )
((type . "audio/basic")
- (method "tm-au" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-au" nil 'file 'type 'encoding 'mode 'name)
+ (mode . "play")
+ )
((type . "image/jpeg")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/gif")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/tiff")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/x-tiff")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/x-xbm")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/x-pic")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "image/x-mag")
- (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-image" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "video/mpeg")
- (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-mpeg" nil 'file 'type 'encoding 'mode 'name)
+ (mode . "play")
+ )
+ ((type . "application/postscript")
+ (method "tm-ps" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
((type . "application/octet-stream")
- (method "tm-file" nil 'file 'type 'encoding 'mode 'name))
+ (method "tm-file" nil 'file 'type 'encoding 'mode 'name)
+ (mode "play" "print")
+ )
;;((type . "message/external-body")
;; (method "xterm" nil
;; "-e" "showexternal"
;; 'file '"access-type" '"name" '"site" '"directory"))
((type . "message/rfc822")
- (method . mime-article/view-message/rfc822))
+ (method . mime-article/view-message/rfc822)
+ (mode . "play")
+ )
((type . "message/partial")
- (method . mime-article/decode-message/partial))
+ (method . mime-article/decode-message/partial)
+ (mode . "play")
+ )
- ((method "metamail" t
- "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play"))
+ ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
+ (mode . "play")
+ )
((method "tm-file" nil 'file 'type 'encoding 'mode 'name)
- (mode . "extract"))
+ (mode . "extract")
+ )
))
(defvar mime-viewer/childrens-header-showing-Content-Type-list
(defvar mime-viewer/following-method-alist nil)
+(defvar mime-viewer/following-required-fields-list
+ '("From"))
+
;;; @@ X-Face
;;;
(goto-char (point-min))
(if (re-search-forward "^X-Face:[ \t]*" nil t)
(let ((beg (match-end 0))
- (end (rfc822/field-end))
+ (end (std11-field-end))
)
(call-process-region beg end "sh" nil 0 nil
"-c" mime-viewer/x-face-command)
))
(defun mime-article/get-subject (param &optional encoding)
- (or (rfc822/get-field-body "Content-Description")
- (rfc822/get-field-body "Subject")
+ (or (std11-find-field-body '("Content-Description" "Subject"))
(let (ret)
(if (or (and (setq ret (mime/Content-Disposition))
(setq ret (assoc "filename" (cdr ret)))
(setq ret (assoc "name" param))
(setq ret (assoc "x-name" param))
)
- (rfc822/strip-quoted-string (cdr ret))
+ (std11-strip-quoted-string (cdr ret))
))
(mime-article/get-uu-filename param encoding)
""))
(mime::content-info/point-min ci)
(mime::content-info/point-max ci)
)
- (rfc822/get-header-string-except
+ (std11-header-string-except
(concat "^"
(apply (function regexp-or) fields)
":") ""))))
(insert str)
)
rcnum))
- (setq fields (rfc822/get-field-names)
+ (setq fields (std11-collect-field-names)
rcnum (cdr rcnum))
)
)
+ (let ((rest mime-viewer/following-required-fields-list))
+ (while rest
+ (let ((field-name (car rest)))
+ (or (std11-field-body field-name)
+ (insert
+ (format
+ (concat field-name
+ ": "
+ (save-excursion
+ (set-buffer the-buf)
+ (set-buffer mime::preview/mother-buffer)
+ (set-buffer mime::preview/article-buffer)
+ (std11-field-body field-name)
+ )
+ "\n")))
+ ))
+ (setq rest (cdr rest))
+ ))
(mime/decode-message-header)
)
(funcall (cdr (assq mode mime-viewer/following-method-alist))
(i (- (length pcl) 1))
beg)
(catch 'tag
- (while (>= i 0)
+ (while (> i 0)
(setq beg (mime::preview-content-info/point-min (nth i pcl)))
(if (> p beg)
(throw 'tag (goto-char beg))