This commit was generated by cvs2svn to compensate for changes in r377,
[elisp/tm.git] / tm-view.el
index 84f75d8..319ff98 100644 (file)
@@ -8,7 +8,7 @@
 ;;; modified by Steven L. Baur <steve@miranova.com>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el)
-;;; Version: $Revision: 7.60 $
+;;; Version: $Revision: 7.61 $
 ;;; Keywords: mail, news, MIME, multimedia
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -45,7 +45,7 @@
 ;;;
 
 (defconst mime-viewer/RCS-ID
-  "$Id: tm-view.el,v 7.60 1996/05/14 02:11:54 morioka Exp $")
+  "$Id: tm-view.el,v 7.61 1996/05/15 16:52:21 morioka Exp $")
 
 (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
 (defconst mime/viewer-version mime-viewer/version)
@@ -196,12 +196,13 @@ Each elements are regexp of field-name. [tm-view.el]")
 ;;; @@ content subject
 ;;;
 
-(defun mime-viewer/insert-content-subject
-  (rcnum cinfo ctype params subj)
+(defun mime-preview/insert-content-subject
+  (rcnum cinfo ctype params subj encoding)
   (save-restriction
     (narrow-to-region (point)(point))
     (insert
      (let ((access-type (assoc "access-type" params))
+          (charset (assoc "charset" params))
           (num (or (assoc-value "x-part-number" params)
                    (if (consp rcnum)
                        (mapconcat (function
@@ -211,36 +212,46 @@ Each elements are regexp of field-name. [tm-view.el]")
                                   (reverse rcnum) ".")
                      "0"))
                ))
-       (if access-type
-          (let ((server (assoc "server" params)))
-            (setq access-type (cdr access-type))
-            (if server
-                (format "[%s %s ([%s] %s)]\n" num subj
-                        access-type (cdr server))
-              (let ((site (assoc-value "site" params))
-                    (dir (assoc-value "directory" params))
-                    )
-                (format "[%s %s ([%s] %s:%s)]\n" num subj
-                        access-type site dir)
-                )))
-        (format "[%s %s (%s)]\n" num subj ctype)
-        )))
+       (cond (access-type
+             (let ((server (assoc "server" params)))
+               (setq access-type (cdr access-type))
+               (if server
+                   (format "[%s %s ([%s] %s)]\n" num subj
+                           access-type (cdr server))
+                 (let ((site (assoc-value "site" params))
+                       (dir (assoc-value "directory" params))
+                       )
+                   (format "[%s %s ([%s] %s:%s)]\n" num subj
+                           access-type site dir)
+                   )))
+             )
+            ((setq charset (cdr charset))
+             (if encoding
+                 (format "[%s %s (%s; %s <%s>)]\n"
+                         num subj ctype charset encoding)
+               (format "[%s %s (%s; %s)]\n" num subj ctype charset)
+               )
+             )
+            (t
+             (format "[%s %s (%s)]\n" num subj ctype)
+             )
+            )))
     (tm:add-button (point-min)(1- (point-max))
                   (function mime-viewer/play-content))
     ))
 
-(defun mime-viewer/default-content-subject-function
-  (rcnum cinfo ctype params subj)
+(defun mime-preview/default-content-subject-function
+  (rcnum cinfo ctype params subj encoding)
   (if (and (consp rcnum)
           (not (member
                 ctype
                 mime-viewer/content-subject-omitting-Content-Type-list)))
-      (mime-viewer/insert-content-subject
-       rcnum cinfo ctype params subj)
+      (mime-preview/insert-content-subject
+       rcnum cinfo ctype params subj encoding)
     ))
 
-(defvar mime-viewer/content-subject-function
-  (function mime-viewer/default-content-subject-function))
+(defvar mime-preview/content-subject-function
+  (function mime-preview/default-content-subject-function))
 
 
 ;;; @@ content header filter
@@ -460,8 +471,8 @@ The compressed face will be piped to this command.")
     (set-buffer obuf)
     (setq nb (point))
     (narrow-to-region nb nb)
-    (funcall mime-viewer/content-subject-function
-            rcnum cinfo ctype params subj)
+    (funcall mime-preview/content-subject-function
+            rcnum cinfo ctype params subj encoding)
     (if (mime-viewer/header-visible-p rcnum cinfo ctype)
        (mime-preview/display-header beg he)
       )
@@ -470,21 +481,22 @@ The compressed face will be piped to this command.")
              ctype mime-viewer/content-subject-showing-Content-Type-list))
        (save-excursion
          (goto-char (point-max))
-         (mime-viewer/insert-content-subject rcnum cinfo ctype params subj)
+         (mime-preview/insert-content-subject
+          rcnum cinfo ctype params subj encoding)
          ))
     (cond ((mime-viewer/body-visible-p rcnum cinfo ctype)
           (mime-preview/display-body he end
                                      rcnum cinfo ctype params subj encoding)
           )
          ((equal ctype "message/partial")
-          (set-buffer ibuf)
-          (mime-viewer/display-message/partial obuf)
+          (mime-preview/display-message/partial)
           )
          ((and (null rcnum)
                (null (mime::content-info/children cinfo))
                )
           (goto-char (point-max))
-          (mime-viewer/insert-content-subject rcnum cinfo ctype params subj)
+          (mime-preview/insert-content-subject
+           rcnum cinfo ctype params subj encoding)
           ))
     (mime-viewer/default-content-separator rcnum cinfo ctype params subj)
     (prog1
@@ -521,8 +533,7 @@ The compressed face will be piped to this command.")
           )
       )))
 
-(defun mime-viewer/display-message/partial (obuf)
-  (set-buffer obuf)
+(defun mime-preview/display-message/partial ()
   (save-restriction
     (goto-char (point-max))
     (if (not (search-backward "\n\n" nil t))