update.
[elisp/flim.git] / eword-encode.el
index 6cee2d6..1efb97d 100644 (file)
@@ -1,6 +1,7 @@
 ;;; eword-encode.el --- RFC 2047 based encoded-word encoder for GNU Emacs
 
-;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2004 Free
+;;   Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;; Keywords: encoded-word, MIME, multilingual, header, mail, news
@@ -19,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
@@ -680,8 +681,7 @@ 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 `mime-field-encoding-method-alist' variable."
   (interactive "*")
   (save-excursion
     (save-restriction
@@ -689,11 +689,10 @@ It refer variable `mime-field-encoding-method-alist'."
       (goto-char (point-min))
       (let ((default-cs (mime-charset-to-coding-system default-mime-charset))
            bbeg end field-name)
-       (while (re-search-forward
-               (concat "\\(" std11-field-head-regexp "\\)" " ?")
-               nil t)
+       (while (re-search-forward std11-field-head-regexp nil t)
          (setq bbeg (match-end 0)
-               field-name (buffer-substring (match-beginning 0) (1- (match-end 1)))
+               field-name (buffer-substring-no-properties (match-beginning 0)
+                                                          (1- bbeg))
                end (std11-field-end))
          (and (delq 'ascii (find-charset-region bbeg end))
               (let ((method (eword-find-field-encoding-method
@@ -714,11 +713,7 @@ 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)