new branch (apply unlimited patch to flim-1_14 branch) limit-1_14_7
authorsimm <simm>
Sun, 20 May 2001 17:40:30 +0000 (17:40 +0000)
committersimm <simm>
Sun, 20 May 2001 17:40:30 +0000 (17:40 +0000)
ChangeLog
Makefile
VERSION
eword-decode.el
eword-encode.el
mime-def.el
mime-parse.el
mime.el
mmgeneric.el
std11.el

index cba1a3c..2928d8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-21  SHIMADA Mitsunobu <simm@pure.fan.gr.jp>
+
+       * LIMIT: CVS commit
+       (apply unlimited patch to flim-1_14 branch)
+
 2001-04-27  Shuhei KOBAYASHI  <shuhei@aqua.ocn.ne.jp>
 
        * mime.el (mime-entity-read-field): Would capitalize twice.
@@ -8,6 +13,11 @@
 
        * mmgeneric.el (mime-entity-fetch-field): Ditto.
 
+2001-04-22  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * LIMIT: Version 1.14.7 (Fujiidera) released.
+       (apply unlimited patch to FLIM Version 1.14.2)
+
 2001-04-15  Shuhei KOBAYASHI  <shuhei@aqua.ocn.ne.jp>
 
        * eword-decode.el (eword-lexical-analyze-internal):
index d10c19f..7af1c40 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,9 @@
 # Makefile for FLIM.
 #
 
-PACKAGE = flim
+PACKAGE = limit
 API    = 1.14
-RELEASE = 2
+RELEASE = 7
 
 TAR    = tar
 RM     = /bin/rm -f
diff --git a/VERSION b/VERSION
index 4c95594..76efd59 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-[FLIM Version names]
+[FLIM Version names] -*- coding: ctext; -*-
 
 1.0.0  -----
 
 1.13.0 Iwami                   \e$(B@P8+\e(B
 1.13.1 Tawaramoto              \e$(BED86K\\e(B           ; <=> \e$(B6aE4\e(B \e$(B@>ED86K\\e(B
 1.13.2 Kasanui                 \e$(B3^K%\e(B
-1.14.0 Ninokuchi               \e$(B?7%N8}\e(B
-1.14.1 Yagi                    \e$(BH,LZ\e(B             ; = \e$(B6aE4\e(B \e$(BBg:e@~\e(B
-1.14.2 Yagi-Nishiguchi         \e$(BH,LZ@>8}\e(B
+------ Ninokuchi               \e$(B?7%N8}\e(B
+------ Yagi                    \e$(BH,LZ\e(B             ; = \e$(B6aE4\e(B \e$(BBg:e@~\e(B
+------ Yagi-Nishiguchi         \e$(BH,LZ@>8}\e(B
 ------ Unebigory\e-Dòmae\e-A             \e$(B@&K58fNMA0\e(B
------- Kashiharajing\e-Dþ-mae\e-A        \e$(B3`86?@5\A0\e(B       ; = \e$(B6aE4\e(B \e$(BFnBg:e@~!"5HLn@~\e(B
+------ Kashiharajingu-mae      \e$(B3`86?@5\A0\e(B       ; = \e$(B6aE4\e(B \e$(BFnBg:e@~!"5HLn@~\e(B
 
 
 [Chao Version names]
 1.14.0 Momoyama                \e$(BEm;3\e(B
 1.14.1 Rokujiz\e-Dò\e-A          \e$(BO;COB"\e(B
 ------ Kohata                  \e$(BLZH(\e(B
+------ \e-DÒbaku\e-A                     \e$(B2+]!\e(B
+------ Uji                     \e$(B1'<#\e(B
+------ Shinden                 \e$(B?7ED\e(B
+------ J\e-Dòyò\e-A                      \e$(B>kM[\e(B
+------ Nagaike                 \e$(BD9CS\e(B
+------ Yamashiro-Aodani        \e$(B;3>k@DC+\e(B
+------ Yamashiro-Taga          \e$(B;3>kB?2l\e(B
+------ Tamamizu                \e$(B6L?e\e(B
+------ Tanakura                \e$(BC*AR\e(B
+------ Kamikoma                \e$(B>e9}\e(B
+------ Kidu                    \e$(BLZDE\e(B
+
+
+[CLIME Version names]
+
+;;-------------------------------------------------------------------------
+;;                             \e$(BBg:eEE5$50F;\e(B
+;;                             \e$(BK!N4;{@~\e(B \e$(B!J5l\e(B \e$(BE7M}7ZJXoDF;\e(B \e$(BE7M}@~!K\e(B
+;;-------------------------------------------------------------------------
+1.13.0 Shin-H\e-Dòryþji\e-A              \e$(B?7K!N4;{\e(B ; <=> \e$(B4X@>K\@~\e(B \e$(BK!N4;{\e(B
+1.13.1 Ando                    \e$(B0BEH\e(B
+1.13.2 Nukatabe                \e$(B3[EDIt\e(B
+1.13.3 Hirahata                \e$(BJ?C<\e(B             ; = \e$(BBg50\e(B \e$(BE7M}@~!"@&K5@~\e(B
+
+;;-------------------------------------------------------------------------
+;;     Hokuriku Railway        \e$(BKLN&E4F;\e(B
+;;     Nomi Line               \e$(BG=H~@~\e(B           \e$(B!J5l\e(B \e$(BG=H~EE5$E4F;!K\e(B
+;;-------------------------------------------------------------------------
+1.13.4 Shin-Terai              \e$(B?7;{0f\e(B           ; <=> \e$(BKLN&K\@~\e(B \e$(B;{0f\e(B
+1.13.5 Kaga-Fukuoka            \e$(B2C2lJ!2,\e(B
+1.13.6 Nakanosh\e-Dò\e-A         \e$(BCf%N>1\e(B
+
+
+[LIMIT Version names]
+
+;;-------------------------------------------------------------------------
+;;     Kinki Nippon Railway    \e$(B6a5&F|K\E4F;\e(B     http://www.kintetsu.co.jp/
+;;     Minami-\e-DÒsaka\e-A Line \e$(BFnBg:e@~\e(B
+;;-------------------------------------------------------------------------
+1.13.0 \e-DÒsaka-Abenobashi\e-A          \e$(BBg:e0$ItLn66\e(B     ; <=> JR, \e$(BBg:e;T8rDL6I\e(B
+1.13.1 Koboreguchi                     \e$(B2OKY8}\e(B
+1.13.2 Kita-tanabe                     \e$(BKLEDJU\e(B
+1.13.3 Imagawa                         \e$(B:#@n\e(B
+1.13.4 Harinakano                      \e$(B?KCfLn\e(B
+1.14.0 Yata                            \e$(BLpED\e(B
+1.14.1 Kawachi-Amami                   \e$(B2OFbE7H~\e(B
+1.14.2 Nunose                          \e$(BI[G&\e(B
+1.14.3 Takaminosato                    \e$(B9b8+%NN$\e(B
+1.14.4 Kawachi-Matsubara               \e$(B2OFb>>86\e(B
+1.14.5 Eganosh\e-Dò\e-A                  \e$(B7C2f%NAq\e(B
+1.14.6 Takawashi                       \e$(B9bOI\e(B
+------ Fuj\e-Dïdera\e-A                  \e$(BF#0f;{\e(B
+------ Hajinosato                      \e$(BEZ;U$NN$\e(B
+------ D\e-Dòmyòji\e-A                           \e$(BF;L@;{\e(B
+------ Furuichi                        \e$(B8E;T\e(B             ; = \e$(B6aE4\e(B \e$(BD9Ln@~\e(B
+------ Komagatani                      \e$(B6p%vC+\e(B
+------ Kaminotaishi                    \e$(B>e%NB@;R\e(B
+------ Nij\e-Dòsan\e-A                           \e$(BFs>e;3\e(B
+------ Nij\e-Dòjinjaguchi\e-A                    \e$(BFs>e?@<R8}\e(B
+------ Taimadera                       \e$(BEvKc;{\e(B
+------ Iwaki                           \e$(BHX>k\e(B
+------ Shakudo                         \e$(B<\EZ\e(B             ; = \e$(B6aE4\e(B \e$(B8f=j@~\e(B
+------ Takadashi                       \e$(B9bED;T\e(B
+------ Ukiana                          \e$(BIb9&\e(B
+------ B\e-Dòjò\e-A                              \e$(BK7>k\e(B
+------ Kashiharajing\e-Dþ-Nisiguchi\e-A  \e$(B3`86?@5\@>8}\e(B
+------ Kashiharajing\e-Dþmae\e-A         \e$(B3`86?@5\A0\e(B       ; = \e$(B6aE4\e(B \e$(B3`86@~\e(B
+
+;;-------------------------------------------------------------------------
+;;     Kinki Nippon Railway    \e$(B6a5&F|K\E4F;\e(B     http://www.kintetsu.co.jp/
+;;     Yoshino Line    \e$(B5HLn@~\e(B [\e$(B$G$b!"$3$l!"K\2H$,;H$&$s$d$m$J$!!D\e(B (^^;]
+;;-------------------------------------------------------------------------
+       (Kashiharajing\e-Dþmae)\e-A               (\e$(B3`86?@5\A0\e(B)
+------ Okadera                         \e$(B2,;{\e(B
+------ Asuka                           \e$(BHtD;\e(B
+------ Tsubosakayama                   \e$(BTd:e;3\e(B
+------ Ichio                           \e$(B;THx\e(B
+------ Kuzu                            \e$(B3k\e(B
+------ Yoshinoguchi                    \e$(B5HLn8}\e(B           ; = JR \e$(BOB2N;3@~\e(B
+------ Kusurimizu                      \e$(BLt?e\e(B
+------ Fukugami                        \e$(BJ!?@\e(B
+------ \e-DÒada\e-A                              \e$(BBg0$B@\e(B
+------ Shimoichiguchi                  \e$(B2<;T8}\e(B
+------ Koshibe                         \e$(B1[It\e(B
+------ Muda                            \e$(BO;ED\e(B
+------ Yamato-Kamiichi                 \e$(BBgOB>e;T\e(B
+------ Yoshinojing\e-Dþ\e-A                      \e$(B5HLn?@5\\e(B
+------ Yoshino                         \e$(B5HLn\e(B
index e4143e6..cc58861 100644 (file)
@@ -180,24 +180,31 @@ decode the charset included in it, it is not decoded."
          (concat result (eword-decode-token token))
        result))))
 
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Tue, 01 Feb 2000 13:43:09 +0900
 (defun eword-decode-unstructured-field-body (string &optional start-column
                                                    max-column)
   (eword-decode-string
-   (decode-mime-charset-string string default-mime-charset)))
+   (decode-mime-charset-string-unlimited
+    string
+    (or default-mime-charset-unlimited default-mime-charset))))
 
 (defun eword-decode-and-unfold-unstructured-field-body (string
                                                        &optional start-column
                                                        max-column)
   (eword-decode-string
-   (decode-mime-charset-string (std11-unfold-string string)
-                              default-mime-charset)
+   (decode-mime-charset-string-unlimited
+    (std11-unfold-string string)
+    (or default-mime-charset-unlimited default-mime-charset))
    'must-unfold))
 
 (defun eword-decode-unfolded-unstructured-field-body (string
                                                      &optional start-column
                                                      max-column)
   (eword-decode-string
-   (decode-mime-charset-string string default-mime-charset)
+   (decode-mime-charset-string-unlimited
+    string
+    (or default-mime-charset-unlimited default-mime-charset))
    'must-unfold))
 
 
@@ -743,10 +750,13 @@ be the result.")
       (setq ret
            (let ((rest mime-header-lexical-analyzer)
                  func r)
+             ;; unlimited patch by simm-emacs@fan.gr.jp,
+             ;;   Mon, 10 Jan 2000 12:52:39 +0900
              (while (and (setq func (car rest))
-                         (null
-                          (setq r (funcall func string start must-unfold)))
-                         )
+                         (or (and mime-decode-unlimited
+                                  (eq func 'eword-analyze-quoted-string))
+                             (null
+                              (setq r (funcall func string start must-unfold)))))
                (setq rest (cdr rest)))
              (or r
                  (cons (cons 'error (substring string start)) (1+ len)))
@@ -787,8 +797,14 @@ characters encoded as encoded-words or invalid \"raw\" format.
             (while value
               (setq dest (concat dest
                                  (if (stringp (car value))
-                                     (std11-wrap-as-quoted-pairs
-                                      (car value) '(?( ?)))
+                                     ;; unlimited patch by simm-emacs@fan.gr.jp
+                                     ;;   Mon, 10 Jan 2000 12:53:46 +0900
+                                     (if mime-decode-unlimited
+                                         (eword-decode-string
+                                          (std11-wrap-as-quoted-pairs
+                                           (car value) '(?( ?))))
+                                       (std11-wrap-as-quoted-pairs
+                                        (car value) '(?( ?))))
                                    (eword-decode-token (car value))
                                    ))
                     value (cdr value))
index f075db3..e8707b4 100644 (file)
@@ -516,14 +516,14 @@ MODE is allows `text', `comment', `phrase' or nil.  Default value is
      (list (list ";" nil nil))))))
 
 (defsubst eword-encode-addresses-to-rword-list (addresses)
-  (let ((dest (eword-encode-address-to-rword-list (car addresses))))
+  (let ((dest (eword-encode-mailbox-to-rword-list (car addresses))))
     (if dest
        (while (setq addresses (cdr addresses))
          (setq dest
                (nconc dest
                       (list '("," nil nil))
                       ;; (list '(" " nil nil))
-                      (eword-encode-address-to-rword-list (car addresses))))))
+                      (eword-encode-mailbox-to-rword-list (car addresses))))))
     dest))
 
 (defsubst eword-encode-msg-id-to-rword-list (msg-id)
index 5ff449e..deeb740 100644 (file)
@@ -1,4 +1,4 @@
-;;; mime-def.el --- definition module about MIME -*- coding: iso-8859-4; -*-
+;;; mime-def.el --- definition module about MIME -*- coding: ctext; -*-
 
 ;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
 
@@ -34,7 +34,7 @@
   )
 
 (eval-and-compile
-  (defconst mime-library-product ["FLIM" (1 14 2) "Yagi-Nishiguchi"]
+  (defconst mime-library-product ["LIMIT" (1 14 7) "Fujiidera"]
     "Product name, version number and code name of MIME-library package."))
 
 (defmacro mime-product-name (product)
@@ -394,6 +394,39 @@ variable and (nth 1 (car (last ARGS))) is name of backend (encoding)."
          ))))
 
 
+;;; @ unlimited patch
+;;;
+
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Mon, 10 Jan 2000 12:55:49 +0900
+(defvar mime-decode-unlimited t
+  "If non-nil, LIMIT decodes where RFC-illegal position.
+If nil, LIMIT behaves as FLIM.")
+
+(defvar default-mime-charset-unlimited 'auto-detect
+  "Default Value of MIME-charset.
+It is used when MIME-charset is not specified.
+It must be symbol.
+
+If its value is 'auto-detect, (mime-insert-text-content) detects
+Japanese coding-system and convert it.
+
+If its value is nil, use `default-mime-charset' instead.")
+
+(static-if (boundp 'nonascii-translation-table)
+    (defconst nonascii-translation-table-unlimited
+      (let ((i 0) (vec (make-vector 256 0)))
+       (while (< i 256)
+         (aset vec i i)
+         (setq i (1+ i)))
+       vec)
+      "Translation table to convert non-ASCII unibyte codes to multibyte.
+This is used for no-converting unibyte text to multibyte,
+and for inserting character codes specified by number.
+
+See `nonascii-translation-table'."))
+
+
 ;;; @ end
 ;;;
 
index 2323fba..ce8aeaf 100644 (file)
@@ -83,16 +83,30 @@ be the result."
   (concat "^[ \t]*\;[ \t]*\\(" mime-token-regexp "\\)"
          "[ \t]*=[ \t]*\\(" mime/content-parameter-value-regexp "\\)"))
 
-(defun mime-parse-parameter (str)
-  (if (string-match mime::parameter-regexp str)
-      (let ((e (match-end 2)))
-       (cons
-        (cons (downcase (substring str (match-beginning 1) (match-end 1)))
-              (std11-strip-quoted-string
-               (substring str (match-beginning 2) e))
-              )
-        (substring str e)
-        ))))
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Mon, 10 Jan 2000 12:59:46 +0900
+(defun mime-parse-parameter (string)
+  (let ((str string))
+    (and mime-decode-unlimited
+         (string-match "\033" str)
+         (setq str (decode-coding-string string 'iso-2022-7bit-ss2)))
+    (if (string-match mime::parameter-regexp str)
+        (let ((e (match-end 2)))
+          (if mime-decode-unlimited
+              (cons
+               (cons (downcase
+                      (encode-coding-string
+                       (substring str (match-beginning 1) (match-end 1))
+                       'iso-2022-7bit-ss2))
+                     (encode-coding-string
+                      (std11-strip-quoted-string
+                       (substring str (match-beginning 2) e))
+                      'iso-2022-jp))
+               (encode-coding-string (substring str e) 'iso-2022-7bit-ss2))
+            (cons
+             (cons (downcase (substring str (match-beginning 1) (match-end 1)))
+                   (std11-strip-quoted-string (substring sutr (match-beginning 2) e)))
+             (substring str e)))))))
 
 
 ;;; @ Content-Type
diff --git a/mime.el b/mime.el
index 005790e..49707a9 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -388,16 +388,23 @@ default value."
                (buffer-substring (match-beginning 0)(match-end 0))
              )))))
 
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Mon, 10 Jan 2000 12:59:46 +0900
 (defun mime-entity-filename (entity)
   "Return filename of ENTITY."
-  (or (mime-entity-uu-filename entity)
-      (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))
-            ))))
+  (let ((filename
+        (or (mime-entity-uu-filename entity)
+            (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))))
+            "")))
+    (or (and mime-decode-unlimited
+            (string-match "\033" filename)
+            (decode-mime-charset-string filename 'iso-2022-jp 'CRLF))
+       (eword-decode-string filename))))
 
 
 (defsubst mime-entity-media-type (entity)
@@ -426,6 +433,150 @@ default value."
   (mime-entity-set-encoding-internal entity encoding))
 
 
+;;; @ unlimited patch
+;;;
+
+;; unlimited patch by simm-emacs@fan.gr.jp (code derives from irchat-pj)
+;;   Tue, 01 Feb 2000 01:42:05 +0900
+(defun mime-detect-coding-system-region-unlimited (beg end)
+  "Detect coding system on region."
+  (let (ch esc prev flag)
+    (save-excursion
+      (catch 'detect
+       ;; check ISO-2022-JP / ascii
+       (catch 'quit
+         (goto-char beg)
+         (while (< (point) end)
+           (setq ch (following-char))
+           (and (<= 256 ch)
+                (throw 'detect nil)) ;;'noconv))
+           (and (<= 128 ch)
+                (throw 'quit t))
+           (and (= 27 ch)
+                (setq esc t))
+           (forward-char 1))
+         (throw 'detect (if esc 'iso-2022-jp nil))) ;;'noconv)))
+       ;; check EUC-JP / SHIFT-JIS
+       (if esc (throw 'detect 'iso-2022-jp))
+       (while (< (point) end)
+         (setq ch (following-char))
+         (or (and (= 27 ch)                        ;; ESC
+                  (throw 'detect 'iso-2022-jp))
+             (and (<= 128 ch) (<= ch 141)          ;; 0x80 <= ch <= 0x8d
+                  (throw 'detect 'shift_jis))
+             (and (<= 144 ch) (<= ch 159)          ;; 0x90 <= ch <= 0x9f
+                  (throw 'detect 'shift_jis))
+             (and (eq 'shift_jis prev) (<= ch 127) ;; second byte MSB == 0
+                  (throw 'detect 'shift_jis))
+             (and (eq 'euc-jp prev)
+                  (<= 161 ch) (<= ch 243)          ;; second byte of EUC Kana
+                  (setq prev nil
+                        flag 'euc-jp))
+             (and (eq nil prev)
+                  (or (= 164 ch) (= 165 ch))       ;; first byte of EUC kana
+                  (setq prev 'euc-jp))
+             (< ch 160)                            ;;         ch <= 0xa0
+             (and (eq 'euc-jp prev)
+                  (throw 'detect 'euc-jp))
+             (setq prev (if prev nil 'shift_jis)
+                   flag (if (eq 'euc-jp flag) 'euc-jp 'shift_jis)))
+         (forward-char 1))
+       flag))))
+       ;;(or flag 'noconv)))))
+
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Tue, 01 Feb 2000 01:56:38 +0900
+(defun mime-detect-coding-system-string-unlimited (str)
+  "Detect coding system on string."
+  (save-excursion
+    (set-buffer (get-buffer-create " *Temporary unlimited*"))
+    (insert str)
+    (unwind-protect
+       (mime-detect-coding-system-region-unlimited (point-min) (point-max))
+      (kill-buffer nil))))
+
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Tue, 01 Feb 2000 13:32:14 +0900
+(defsubst insert-unlimited (str)
+  "Insert with no-conversion.
+On GNU Emacs 20.*, (insert str) after (set-buffer-multibyte nil).
+Other environment, perform (insert str)."
+  (static-if (boundp 'nonascii-translation-table-unlimited)
+      (let ((nonascii-translation-table nonascii-translation-table-unlimited))
+       (insert str))
+    (insert str)))
+
+(defun decode-mime-charset-string-dist-unlimited (str charset &optional lbt)
+  "Detect coding system on string."
+  (if (not (eq 'auto-detect charset))
+      (decode-mime-charset-string str charset lbt)
+    (save-excursion
+      (set-buffer (get-buffer-create " *Temporary unlimited*"))
+      (unwind-protect
+         (let (code)
+           (insert-unlimited str)
+           (setq code (mime-detect-coding-system-region-unlimited (point-min) (point-max)))
+           (cond ((eq code 'euc-jp)
+                  (message "EUC-JP code detected, so convert this message."))
+                 ((eq code 'shift_jis)
+                  (message "SHIFT-JIS code detected, so convert this message.")))
+           (decode-mime-charset-region (point-min) (point-max)
+                                       (or code default-mime-charset)
+                                       lbt)
+           (buffer-substring (point-min) (point-max)))
+       (kill-buffer nil)))))
+
+(defun decode-mime-charset-string-unlimited (str charset &optional lbt)
+  "Detect coding system on string."
+  (cond ((eq 'auto-detect charset)
+        (save-excursion
+          (set-buffer (get-buffer-create " *Temporary unlimited*"))
+          (unwind-protect
+              (let (code)
+                (insert-unlimited str)
+                (setq code
+                      (mime-detect-coding-system-region-unlimited (point-min) (point-max)))
+                (cond ((eq code 'euc-jp)
+                       (message "EUC-JP code detected, so convert this message."))
+                      ((eq code 'shift_jis)
+                       (message "SHIFT-JIS code detected, so convert this message.")))
+                (decode-mime-charset-region (point-min) (point-max)
+                                            (or code default-mime-charset)
+                                            lbt)
+                (buffer-substring (point-min) (point-max)))
+            (kill-buffer nil))))
+       ((string= "us-ascii" charset)
+        (save-excursion
+          (set-buffer (get-buffer-create " *Temporary unlimited*"))
+          (unwind-protect
+              (let ((code 'us-ascii))
+                (insert-unlimited str)
+                (goto-char (point-min))
+                (while (not (eobp))
+                  (if (and (<= 32 (following-char)) (< (following-char) 128))
+                      (forward-char 1)
+                    (setq code nil)
+                    (goto-char (point-max))))
+                (cond ((eq code 'us-ascii)
+                       (decode-mime-charset-region (point-min) (point-max) nil lbt))
+                      (code
+                       (decode-mime-charset-region (point-min) (point-max) code lbt))
+                      (t
+                       (setq code
+                             (mime-detect-coding-system-region-unlimited
+                              (point-min) (point-max)))
+                       (when code
+                         (message "Declared US-ASCII but detected %s, so convert."
+                                  (if (eq code 'shift_jis) "SHIFT-JIS"
+                                    (upcase (prin1-to-string code))))
+                         (decode-mime-charset-region (point-min) (point-max)
+                                                     (or code default-mime-charset)
+                                                     lbt))))
+                (buffer-substring (point-min) (point-max)))
+            (kill-buffer nil))))
+       (t
+        (decode-mime-charset-string str charset lbt))))
+
 ;;; @ end
 ;;;
 
index 4b632f3..4690f32 100644 (file)
 ;; (autoload 'mime-parse-external "mime-parse")
 (autoload 'mime-entity-content "mime")
 
-(eval-and-compile
-  (luna-define-class mime-entity ()
-                    (location
-                     content-type children parent
-                     node-id
-                     content-disposition encoding
-                     ;; for other fields
-                     original-header parsed-header))
-
-  (luna-define-internal-accessors 'mime-entity)
-  )
+(luna-define-class mime-entity ()
+                  (location
+                   content-type children parent
+                   node-id
+                   content-disposition encoding
+                   ;; for other fields
+                   original-header parsed-header))
 
 (defalias 'mime-entity-representation-type-internal 'luna-class-name)
 (defalias 'mime-entity-set-representation-type-internal 'luna-set-class-name)
 
+(luna-define-internal-accessors 'mime-entity)
+
 (luna-define-method mime-entity-fetch-field ((entity mime-entity)
                                             field-name)
   (or (symbolp field-name)
   (cdr (assq field-name
             (mime-entity-original-header-internal entity))))
 
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Tue, 01 Feb 2000 13:32:14 +0900
 (luna-define-method mime-insert-text-content ((entity mime-entity))
   (insert
-   (decode-mime-charset-string (mime-entity-content entity)
-                              (or (mime-content-type-parameter
-                                   (mime-entity-content-type entity)
-                                   "charset")
-                                  default-mime-charset)
-                              'CRLF)
-   ))
+   (decode-mime-charset-string-unlimited
+    (mime-entity-content entity)
+    (or (mime-content-type-parameter
+        (mime-entity-content-type entity)
+        "charset")
+       default-mime-charset-unlimited
+       default-mime-charset)
+    'CRLF)))
 
 
 ;;; @ for mm-backend
index 97f9359..4523043 100644 (file)
--- a/std11.el
+++ b/std11.el
@@ -217,15 +217,29 @@ If BOUNDARY is not nil, it is used as message header separator."
          ))
       (setq i (1+ i))
       )
-    (concat dest (substring string b))
-    ))
+    ;; unlimited patch by simm-emacs@fan.gr.jp
+    ;;   Mon, 10 Jan 2000 13:03:02 +0900
+    (if mime-decode-unlimited
+        (eword-encode-string (concat dest (substring string b)))
+      (concat dest (substring string b)))))
 
 (defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n))
 
+;; unlimited patch by simm-emacs@fan.gr.jp
+;;   Mon, 10 Jan 2000 13:03:02 +0900
+(defvar std11-filename-coding-system nil
+  "Define coding-system for non-ASCII filename when send.
+Set this variable coding system symbol (ie. 'iso-2022-jp) or nil.
+If non-nil, std11-wrap-as-quoted-string use encode-coding-string.")
+
 (defun std11-wrap-as-quoted-string (string)
   "Wrap STRING as RFC 822 quoted-string."
   (concat "\""
-         (std11-wrap-as-quoted-pairs string std11-non-qtext-char-list)
+          ;; unlimited patch by simm-emacs@fan.gr.jp
+          ;;   Mon, 10 Jan 2000 13:03:02 +0900
+          (if std11-filename-coding-system
+              (encode-coding-system string std11-filename-coding-system)
+            (std11-wrap-as-quoted-pairs string std11-non-qtext-char-list))
          "\""))
 
 (defun std11-strip-quoted-pair (string)
@@ -762,7 +776,7 @@ represents addr-spec of RFC 822."
   "Return string of address part from parsed ADDRESS of RFC 822."
   (cond ((eq (car address) 'group)
         (mapconcat (function std11-address-string)
-                   (nth 2 address)
+                   (car (cdr address))
                    ", ")
         )
        ((eq (car address) 'mailbox)