Merge remi-1_8.
authormorioka <morioka>
Mon, 29 Jun 1998 14:09:36 +0000 (14:09 +0000)
committermorioka <morioka>
Mon, 29 Jun 1998 14:09:36 +0000 (14:09 +0000)
ChangeLog
Makefile
VERSION
mime-pgp.el
mime-play.el
mime-view.el
semi-def.el

index 3bb9fb1..b796763 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,55 @@
+1998-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-play.el (mime-save-content): Use
+       `mime-write-entity-content'.
+
+1998-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-view.el:
+         - Abolish local variable `mime-raw-representation-type'.
+         - Abolish function `mime-entity-representation-type'.
+
+       * mime-pgp.el (mime-view-application/pgp): Use
+       `mime-entity-cooked-p'.
+
+       * mime-play.el (mime-view-message/rfc822): Use
+       `mime-entity-cooked-p'.
+
+1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-play.el: Abolish function `mime-raw-write-region'.
+
+       * mime-play.el (mime-store-message/partial-piece): Use
+       `mime-write-entity-body'.
+
+       * mime-pgp.el (mime-verify-application/pgp-signature): Use
+       `mime-write-entity'.
+
+1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-pgp.el (mime-view-application/pgp): Specify
+       representation-type by argument of `mime-view-buffer'.
+
+1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-play.el (mime-view-message/rfc822): New implementation.
+
+       * mime-view.el (mime-display-message): Try use window of mother
+       buffer to display mime-preview-buffer.
+
+1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-view.el: Abolish `mime-entity-cooked-p'; use
+       `mime-entity-cooked-p' of FLIM.
+       (mime-view-buffer): New optional argument `representation-type';
+       use `mime-open-entity'.
+       (mime-view-mode): New implementation.
+
+\f
+1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * REMI: Version 1.8.0 (Ecch\e-Dþ-Kokubu)\e-A released.
+
 1998-06-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
        * README.en (Required environment): Modify for FLIM 1.7.0.
index eb229ce..8f35fc9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 #
 
 PACKAGE = semi
-VERSION = 1.8.0
+VERSION = 1.8.1
 
 SHELL  = /bin/sh
 MAKE   = make
diff --git a/VERSION b/VERSION
index 86ec7ed..05a1f51 100644 (file)
--- a/VERSION
+++ b/VERSION
 1.7.0  Mizuhashi               \e$(B?e66\e(B
 1.7.1  Higashi-Toyama          \e$(BElIY;3\e(B
 1.8.0  Toyama                  \e$(BIY;3\e(B             ; = JR \e$(B9b;3K\@~!"IY;39A@~\e(B
-:      :                       :
--------        Takaoka                 \e$(B9b2,\e(B             ; = JR \e$(BI98+@~!">kC<@~\e(B
+1.8.1  Kureha                  \e$(B8b1)\e(B
+-----  Kosugi                  \e$(B>.?y\e(B
+-----  Ecch\e-Dþ-Daimon\e-A              \e$(B1[CfBgLg\e(B
+-----  Takaoka                 \e$(B9b2,\e(B             ; = JR \e$(BI98+@~!">kC<@~\e(B
 :      :                       :
 -------        Higashi-Kanazawa        \e$(BEl6bBt\e(B
 -------        Kanazawa                \e$(B6bBt\e(B             ; <=> \e$(BKLN&E4F;\e(B \e$(BKLE46bBt\e(B
 ;;     East Japan Railway      \e$(BElF|K\N95RE4F;\e(B   http://www.jreast.co.jp/
 ;;     T\e-Dòkaidò\e-A Line              \e$(BEl3$F;K\@~\e(B
 ;;-------------------------------------------------------------------------
-1.2.0  T\e-Dòkyò\e-A             \e$(BEl5~\e(B
-1.2.1  Shinbashi       \e$(B?766\e(B     ; = JR \e$(B;3<j@~!"2#?\2l@~\e(B
-1.2.2  Shinagawa       \e$(BIJ@n\e(B     ; = JR \e$(B;3<j@~!"2#?\2l@~\e(B
-1.2.3  Kawasaki        \e$(B@n:j\e(B     ; = JR \e$(BFnIp@~\e(B
-1.2.4  Yokohama        \e$(B2#IM\e(B     ; = JR \e$(B5~IMElKL@~!&:,4_@~!"2#?\2l@~\e(B
-1.3.0  Totsuka         \e$(B8MDM\e(B     ; = JR \e$(B2#?\2l@~\e(B
-1.3.1  \e-DÒfuna\e-A             \e$(BBgA%\e(B     ; = JR \e$(B:,4_@~!"2#?\2l@~\e(B
-1.4.0  Fujisawa        \e$(BF#Bt\e(B     ; <=> \e$(B>.ED5^EEE4\e(B \e$(B9>%NEg@~!"9>%NEgEEE4\e(B
-1.4.1  Tsujid\e-Dò\e-A           \e$(@DT\e$(BF2\e(B ; \e$(B!J!V\e$(@DT\e$(B!W\e(B= J90@B-4454:128b\e$(B!K\e(B
-1.4.2  Chigasaki       \e$(B3}%v:j\e(B   ; = JR \e$(BAjLO@~\e(B
-1.4.3  Hiratsuka       \e$(BJ?DM\e(B
-1.4.4  \e-DÒiso\e-A              \e$(BBg0k\e(B
-1.4.5  Ninomiya        \e$(BFs5\\e(B
-1.4.6  K\e-Dòzu\e-A              \e$(B9qI\DE\e(B   ; = JR \e$(B8fEB>l@~\e(B
-1.5.0  Kamonomiya      \e$(B3{5\\e(B
-1.5.1  Odawara         \e$(B>.ED86\e(B   ; <=> \e$(B>.ED5^!"H":,EP;3E4F;!"0KF&H":,E4F;\e(B
-1.5.2  Hayakawa        \e$(BAa@n\e(B
-1.5.3  Nebukawa        \e$(B:,I\@n\e(B
-1.5.4  Manazuru        \e$(B??Da\e(B
-1.6.0  Yugawara        \e$(BEr2O86\e(B
-1.7.0  Atami           \e$(BG.3$\e(B     ; = JR \e$(B0KEl@~\e(B
+1.2.0  T\e-Dòkyò\e-A                     \e$(BEl5~\e(B
+1.2.1  Shinbashi               \e$(B?766\e(B     ; = JR \e$(B;3<j@~!"2#?\2l@~\e(B
+1.2.2  Shinagawa               \e$(BIJ@n\e(B     ; = JR \e$(B;3<j@~!"2#?\2l@~\e(B
+1.2.3  Kawasaki                \e$(B@n:j\e(B     ; = JR \e$(BFnIp@~\e(B
+1.2.4  Yokohama                \e$(B2#IM\e(B     ; = JR \e$(B5~IMElKL@~!&:,4_@~!"2#?\2l@~\e(B
+1.3.0  Totsuka                 \e$(B8MDM\e(B     ; = JR \e$(B2#?\2l@~\e(B
+1.3.1  \e-DÒfuna\e-A                     \e$(BBgA%\e(B     ; = JR \e$(B:,4_@~!"2#?\2l@~\e(B
+1.4.0  Fujisawa                \e$(BF#Bt\e(B     ; <=> \e$(B>.ED5^EEE4\e(B \e$(B9>%NEg@~!"9>%NEgEEE4\e(B
+1.4.1  Tsujid\e-Dò\e-A                   \e$(@DT\e$(BF2\e(B ; \e$(B!J!V\e$(@DT\e$(B!W\e(B= J90@B-4454:128b\e$(B!K\e(B
+1.4.2  Chigasaki               \e$(B3}%v:j\e(B   ; = JR \e$(BAjLO@~\e(B
+1.4.3  Hiratsuka               \e$(BJ?DM\e(B
+1.4.4  \e-DÒiso\e-A                      \e$(BBg0k\e(B
+1.4.5  Ninomiya                \e$(BFs5\\e(B
+1.4.6  K\e-Dòzu\e-A                      \e$(B9qI\DE\e(B   ; = JR \e$(B8fEB>l@~\e(B
+1.5.0  Kamonomiya              \e$(B3{5\\e(B
+1.5.1  Odawara                 \e$(B>.ED86\e(B   ; <=> \e$(B>.ED5^!"H":,EP;3E4F;!"\e(B
+                                       ;     \e$(B0KF&H":,E4F;\e(B
+1.5.2  Hayakawa                \e$(BAa@n\e(B
+1.5.3  Nebukawa                \e$(B:,I\@n\e(B
+1.5.4  Manazuru                \e$(B??Da\e(B
+1.6.0  Yugawara                \e$(BEr2O86\e(B
+1.7.0  Atami                   \e$(BG.3$\e(B     ; = JR \e$(B0KEl@~\e(B
 ;;-------------------------------------------------------------------------
 ;;     Central Japan Railway   \e$(BEl3$N95RE4F;\e(B
 ;;-------------------------------------------------------------------------
-1.7.1  Kan'nami        \e$(BH!Fn\e(B
-1.8.0  Mishima         \e$(B;0Eg\e(B     ; = \e$(B0KF&H":,E4F;\e(B
------  Numazu          \e$(B>BDE\e(B     ; = JR \e$(B8fEB>l@~\e(B
------  Katahama        \e$(BJRIM\e(B
------  Hara            \e$(B86\e(B
+1.7.1  Kan'nami                \e$(BH!Fn\e(B
+1.8.0  Mishima                 \e$(B;0Eg\e(B     ; = \e$(B0KF&H":,E4F;\e(B
+-----  Numazu                  \e$(B>BDE\e(B     ; = JR \e$(B8fEB>l@~\e(B
+-----  Katahama                \e$(BJRIM\e(B
+-----  Hara                    \e$(B86\e(B
 -----  Higashi-Tagonoura       \e$(BElED;R%N1:\e(B
------  Yoshiwara       \e$(B5H86\e(B     ; = \e$(B3YFnE4F;\e(B
------  Fuji            \e$(BIY;N\e(B     ; = JR \e$(B?H1d@~\e(B
-:      :               :
------  Kanayama        \e$(B6b;3\e(B     ; =\e$(B!J\e(BJR \e$(BCf1{K\@~!K\e(B
------  Ot\e-Dòbashi\e-A  \e$(BHxF,66\e(B
------  Nagoya          \e$(BL>8E20\e(B   ; = JR \e$(B4X@>K\@~!J!&Cf1{K\@~!K\e(B
-:      :               :
------  Gifu            \e$(B4tIl\e(B     ; = JR \e$(B9b;3K\@~\e(B
-:      :               :
------  Samegai         \e$(B@C%v0f\e(B
+-----  Yoshiwara               \e$(B5H86\e(B     ; = \e$(B3YFnE4F;\e(B
+-----  Fuji                    \e$(BIY;N\e(B     ; = JR \e$(B?H1d@~\e(B
+:      :                       :
+-----  Kanayama                \e$(B6b;3\e(B     ; =\e$(B!J\e(BJR \e$(BCf1{K\@~!K\e(B
+-----  Ot\e-Dòbashi\e-A          \e$(BHxF,66\e(B
+-----  Nagoya                  \e$(BL>8E20\e(B   ; = JR \e$(B4X@>K\@~!J!&Cf1{K\@~!K\e(B
+:      :                       :
+-----  Gifu                    \e$(B4tIl\e(B     ; = JR \e$(B9b;3K\@~\e(B
+:      :                       :
+-----  Samegai                 \e$(B@C%v0f\e(B
 ;;-------------------------------------------------------------------------
 ;;     West Japan Railway      \e$(B@>F|K\N95RE4F;\e(B   http://www.westjr.co.jp/
 ;;-------------------------------------------------------------------------
------  Maibara         \e$(BJF86\e(B     ; = JR \e$(BKLN&K\@~\e(B
-:      :               :
------  Kusatsu         \e$(BApDE\e(B     ; = JR \e$(BApDE@~\e(B
-:      :               :
------  Yamashina       \e$(B;32J\e(B     ; = JR \e$(B8P@>@~\e(B
------  Ky\e-Dòto\e-A             \e$(B5~ET\e(B     ; = JR \e$(BF`NI@~!&;31"K\@~\e(B
-                               ;   <=> \e$(B6aE4\e(B \e$(B5~ET@~!"5~ET;T8rDL6I\e(B \e$(B1(4]@~\e(B
-:      :               :
------  \e-DÒsaka\e-A             \e$(BBg:e\e(B     ; = JR \e$(BBg:e4D>u@~\e(B <=> JR \e$(BEl@>@~\e(B \e$(BKL?7CO\e(B
-                               ;   <=> \e$(BBg:e;T8rDL6I!":e?@!":e5^\e(B \e$(BG_ED\e(B
-:      :               :
------  K\e-Dòbe\e-A              \e$(B?@8M\e(B     ; = JR \e$(B;3M[K\@~\e(B
+-----  Maibara                 \e$(BJF86\e(B     ; = JR \e$(BKLN&K\@~\e(B
+:      :                       :
+-----  Kusatsu                 \e$(BApDE\e(B     ; = JR \e$(BApDE@~\e(B
+:      :                       :
+-----  Yamashina               \e$(B;32J\e(B     ; = JR \e$(B8P@>@~\e(B
+-----  Ky\e-Dòto\e-A                     \e$(B5~ET\e(B     ; = JR \e$(BF`NI@~!&;31"K\@~\e(B
+                                       ; <=> \e$(B6aE4\e(B \e$(B5~ET@~!"5~ET;T8rDL6I\e(B \e$(B1(4]@~\e(B
+:      :                       :
+-----  \e-DÒsaka\e-A                     \e$(BBg:e\e(B     ; = JR \e$(BBg:e4D>u@~\e(B <=> JR \e$(BEl@>@~\e(B \e$(BKL?7CO\e(B
+                                       ;   <=> \e$(BBg:e;T8rDL6I!":e?@!":e5^\e(B \e$(BG_ED\e(B
+:      :                       :
+-----  K\e-Dòbe\e-A                      \e$(B?@8M\e(B     ; = JR \e$(B;3M[K\@~\e(B
 
 
 [REMI version names]
 1.4.0  Himi                    \e$(BI98+\e(B
 1.5.0  Shimao                  \e$(BEgHx\e(B
 1.6.0  Amaharashi              \e$(B1+@2\e(B
-1.7.0  Ecch\e-Dþ-Kokubu\e-A              \e$(B1[Cf9qJ,\e(B
--------        Fushiki                 \e$(BIzLZ\e(B
+1.8.0  Ecch\e-Dþ-Kokubu\e-A              \e$(B1[Cf9qJ,\e(B
+1.8.1  Fushiki                 \e$(BIzLZ\e(B     ; <=> \e$(B%&%i%8%*%9%C%H%C%/9RO)\e(B
 -------        Noumachi                \e$(BG=D.\e(B
 -------        Ecch\e-Dþ-Nakagawa\e-A            \e$(B1[CfCf@n\e(B
-       (Takaoka)               (\e$(B9b2,\e(B)           ; = JR \e$(BKLN&K\@~!">kC<@~\e(B
+       (Takaoka)               (\e$(B9b2,\e(B)   ; = JR \e$(BKLN&K\@~!">kC<@~\e(B
 
 
 [etc.]
 -------        (\e-DÒmi-Shiotsu)\e-A             (\e$(B6a9>1vDE\e(B)       ; = JR \e$(BKLN&K\@~\e(B
 :      :                       :
 -------        Nishi-\e-DÒtsu\e-A                \e$(B@>BgDE\e(B
-       (Yamashina)             (\e$(B;32J\e(B)           ; = JR \e$(BEl3$F;K\@~\e(B
+       (Yamashina)             (\e$(B;32J\e(B)   ; = JR \e$(BEl3$F;K\@~\e(B
index fe2e1f2..67fbb6e 100644 (file)
 ;;; It is based on draft-kazu-pgp-mime-00.txt (PGP-kazu).
 
 (defun mime-view-application/pgp (entity situation)
-  (let* ((start (mime-entity-point-min entity))
-        (end (mime-entity-point-max entity))
-        (entity-number (mime-raw-point-to-entity-number start))
-        (p-win (or (get-buffer-window mime-preview-buffer)
+  (let* ((p-win (or (get-buffer-window mime-preview-buffer)
                    (get-largest-window)))
-        (new-name (format "%s-%s" (buffer-name) entity-number))
+        (new-name
+         (format "%s-%s" (buffer-name) (mime-entity-number entity)))
         (the-buf (current-buffer))
         (mother mime-preview-buffer)
         representation-type)
     (set-buffer (get-buffer-create new-name))
     (erase-buffer)
-    (insert-buffer-substring the-buf start end)
+    (insert-buffer-substring
+     the-buf (mime-entity-point-min entity) (mime-entity-point-max entity))
     (cond ((progn
             (goto-char (point-min))
             (re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+$" nil t))
@@ -93,7 +92,8 @@
           (while (re-search-forward "^- -" nil t)
             (replace-match "-")
             )
-          (setq representation-type (mime-entity-representation-type entity))
+          (setq representation-type (if (mime-entity-cooked-p entity)
+                                        'cooked))
           )
          ((progn
             (goto-char (point-min))
           (setq representation-type 'binary)
           ))
     (setq major-mode 'mime-show-message-mode)
-    (setq mime-raw-representation-type representation-type)
-    (save-window-excursion (mime-view-mode mother))
+    (save-window-excursion (mime-view-buffer nil nil mother
+                                            nil representation-type))
     (set-window-buffer p-win mime-preview-buffer)
     ))
 
@@ -170,9 +170,7 @@ It should be ISO 639 2 letter language code such as en, ja, ...")
         (orig-file (make-temp-name basename))
         (sig-file (concat orig-file ".sig"))
         )
-    (mime-raw-write-region (mime-entity-point-min orig-entity)
-                          (mime-entity-point-max orig-entity)
-                          orig-file)
+    (mime-write-entity orig-entity orig-file)
     (save-excursion (mime-show-echo-buffer))
     (mime-write-decoded-region (save-excursion
                                 (goto-char start)
index f9834bd..344b9da 100644 (file)
@@ -313,7 +313,6 @@ window.")
 
 (defun mime-save-content (entity situation)
   (let* ((name (mime-entity-safe-filename entity))
-        (encoding (or (mime-entity-encoding entity) "7bit"))
         (filename (if (and name (not (string-equal name "")))
                       (expand-file-name name
                                         (save-window-excursion
@@ -332,9 +331,7 @@ window.")
     (if (file-exists-p filename)
        (or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
            (error "")))
-    (mime-write-decoded-region (mime-entity-body-start entity)
-                              (mime-entity-body-end entity)
-                              filename encoding)
+    (mime-write-entity-content entity filename)
     ))
 
 
@@ -403,47 +400,26 @@ It is registered to variable `mime-preview-quitting-method-alist'."
     (pop-to-buffer mother)
     ))
 
-(defun mime-view-message/rfc822 (entity cal)
-  (let* ((beg (mime-entity-point-min entity))
-        (end (mime-entity-point-max entity))
-        (cnum (mime-raw-point-to-entity-number beg))
-        (new-name (format "%s-%s" (buffer-name) cnum))
+(defun mime-view-message/rfc822 (entity situation)
+  (let* ((new-name
+         (format "%s-%s" (buffer-name) (mime-entity-number entity)))
         (mother mime-preview-buffer)
-        (representation-type (mime-entity-representation-type entity))
-        str)
-    (setq str (buffer-substring beg end))
-    (switch-to-buffer new-name)
+        (children (car (mime-entity-children entity))))
+    (set-buffer (get-buffer-create new-name))
     (erase-buffer)
-    (insert str)
-    (goto-char (point-min))
-    (if (re-search-forward "^\n" nil t)
-       (delete-region (point-min) (match-end 0))
-      )
+    (insert-buffer-substring (mime-entity-buffer children)
+                            (mime-entity-point-min children)
+                            (mime-entity-point-max children))
+    (setq mime-message-structure children)
     (setq major-mode 'mime-show-message-mode)
-    (setq mime-raw-representation-type representation-type)
-    (mime-view-mode mother)
+    (mime-view-buffer (current-buffer) nil mother
+                     nil (if (mime-entity-cooked-p entity) 'cooked))
     ))
 
 
 ;;; @ message/partial
 ;;;
 
-(defun mime-raw-write-region (start end filename)
-  "Write current region into specified file.
-When called from a program, takes three arguments:
-START, END and FILENAME.  START and END are buffer positions.
-It refer `mime-raw-representation-type' or `major-mode
-mime-raw-representation-type-alist'.  If it is `binary', region is
-saved as binary.  Otherwise the region is saved by `write-region'."
-  (let ((presentation-type
-        (or mime-raw-representation-type
-            (cdr (or (assq major-mode mime-raw-representation-type-alist)
-                     (assq t mime-raw-representation-type-alist))))))
-    (if (eq presentation-type 'binary)
-       (write-region-as-binary start end filename)
-      (write-region start end filename)
-      )))
-
 (defun mime-store-message/partial-piece (entity cal)
   (goto-char (mime-entity-point-min entity))
   (let* ((root-dir
@@ -483,8 +459,7 @@ saved as binary.  Otherwise the region is saved by `write-region'."
          (select-window pwin)
          )
       (setq file (concat root-dir "/" number))
-      (mime-raw-write-region (mime-entity-body-start entity)
-                            (mime-entity-body-end entity) file)
+      (mime-write-entity-body entity file)
       (let ((total-file (concat root-dir "/CT")))
        (setq total
              (if total
index 1e0fe3f..3322e32 100644 (file)
 (make-variable-buffer-local 'mime-preview-buffer)
 
 
-(defvar mime-raw-representation-type nil
-  "Representation-type of mime-raw-buffer.
-It must be nil, `binary' or `cooked'.
-If it is nil, `mime-raw-representation-type-alist' is used as default
-value.
-Notice that this variable is usually used as buffer local variable in
-raw-buffer.")
-
-(make-variable-buffer-local 'mime-raw-representation-type)
-
 (defvar mime-raw-representation-type-alist
   '((mime-show-message-mode     . binary)
     (mime-temp-message-mode     . binary)
@@ -88,9 +78,7 @@ raw-buffer.")
   "Alist of major-mode vs. representation-type of mime-raw-buffer.
 Each element looks like (SYMBOL . REPRESENTATION-TYPE).  SYMBOL is
 major-mode or t.  t means default.  REPRESENTATION-TYPE must be
-`binary' or `cooked'.
-This value is overridden by buffer local variable
-`mime-raw-representation-type' if it is not nil.")
+`binary' or `cooked'.")
 
 
 (defun mime-raw-find-entity-from-point (point &optional message-info)
@@ -150,15 +138,6 @@ mother-buffer."
 ;;; @ entity information
 ;;;
 
-(defsubst mime-entity-representation-type (entity)
-  (with-current-buffer (mime-entity-buffer entity)
-    (or mime-raw-representation-type
-       (cdr (or (assq major-mode mime-raw-representation-type-alist)
-                (assq t mime-raw-representation-type-alist))))))
-
-(defsubst mime-entity-cooked-p (entity)
-  (eq (mime-entity-representation-type entity) 'cooked))
-
 (defun mime-entity-situation (entity)
   "Return situation of ENTITY."
   (append (or (mime-entity-content-type entity)
@@ -913,15 +892,41 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t.  t means default."
          (let ((r-win (get-buffer-window raw-buffer)))
            (if r-win
                (set-window-buffer r-win preview-buffer)
-             (switch-to-buffer preview-buffer)
-             )))
+             (let ((m-win (and mother (get-buffer-window mother))))
+               (if m-win
+                   (set-window-buffer m-win preview-buffer)
+                 (switch-to-buffer preview-buffer)
+                 )))))
       )))
 
 (defun mime-view-buffer (&optional raw-buffer preview-buffer mother
-                                  default-keymap-or-function)
+                                  default-keymap-or-function
+                                  representation-type)
+  "View RAW-BUFFER in MIME-View mode.
+Optional argument PREVIEW-BUFFER is either nil or a name of preview
+buffer.
+Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
+function.  If it is a keymap, keymap of MIME-View mode will be added
+to it.  If it is a function, it will be bound as default binding of
+keymap of MIME-View mode.
+Optional argument REPRESENTATION-TYPE is representation-type of
+message.  It must be nil, `binary' or `cooked'.  If it is nil,
+`binary' is used as default."
   (interactive)
+  (or raw-buffer
+      (setq raw-buffer (current-buffer)))
+  (or representation-type
+      (setq representation-type
+           (save-excursion
+             (set-buffer raw-buffer)
+             (cdr (or (assq major-mode mime-raw-representation-type-alist)
+                      (assq t mime-raw-representation-type-alist)))
+             )))
+  (if (eq representation-type 'binary)
+      (setq representation-type 'buffer)
+    )
   (mime-display-message
-   (mime-parse-buffer raw-buffer)
+   (mime-open-entity representation-type raw-buffer)
    preview-buffer mother default-keymap-or-function))
 
 (defun mime-view-mode (&optional mother ctl encoding
@@ -950,17 +955,27 @@ button-2  Move to point under the mouse cursor
                and decode current content as `play mode'
 "
   (interactive)
-  (let ((message
-        (save-excursion
-          (if raw-buffer (set-buffer raw-buffer))
-          (or mime-view-redisplay
-              (setq mime-message-structure (mime-parse-message ctl)))
-          )))
-    (or (mime-entity-encoding message)
-       (mime-entity-set-encoding-internal message encoding))
-    (mime-display-message message preview-buffer
-                         mother default-keymap-or-function)
-    ))
+  (unless mime-view-redisplay
+    (save-excursion
+      (if raw-buffer (set-buffer raw-buffer))
+      (let ((type
+            (cdr
+             (or (assq major-mode mime-raw-representation-type-alist)
+                 (assq t mime-raw-representation-type-alist)))))
+       (if (eq type 'binary)
+           (setq type 'buffer)
+         )
+       (setq mime-message-structure (mime-open-entity type raw-buffer))
+       (or (mime-entity-content-type mime-message-structure)
+           (mime-entity-set-content-type-internal
+            mime-message-structure ctl))
+       )
+      (or (mime-entity-encoding mime-message-structure)
+         (mime-entity-set-encoding-internal mime-message-structure encoding))
+      ))
+  (mime-display-message mime-message-structure preview-buffer
+                       mother default-keymap-or-function)
+  )
 
 
 ;;; @@ playing
index 38508b0..ce93512 100644 (file)
@@ -30,7 +30,7 @@
 
 (require 'custom)
 
-(defconst mime-user-interface-version '("SEMI" "Toyama" 1 8 0)
+(defconst mime-user-interface-version '("SEMI" "Kureha" 1 8 1)
   "Implementation name, version name and numbers of MIME-kernel package.")
 
 (autoload 'mule-caesar-region "mule-caesar"