Function `eword-decode-message-header' was renamed to
[elisp/semi.git] / eword-encode.el
index 890cc21..bd2350a 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Revision: 0.0 $
+;; Version: $Revision: 0.6 $
 ;; Keywords: encoded-word, MIME, multilingual, header, mail, news
 
 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
 ;;;
 
 (defconst eword-encode-RCS-ID
-  "$Id: eword-encode.el,v 0.0 1997-02-22 16:57:58 morioka Exp $")
+  "$Id: eword-encode.el,v 0.6 1997-02-22 17:11:31 morioka Exp $")
 (defconst eword-encode-version (get-version-string eword-encode-RCS-ID))
 
 
 ;;; @ variables
 ;;;
 
-(defvar mime/field-encoding-method-alist
-  (if (boundp 'mime/no-encoding-header-fields)
-      (nconc
-       (mapcar (function
-               (lambda (field-name)
-                 (cons field-name 'default-mime-charset)
-                 ))
-              mime/no-encoding-header-fields)
-       '((t . mime))
-       )
-    '(("X-Nsubject" . iso-2022-jp-2)
-      ("Newsgroups" . nil)
-      (t            . mime)
-      ))
+(defvar eword-field-encoding-method-alist
+  '(("X-Nsubject" . iso-2022-jp-2)
+    ("Newsgroups" . nil)
+    (t            . mime)
+    )
   "*Alist to specify field encoding method.
 Its key is field-name, value is encoding method.
 
@@ -70,9 +61,7 @@ network-code.
 
 If method is nil, this field will not be encoded.")
 
-(defvar mime/generate-X-Nsubject
-  (and (boundp 'mime/use-X-Nsubject)
-       mime/use-X-Nsubject)
+(defvar eword-generate-X-Nsubject nil
   "*If it is not nil, X-Nsubject field is generated
 when Subject field is encoded by `eword-encode-message-header'.")
 
@@ -537,9 +526,9 @@ when Subject field is encoded by `eword-encode-message-header'.")
        (car (tm-eword::encode-string 0 str))
        )))
 
-(defun mime/exist-encoded-word-in-subject ()
+(defun eword-in-subject-p ()
   (let ((str (std11-field-body "Subject")))
-    (if (and str (string-match mime/encoded-word-regexp str))
+    (if (and str (string-match eword-encoded-word-regexp str))
        str)))
 
 (defun eword-encode-message-header (&optional code-conversion)
@@ -556,14 +545,14 @@ when Subject field is encoded by `eword-encode-message-header'.")
          (setq end (std11-field-end))
          (and (find-non-ascii-charset-region beg end)
               (let ((ret (or (ASSOC (downcase field-name)
-                                    mime/field-encoding-method-alist
+                                    eword-field-encoding-method-alist
                                     :test (function
                                            (lambda (str1 str2)
                                              (and (stringp str2)
                                                   (string= str1
                                                            (downcase str2))
                                                   ))))
-                             (assq t mime/field-encoding-method-alist)
+                             (assq t eword-field-encoding-method-alist)
                              )))
                 (if ret
                     (let ((method (cdr ret)))
@@ -584,9 +573,9 @@ when Subject field is encoded by `eword-encode-message-header'.")
                       ))
                 ))
          ))
-      (and mime/generate-X-Nsubject
+      (and eword-generate-X-Nsubject
           (or (std11-field-body "X-Nsubject")
-              (let ((str (mime/exist-encoded-word-in-subject)))
+              (let ((str (eword-in-subject-p)))
                 (if str
                     (progn
                       (setq str
@@ -598,7 +587,7 @@ when Subject field is encoded by `eword-encode-message-header'.")
                                  str
                                  (or (cdr (ASSOC
                                            "x-nsubject"
-                                           mime/field-encoding-method-alist
+                                           eword-field-encoding-method-alist
                                            :test
                                            (function
                                             (lambda (str1 str2)