`mime::article/code-converter' -> `mime-raw::text-decoder'.
[elisp/semi.git] / mime-view.el
index 8446200..3c97161 100644 (file)
@@ -6,7 +6,7 @@
 ;; Created: 1994/7/13
 ;;     Renamed: 1994/8/31 from tm-body.el
 ;;     Renamed: 1997/02/19 from tm-view.el
-;; Version: $Revision: 0.16 $
+;; Version: $Revision: 0.24 $
 ;; Keywords: MIME, multimedia, mail, news
 
 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
@@ -29,7 +29,6 @@
 ;;; Code:
 
 (require 'cl)
-(require 'tl-atype)
 (require 'std11)
 (require 'mel)
 (require 'eword-decode)
@@ -41,7 +40,7 @@
 ;;;
 
 (defconst mime-view-RCS-ID
-  "$Id: mime-view.el,v 0.16 1997-02-24 09:58:14 tmorioka Exp $")
+  "$Id: mime-view.el,v 0.24 1997-03-15 22:20:20 morioka Exp $")
 
 (defconst mime-view-version (get-version-string mime-view-RCS-ID))
 
      (method . mime-article/decode-message/partial)
      (mode . "play")
      )
+    ((type . "message/external-body")
+     ("access-type" . "anon-ftp")
+     (method . mime-article/decode-message/external-ftp)
+     )
     
     ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
      (mode . "play")
@@ -246,8 +249,8 @@ Each elements are regexp of field-name. [mime-view.el]")
               (if server
                   (insert (format "[%s %s ([%s] %s)]\n" num subj
                                   access-type (cdr server)))
-                (let ((site (assoc-value "site" params))
-                      (dir (assoc-value "directory" params))
+                (let ((site (cdr (assoc "site" params)))
+                      (dir (cdr (assoc "directory" params)))
                       )
                   (insert (format "[%s %s ([%s] %s:%s)]\n" num subj
                                   access-type site dir))
@@ -269,8 +272,8 @@ Each elements are regexp of field-name. [mime-view.el]")
                 )
               (insert rest)
               ))))
-    (tm:add-button (point-min)(1- (point-max))
-                  (function mime-view-play-content))
+    (mime-add-button (point-min)(1- (point-max))
+                    (function mime-view-play-content))
     ))
 
 (defun mime-preview/default-content-button-function
@@ -344,18 +347,31 @@ Each elements are regexp of field-name. [mime-view.el]")
 ;;; @@ buffer local variables
 ;;;
 
-;; for XEmacs
-(defvar mime::article/preview-buffer nil)
-(defvar mime::article/code-converter nil)
-(defvar mime::preview/article-buffer nil)
+;;; @@@ in raw buffer
+;;;
 
 (make-variable-buffer-local 'mime::article/content-info)
+
+(defvar mime::article/preview-buffer nil)
 (make-variable-buffer-local 'mime::article/preview-buffer)
-(make-variable-buffer-local 'mime::article/code-converter)
+
+(defvar mime-raw::text-decoder nil
+  "Function to decode text in current buffer.
+Interface of the function is (CHARSET &optional ENCODING).
+CHARSET is symbol of MIME charset and ENCODING is value of
+Content-Transfer-Encoding.")
+(make-variable-buffer-local 'mime-raw::text-decoder)
+
+
+;;; @@@ in view buffer
+;;;
 
 (make-variable-buffer-local 'mime::preview/mother-buffer)
 (make-variable-buffer-local 'mime::preview/content-list)
+
+(defvar mime::preview/article-buffer nil)
 (make-variable-buffer-local 'mime::preview/article-buffer)
+
 (make-variable-buffer-local 'mime::preview/original-major-mode)
 (make-variable-buffer-local 'mime::preview/original-window-configuration)
 
@@ -578,8 +594,8 @@ The compressed face will be piped to this command.")
     (let ((be (point-max)))
       (narrow-to-region be be)
       (insert mime-view-announcement-for-message/partial)
-      (tm:add-button (point-min)(point-max)
-                    (function mime-view-play-content))
+      (mime-add-button (point-min)(point-max)
+                      (function mime-view-play-content))
       )))
 
 (defun mime-article/get-uu-filename (param &optional encoding)
@@ -710,22 +726,25 @@ The compressed face will be piped to this command.")
     )
   "Menu for MIME Viewer")
 
-(if running-xemacs
-    (progn
-      (defvar mime-view-xemacs-popup-menu
-       (cons mime-view-menu-title
-             (mapcar (function
-                      (lambda (item)
-                        (vector (nth 1 item)(nth 2 item) t)
-                        ))
-                     mime-view-menu-list)))
-      (defun mime-view-xemacs-popup-menu (event)
-       "Popup the menu in the MIME Viewer buffer"
-       (interactive "e")
-       (select-window (event-window event))
-       (set-buffer (event-buffer event))
-       (popup-menu 'mime-view-xemacs-popup-menu))
-      ))
+(cond (running-xemacs
+       (defvar mime-view-xemacs-popup-menu
+        (cons mime-view-menu-title
+              (mapcar (function
+                       (lambda (item)
+                         (vector (nth 1 item)(nth 2 item) t)
+                         ))
+                      mime-view-menu-list)))
+       (defun mime-view-xemacs-popup-menu (event)
+        "Popup the menu in the MIME Viewer buffer"
+        (interactive "e")
+        (select-window (event-window event))
+        (set-buffer (event-buffer event))
+        (popup-menu 'mime-view-xemacs-popup-menu))
+       (defvar mouse-button-2 'button2)
+       )
+      (t
+       (defvar mouse-button-2 [mouse-2])
+       ))
 
 (defun mime-view-define-keymap (&optional default)
   (let ((mime-view-mode-map (if (keymapp default)
@@ -778,7 +797,7 @@ The compressed face will be piped to this command.")
              ))
     (if mouse-button-2
        (define-key mime-view-mode-map
-         mouse-button-2 (function tm:button-dispatcher))
+         mouse-button-2 (function mime-button-dispatcher))
       )
     (cond (running-xemacs
           (define-key mime-view-mode-map
@@ -944,9 +963,7 @@ button-2    Move to point under the mouse cursor
               new-buf
               (the-buf (current-buffer))
               (a-buf mime::preview/article-buffer)
-              (hb (mime::content-info/point-min cinfo))
-              (he (mime::content-info/point-max cinfo))
-              fields from to cc reply-to subj mid f)
+              fields)
          (save-excursion
            (set-buffer (setq new-buf (get-buffer-create new-name)))
            (erase-buffer)
@@ -976,8 +993,8 @@ button-2    Move to point under the mouse cursor
                                  (concat "^"
                                          (apply (function regexp-or) fields)
                                          ":") ""))))
-                      (if (string-equal (mime::content-info/type ci)
-                                        "message/rfc822")
+                      (if (string= (mime::content-info/type ci)
+                                   "message/rfc822")
                           nil
                         (if str
                             (insert str)