mel-u.el (mime-write-decoded-region): Use temporary filename.
[elisp/flim.git] / eword-encode.el
index b749715..c930c86 100644 (file)
@@ -46,6 +46,8 @@
     (iso-8859-7                . "Q")
     (iso-8859-8                . "Q")
     (iso-8859-9                . "Q")
+    (iso-8859-14       . "Q")
+    (iso-8859-15       . "Q")
     (iso-2022-jp       . "B")
     (iso-2022-jp-3     . "B")
     (iso-2022-kr       . "B")
@@ -71,7 +73,7 @@ CHARSET is a symbol to indicate MIME charset of the encoded-word.
 ENCODING allows \"B\" or \"Q\".
 MODE is allows `text', `comment', `phrase' or nil.  Default value is
 `phrase'."
-  (let ((text (encoded-text-encode-string string encoding)))
+  (let ((text (encoded-text-encode-string string encoding mode)))
     (if text
        (concat "=?" (upcase (symbol-name charset)) "?"
                encoding "?" text "?=")
@@ -516,14 +518,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)
@@ -649,26 +651,26 @@ encoded-word.  ASCII token is not encoded."
 ;;;###autoload
 (defun mime-encode-header-in-buffer (&optional code-conversion)
   "Encode header fields to network representation, such as MIME encoded-word.
-
-It refer variable `mime-field-encoding-method-alist'."
+It refers the variable `mime-field-encoding-method-alist'."
   (interactive "*")
   (save-excursion
     (save-restriction
       (std11-narrow-to-header mail-header-separator)
       (goto-char (point-min))
       (let ((default-cs (mime-charset-to-coding-system default-mime-charset))
+           (regexp (concat "\\(" std11-field-head-regexp "\\)" " ?"))
            bbeg end field-name)
-       (while (re-search-forward std11-field-head-regexp nil t)
+       (while (re-search-forward regexp nil t)
          (setq bbeg (match-end 0)
-               field-name (buffer-substring (match-beginning 0) (1- bbeg))
+               field-name (buffer-substring (match-beginning 0)
+                                            (1- (match-end 1)))
                end (std11-field-end))
          (and (delq 'ascii (find-charset-region bbeg end))
               (let ((method (eword-find-field-encoding-method
                              (downcase field-name))))
                 (cond ((eq method 'mime)
                        (let ((field-body
-                              (buffer-substring-no-properties bbeg end)
-                              ))
+                              (buffer-substring-no-properties bbeg end)))
                          (delete-region bbeg end)
                          (insert (mime-encode-field-body field-body
                                                          field-name))))
@@ -677,11 +679,8 @@ It refer variable `mime-field-encoding-method-alist'."
                               (or (mime-charset-to-coding-system
                                    method)
                                   default-cs)))
-                         (encode-coding-region bbeg end cs)
-                         )))
-                ))
-         ))
-      )))
+                         (encode-coding-region bbeg end cs)))))))))))
+
 (defalias 'eword-encode-header 'mime-encode-header-in-buffer)
 (make-obsolete 'eword-encode-header 'mime-encode-header-in-buffer)