Sync up with SEMI 1.7.1.
authoryamaoka <yamaoka>
Mon, 22 Jun 1998 22:45:11 +0000 (22:45 +0000)
committeryamaoka <yamaoka>
Mon, 22 Jun 1998 22:45:11 +0000 (22:45 +0000)
14 files changed:
ChangeLog
Makefile
README.en
SEMI-CFG
VERSION
mime-bbdb.el
mime-edit.el
mime-image.el
mime-partial.el
mime-pgp.el
mime-play.el
mime-text.el
mime-view.el
semi-def.el

index 7425746..12d9c11 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,109 @@
+1998-06-23  Katsumi Yamaoka   <yamaoka@jpl.org>
+
+       * WEMI: Version 1.7.1 (Kan'nami) released.
+
+1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * README.en (Required environment): Delete description about
+       `enable-multibyte-characters'; modify for FLIM 1.5.0.
+
+1998-06-22  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
+
+       * mime-edit.el (mime-content-types): Add "url" access-type and
+       "subject" parameter of "mail-server" access-type to
+       message/external-body media-type.
+       (mime-edit-define-menu-for-xemacs): Doc-string fix.
+
+1998-06-22  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
+
+       * SEMI-CFG: Support run-in-place installation of BBDB and
+       Emacs/W3.
+
+1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-view.el: Don't require `std11'.
+
+       * mime-view.el: Require `mime' instead of `mime-lib'.
+       (mime-entity-filename): Don't use `std11-strip-quoted-string'.
+
+       * mime-edit.el: Don't require `eword-encode'.
+
+1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-partial.el
+       (mime-combine-message/partial-pieces-automatically): Fixed.
+
+       * mime-pgp.el (mime-view-application/pgp): Use function
+       `mime-entity-representation-type'.
+
+       * mime-play.el (mime-view-message/rfc822): Use function
+       `mime-entity-representation-type'.
+       (mime-store-message/partial-piece): `mime-entity-body-start' and
+       `mime-entity-body-end'.
+
+       * mime-text.el (mime-text-insert-decoded-body): Use function
+       `mime-entity-cooked-p'.
+
+       * mime-view.el (mime-entity-representation-type): New function.
+       (mime-entity-cooked-p): New function.
+       (mime-display-entity): Use function `mime-entity-cooked-p'.
+
+1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-text.el (mime-text-insert-decoded-body): Use
+       `mime-entity-content'.
+
+       * mime-image.el (mime-display-image): Use `mime-entity-content'.
+
+1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-play.el (mime-entity-safe-filename): New implementation.
+
+1998-06-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-text.el (mime-text-insert-decoded-body): Delete unnecessary
+       `save-restriction'.
+
+1998-06-20  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
+
+       * semi-def.el: Require 'custom.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-view.el: Don't require `mime-parse'.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * SEMI-CFG: - Modify for FLIM 1.5.0.
+                   - Don't signal error if tm is found in load-path.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-play.el (mime-save-content): Use `mime-entity-body-start'
+       and `mime-entity-body-end'.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-pgp.el (mime-view-application/pgp): fixed.
+       (mime-verify-application/pgp-signature): Use
+       `mime-message-structure' instead of `mime-raw-message-info'.
+       (mime-decrypt-application/pgp-encrypted): Use
+       `mime-message-structure' instead of `mime-raw-message-info'.
+
+       * mime-view.el (mime-display-message): Use `mime-parse-buffer';
+       abolish variable `mime-raw-message-info'; use
+       `mime-message-structure' instead of `mime-raw-message-info'.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * mime-bbdb.el (mime-bbdb/update-record): Use
+       `mime-entity-fetch-field' and `mime-entity-read-field'.
+
+1998-06-19  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
+
+       * SEMI-CFG: Require 'cl first.
+
+\f
 1998-06-19  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * WEMI: Version 1.7.0 (Atami) released.
index 01ba988..1c595c2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 # Makefile for WEMI.
 #
 
-VERSION = 1.7.0
+VERSION = 1.7.1
 PACKAGE = wemi
 
 SHELL  = /bin/sh
index b3ca972..489604e 100644 (file)
--- a/README.en
+++ b/README.en
@@ -44,11 +44,7 @@ Required environment
   19.14.  WEMI also does not support Emacs 19.29 to 19.34, XEmacs
   19.15 or XEmacs 20.2 without mule, but WEMI may work with them.
 
-  If you use Emacs 20, don't set `enable-multibyte-characters' to
-  nil. (Maybe non mule setting requires to modify emu.  In addition,
-  it is better to use terminal-coding-system feature)
-
-  SEMI requires APEL (8.7 or later) and FLIM (1.4.0 or later) package.
+  SEMI requires APEL (8.7 or later) and FLIM (1.5.0 or later) package.
   Please install them before installing it.  APEL package is available
   at:
 
index ba11bc6..c10e258 100644 (file)
--- a/SEMI-CFG
+++ b/SEMI-CFG
@@ -4,6 +4,8 @@
 
 ;;; Code:
 
+(require 'cl)
+
 (defvar default-load-path load-path)
 
 (add-to-list 'load-path
@@ -20,7 +22,6 @@
 (condition-case nil
     (require 'install)
   (error (error "Please install APEL 8.7 or later.")))
-(require 'cl)
 
 (add-path "bitmap-mule")
 (add-path "flim")
 
 (or (module-installed-p 'calist)
     (error "Please install APEL 8.7 or later."))
-(or (module-installed-p 'mel)
-    (error "Please install FLIM 1.1.0 or later."))
+(or (module-installed-p 'mime-lib)
+    (error "Please install FLIM 1.5.0 or later."))
 (if (module-installed-p 'tm-view)
-    (error "Please remove tm from load-path."))
+    (message "Please remove tm from load-path."))
 
 
 ;;; @ Please specify optional package directory if you use them.
 ;;;
 
 (let ((path (get-latest-path "bbdb" 'all-paths)))
-  (if path
-      (add-path path)
+  (when path
+    (add-path path)
+    (add-path (expand-file-name "lisp" path)) ; run-in-place installation
     ))
 
 ;; Or please specify path.
 ;; (add-path "bbdb-1.50" 'all-paths)
 
 
+;;;
+;;; @@ Please specify Emacs/W3 path.
+;;;
+
+(let ((path (get-latest-path "w3" 'all-paths)))
+  (when path
+    (add-path path)
+    (add-path (expand-file-name "lisp" path)) ; run-in-place installation
+    ))
+
+;; Or please specify path.
+;; (add-path "w3-4.0pre.20" 'all-paths)
+
+
 ;;; @ shell
 ;;;
 
diff --git a/VERSION b/VERSION
index 9d05e9d..4f01618 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -57,7 +57,7 @@
 1.5.4  Higashi-Namerikawa      \e$(BEl3j@n\e(B
 1.6.0  Namerikawa              \e$(B3j@n\e(B             ; <=> \e$(BIY;3COJ}E4F;\e(B
 1.7.0  Mizuhashi               \e$(B?e66\e(B
------  Higashi-Toyama          \e$(BElIY;3\e(B
+1.7.1  Higashi-Toyama          \e$(BElIY;3\e(B
 -----  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
 ;;-------------------------------------------------------------------------
 ;;     Central Japan Railway   \e$(BEl3$N95RE4F;\e(B
 ;;-------------------------------------------------------------------------
------  Kan'nami        \e$(BH!Fn\e(B
+1.7.1  Kan'nami        \e$(BH!Fn\e(B
 -----  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
index 002942a..23d4fb3 100644 (file)
@@ -160,17 +160,20 @@ the user confirms the creation."
         (set-buffer mime-preview-buffer))
     (if bbdb-use-pop-up
         (mime-bbdb/pop-up-bbdb-buffer offer-to-create)
-      (let* ((from (std11-field-body "From"))
-             (addr (if from
-                      (car (cdr (mail-extract-address-components from))))))
-        (if (or (null from)
-                (null addr)
-                (string-match (bbdb-user-mail-names) addr))
-            (setq from (or (std11-field-body "To") from))
+      (let* ((message (get-text-property (point-min) 'mime-view-entity))
+            (from (mime-entity-fetch-field message 'From))
+            addr)
+       (if (or (null from)
+                (null
+                (setq addr (car (mime-entity-read-field message 'From))))
+                (string-match (bbdb-user-mail-names)
+                             (std11-address-string addr)))
+            (setq from (or (mime-entity-fetch-field message 'To)
+                          from))
          )
         (if from
             (bbdb-annotate-message-sender
-             from t
+             (eword-decode-structured-field-body from) t
              (or (bbdb-invoke-hook-for-value mime-bbdb/auto-create-p)
                  offer-to-create)
              offer-to-create))
index 30dee69..f911ce2 100644 (file)
 (require 'mail-utils)
 (require 'mel)
 (require 'mime-view)
-(require 'eword-encode)
 (require 'signature)
 (require 'alist)
 
@@ -215,9 +214,13 @@ To insert a signature file automatically, call the function
        ("tftp"        ("site") ("name"))
        ("afs"         ("site") ("name"))
        ("local-file"  ("site") ("name"))
-       ("mail-server" ("server" "ftpmail@nic.karrn.ad.jp"))
+       ("mail-server"
+       ("server" "ftpmail@nic.karrn.ad.jp")
+       ("subject"))
+       ("url"         ("url"))
        ))
      ("rfc822")
+     ("news")
      )
     ("application"
      ("octet-stream" ("type" "" "tar" "shar"))
@@ -698,7 +701,7 @@ Tspecials means any character that matches with it in header must be quoted.")
        ;; modified by Pekka Marjola <pema@iki.fi>
        ;;      1995/9/5 (c.f. [tm-en:69])
        (defun mime-edit-define-menu-for-xemacs ()
-        "Define menu for Emacs 19."
+        "Define menu for XEmacs."
         (cond ((featurep 'menubar)
                (make-local-variable 'current-menubar)
                (set-buffer-menubar current-menubar)
index f28a08c..1e20ac0 100644 (file)
 (defun mime-display-image (entity situation)
   (message "Decoding image...")
   (let ((gl (image-normalize (cdr (assq 'image-format situation))
-                            (with-temp-buffer
-                              (insert-buffer-substring
-                               (mime-entity-buffer entity)
-                               (mime-entity-body-start entity)
-                               (mime-entity-body-end entity))
-                              (mime-decode-region
-                               (point-min)(point-max)
-                               (mime-entity-encoding entity))
-                              (buffer-string)))))
+                            (mime-entity-content entity))))
     (cond ((image-invalid-glyph-p gl)
           (setq gl nil)
           (message "Invalid glyph!")
index 9401a89..c2aef5b 100644 (file)
@@ -66,22 +66,23 @@ partial messages using mime-view."
            (not (y-or-n-p "Merge partials?"))
            )
        (mime-store-message/partial-piece entity cal)
-      (let (the-id parameters)
-       (setq subject-id (std11-field-body "Subject"))
-       (if (string-match "[0-9\n]+" subject-id)
-           (setq subject-id (substring subject-id 0 (match-beginning 0)))
-         )
-       (save-excursion
-         (set-buffer subject-buf)
-         (while (search-backward subject-id nil t))
-         (catch 'tag
-           (while t
-             (mime-view-partial-message target)
-             (set-buffer article-buffer)
-             (setq parameters (mime-entity-parameters entity))
-             (setq the-id (cdr (assoc "id" parameters)))
+      (setq subject-id (mime-entity-read-field entity 'Subject))
+      (if (string-match "[0-9\n]+" subject-id)
+         (setq subject-id (substring subject-id 0 (match-beginning 0)))
+       )
+      (save-excursion
+       (set-buffer subject-buf)
+       (while (search-backward subject-id nil t))
+       (catch 'tag
+         (while t
+           (mime-view-partial-message target)
+           (set-buffer article-buffer)
+           (let* ((situation
+                   (mime-entity-situation mime-message-structure))
+                  (the-id (cdr (assoc "id" situation))))
              (when (string= the-id id)
-               (mime-store-message/partial-piece entity parameters)
+               (mime-store-message/partial-piece mime-message-structure
+                                                 situation)
                (if (file-exists-p full-file)
                    (throw 'tag nil)
                  ))
@@ -92,8 +93,8 @@ partial messages using mime-view."
                         ))
                  (error "not found")
                )
-             )
-           ))))))
+             ))
+         )))))
 
 
 ;;; @ end
index a37b790..90aad3a 100644 (file)
@@ -71,7 +71,6 @@
         (new-name (format "%s-%s" (buffer-name) entity-number))
         (the-buf (current-buffer))
         (mother mime-preview-buffer)
-        (mode major-mode)
         representation-type)
     (set-buffer (get-buffer-create new-name))
     (erase-buffer)
@@ -94,9 +93,7 @@
           (while (re-search-forward "^- -" nil t)
             (replace-match "-")
             )
-          (setq representation-type
-                (cdr (or (assq mode mime-raw-representation-type-alist)
-                         (assq t    mime-raw-representation-type-alist))))
+          (setq representation-type (mime-entity-representation-type entity))
           )
          ((progn
             (goto-char (point-min))
                          (and
                           (search-forward "\n\n")
                           (match-end 0)))
-          (setq representation-type (function mime-text-decode-buffer))
+          (setq representation-type 'binary)
           ))
     (setq major-mode 'mime-show-message-mode)
     (setq mime-raw-representation-type representation-type)
@@ -168,14 +165,14 @@ It should be ISO 639 2 letter language code such as en, ja, ...")
         (onum (if (> knum 0)
                   (1- knum)
                 (1+ knum)))
-        (oinfo (mime-raw-find-entity-from-node-id
-                (cons onum mother-node-id) mime-raw-message-info))
+        (orig-entity (mime-raw-find-entity-from-node-id
+                      (cons onum mother-node-id) mime-message-structure))
         (basename (expand-file-name "tm" mime-temp-directory))
         (orig-file (make-temp-name basename))
         (sig-file (concat orig-file ".sig"))
         )
-    (mime-raw-write-region (mime-entity-point-min oinfo)
-                          (mime-entity-point-max oinfo)
+    (mime-raw-write-region (mime-entity-point-min orig-entity)
+                          (mime-entity-point-max orig-entity)
                           orig-file)
     (save-excursion (mime-show-echo-buffer))
     (mime-write-decoded-region (save-excursion
@@ -228,9 +225,9 @@ It should be ISO 639 2 letter language code such as en, ja, ...")
         (onum (if (> knum 0)
                   (1- knum)
                 (1+ knum)))
-        (oinfo (mime-raw-find-entity-from-node-id
-                (cons onum mother-node-id) mime-raw-message-info)))
-    (mime-view-application/pgp oinfo situation)
+        (orig-entity (mime-raw-find-entity-from-node-id
+                      (cons onum mother-node-id) mime-message-structure)))
+    (mime-view-application/pgp orig-entity situation)
     ))
 
 
index 8c94c23..ee41aba 100644 (file)
@@ -295,49 +295,49 @@ window.")
          "\\(\\." mime-view-file-name-char-regexp "+\\)*"))
 
 (defun mime-entity-safe-filename (entity)
-  (replace-as-filename
-   (or (mime-entity-filename entity)
-       (let ((ret (or (mime-entity-read-field entity 'Content-Description)
-                     (mime-entity-read-field entity 'Subject))))
-        (if (or (string-match mime-view-file-name-regexp-1 ret)
-                (string-match mime-view-file-name-regexp-2 ret))
-            (substring ret (match-beginning 0)(match-end 0))
-          )))))
+  (let ((filename
+        (or (mime-entity-filename entity)
+            (let ((subj
+                   (or (mime-entity-read-field entity 'Content-Description)
+                       (mime-entity-read-field entity 'Subject))))
+              (if (and subj
+                       (or (string-match mime-view-file-name-regexp-1 subj)
+                           (string-match mime-view-file-name-regexp-2 subj)))
+                  (substring subj (match-beginning 0)(match-end 0))
+                )))))
+    (if filename
+       (replace-as-filename filename)
+      )))
 
 
 ;;; @ file extraction
 ;;;
 
-(defun mime-save-content (entity cal)
-  (let ((beg (mime-entity-point-min entity))
-       (end (mime-entity-point-max entity)))
-    (goto-char beg)
-    (let* ((name (save-restriction
-                  (narrow-to-region beg end)
-                  (mime-entity-safe-filename entity)
-                  ))
-          (encoding (or (cdr (assq 'encoding cal)) "7bit"))
-          (filename (if (and name (not (string-equal name "")))
-                        (expand-file-name name
-                                          (save-window-excursion
-                                            (call-interactively
-                                             (function
-                                              (lambda (dir)
-                                                (interactive "DDirectory: ")
-                                                dir)))))
-                      (save-window-excursion
-                        (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) end filename encoding)
-      )))
+(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
+                                          (call-interactively
+                                           (function
+                                            (lambda (dir)
+                                              (interactive "DDirectory: ")
+                                              dir)))))
+                    (save-window-excursion
+                      (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 "")))
+    (mime-write-decoded-region (mime-entity-body-start entity)
+                              (mime-entity-body-end entity)
+                              filename encoding)
+    ))
 
 
 ;;; @ file detection
@@ -411,9 +411,7 @@ It is registered to variable `mime-preview-quitting-method-alist'."
         (cnum (mime-raw-point-to-entity-number beg))
         (new-name (format "%s-%s" (buffer-name) cnum))
         (mother mime-preview-buffer)
-        (representation-type
-         (cdr (or (assq major-mode mime-raw-representation-type-alist)
-                  (assq t mime-raw-representation-type-alist))))
+        (representation-type (mime-entity-representation-type entity))
         str)
     (setq str (buffer-substring beg end))
     (switch-to-buffer new-name)
@@ -486,10 +484,9 @@ saved as binary.  Otherwise the region is saved by `write-region'."
                               mime-preview-buffer))
          (select-window pwin)
          )
-      (re-search-forward "^$")
-      (goto-char (1+ (match-end 0)))
       (setq file (concat root-dir "/" number))
-      (mime-raw-write-region (point) (mime-entity-point-max entity) file)
+      (mime-raw-write-region (mime-entity-body-start entity)
+                            (mime-entity-body-end entity) file)
       (let ((total-file (concat root-dir "/CT")))
        (setq total
              (if total
index 60bbdc7..db8c155 100644 (file)
@@ -37,28 +37,18 @@ It decodes MIME-encoding then code-converts as MIME-charset.
 MIME-encoding is value of field 'encoding of SITUATION.  It must be
 'nil or string.  MIME-charset is value of field \"charset\" of
 SITUATION.  It must be symbol."
-  (let* ((buffer (mime-entity-buffer entity))
-        (presentation-type
-        (save-excursion
-          (set-buffer buffer)
-          (or mime-raw-representation-type
-              (cdr (or (assq major-mode mime-raw-representation-type-alist)
-                       (assq t mime-raw-representation-type-alist)))
-              ))))
-    (save-restriction
-      (insert-buffer-substring buffer
-                              (mime-entity-body-start entity)
-                              (mime-entity-body-end entity))
-      (let ((encoding (mime-entity-encoding entity)))
-       (mime-decode-region (point-min) (point-max) encoding)
-       (if (or (eq presentation-type 'binary)
-               (not (member encoding '(nil "7bit" "8bit" "binary"))))
-           (decode-mime-charset-region (point-min)(point-max)
-                                       (or (mime-content-type-parameter
-                                            (mime-entity-content-type entity)
-                                            "charset")
-                                           default-mime-charset))
-         ))))
+  (let ((str (mime-entity-content entity)))
+    (insert
+     (if (and (mime-entity-cooked-p entity)
+             (member (mime-entity-encoding entity)
+                     '(nil "7bit" "8bit" "binary")))
+        str
+       (decode-mime-charset-string str
+                                  (or (mime-content-type-parameter
+                                       (mime-entity-content-type entity)
+                                       "charset")
+                                      default-mime-charset))
+       )))
   (run-hooks 'mime-text-decode-hook)
   )
 
index 5077e46..1a0dd3e 100644 (file)
@@ -27,9 +27,7 @@
 
 ;;; Code:
 
-(require 'std11)
-(require 'mime-lib)
-(require 'mime-parse)
+(require 'mime)
 (require 'semi-def)
 (require 'calist)
 (require 'alist)
 ;;; @ in raw-buffer (representation space)
 ;;;
 
-(defvar mime-raw-message-info nil
-  "Information about structure of message.
-Please use reference function `mime-entity-SLOT' to get value of SLOT.
-
-Following is a list of slots of the structure:
-
-buffer                 buffer includes this entity (buffer).
-node-id                        node-id (list of integers)
-header-start           minimum point of header in raw-buffer
-header-end             maximum point of header in raw-buffer
-body-start             minimum point of body in raw-buffer
-body-end               maximum point of body in raw-buffer
-content-type           content-type (content-type)
-content-disposition    content-disposition (content-disposition)
-encoding               Content-Transfer-Encoding (string or nil)
-children               entities included in this entity (list of entity)
-
-If an entity includes other entities in its body, such as multipart or
-message/rfc822, `mime-entity' structures of them are included in
-`children', so the `mime-entity' structure become a tree.")
-(make-variable-buffer-local 'mime-raw-message-info)
-
-
 (defvar mime-preview-buffer nil
   "MIME-preview buffer corresponding with the (raw) buffer.")
 (make-variable-buffer-local 'mime-preview-buffer)
@@ -122,15 +97,15 @@ This value is overridden by buffer local variable
                                             &optional message-info)
   "Return entity from ENTITY-NODE-ID in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (mime-raw-find-entity-from-number (reverse entity-node-id) message-info))
 
 (defun mime-raw-find-entity-from-number (entity-number &optional message-info)
   "Return entity from ENTITY-NUMBER in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (or message-info
-      (setq message-info mime-raw-message-info))
+      (setq message-info mime-message-structure))
   (if (eq entity-number t)
       message-info
     (let ((sn (car entity-number)))
@@ -145,9 +120,9 @@ If optional argument MESSAGE-INFO is not specified,
 (defun mime-raw-find-entity-from-point (point &optional message-info)
   "Return entity from POINT in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (or message-info
-      (setq message-info mime-raw-message-info))
+      (setq message-info mime-message-structure))
   (if (and (<= (mime-entity-point-min message-info) point)
           (<= point (mime-entity-point-max message-info)))
       (let ((children (mime-entity-children message-info)))
@@ -199,16 +174,25 @@ 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))
+
 (defsubst mime-entity-parent (entity &optional message-info)
   "Return mother entity of ENTITY.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' in buffer of ENTITY is used."
+`mime-message-structure' in buffer of ENTITY is used."
   (mime-raw-find-entity-from-node-id
    (cdr (mime-entity-node-id entity))
    (or message-info
        (save-excursion
         (set-buffer (mime-entity-buffer entity))
-        mime-raw-message-info))))
+        mime-message-structure))))
 
 (defun mime-entity-situation (entity)
   "Return situation of ENTITY."
@@ -258,22 +242,13 @@ If optional argument MESSAGE-INFO is not specified,
 
 (defun mime-entity-filename (entity)
   (or (mime-entity-uu-filename entity)
-      (let ((ret (mime-entity-content-disposition entity)))
-       (and ret
-            (setq ret (mime-content-disposition-filename ret))
-            (std11-strip-quoted-string ret)
-            ))
-      (let ((ret (mime-entity-content-type entity)))
-       (and ret
-            (setq ret
-                  (cdr
-                   (let ((param (mime-content-type-parameters ret)))
-                     (or (assoc "name" param)
-                         (assoc "x-name" param))
-                     )))
-            (std11-strip-quoted-string ret)
-            ))
-      ))
+      (mime-content-disposition-filename
+       (mime-entity-content-disposition entity))
+      (cdr (let ((param (mime-content-type-parameters
+                        (mime-entity-content-type entity))))
+            (or (assoc "name" param)
+                (assoc "x-name" param))
+            ))))
 
 (defun mime-view-entity-title (entity)
   (or (mime-entity-read-field entity 'Content-Description)
@@ -285,21 +260,21 @@ If optional argument MESSAGE-INFO is not specified,
 (defsubst mime-raw-point-to-entity-node-id (point &optional message-info)
   "Return entity-node-id from POINT in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (mime-entity-node-id (mime-raw-find-entity-from-point point message-info)))
 
 (defsubst mime-raw-point-to-entity-number (point &optional message-info)
   "Return entity-number from POINT in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (mime-entity-number (mime-raw-find-entity-from-point point message-info)))
 
 (defun mime-raw-flatten-message-info (&optional message-info)
   "Return list of entity in mime-raw-buffer.
 If optional argument MESSAGE-INFO is not specified,
-`mime-raw-message-info' is used."
+`mime-message-structure' is used."
   (or message-info
-      (setq message-info mime-raw-message-info))
+      (setq message-info mime-message-structure))
   (let ((dest (list message-info))
        (rcl (mime-entity-children message-info)))
     (while rcl
@@ -810,15 +785,13 @@ The compressed face will be piped to this command.")
       (when header-is-visible
        (if header-presentation-method
            (funcall header-presentation-method entity situation)
-         (mime-insert-decoded-header
-          entity
-          mime-view-ignored-field-list mime-view-visible-field-list
-          (save-excursion
-            (set-buffer raw-buffer)
-            (if (eq (cdr (assq major-mode mime-raw-representation-type-alist))
-                    'binary)
-                default-mime-charset)
-            )))
+         (mime-insert-decoded-header entity
+                                     mime-view-ignored-field-list
+                                     mime-view-visible-field-list
+                                     (if (mime-entity-cooked-p entity)
+                                         nil
+                                       default-mime-charset))
+         )
        (goto-char (point-max))
        (insert "\n")
        (run-hooks 'mime-display-header-hook)
@@ -995,7 +968,7 @@ The compressed face will be piped to this command.")
        (setq preview-buffer
              (concat "*Preview-" (buffer-name raw-buffer) "*")))
     (set-buffer raw-buffer)
-    (setq mime-raw-message-info (mime-parse-message))
+    (mime-parse-buffer)
     (setq mime-preview-buffer preview-buffer)
     (let ((inhibit-read-only t))
       (switch-to-buffer preview-buffer)
index 8ca1e9a..2874217 100644 (file)
@@ -29,7 +29,7 @@
 (eval-when-compile (require 'cl))
 
 
-(defconst mime-user-interface-version '("WEMI" "Atami" 1 7 0)
+(defconst mime-user-interface-version '("WEMI" "Kan'nami" 1 7 1)
   "Implementation name, version name and numbers of MIME-kernel package.")
 
 (autoload 'mule-caesar-region "mule-caesar"