This commit was generated by cvs2svn to compensate for changes in r293,
[elisp/tm.git] / tm-ew-d.el
index d14dead..8d6150f 100644 (file)
@@ -8,16 +8,43 @@
 ;;;
 ;;; Author: ENAMI Tsugutomo <enami@sys.ptg.sony.co.jp>
 ;;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;; Version:
-;;;    $Id: tm-ew-d.el,v 7.1 1995/10/03 04:34:26 morioka Exp $
+;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Created: 1993/6/3 (1995/10/3 obsolete tiny-mime.el)
+;;; Version: $Revision: 7.6 $
 ;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word
 ;;;
+;;; This file is part of tm (Tools for MIME).
+;;;
+;;; This program is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation; either version 2, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with This program.  If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
 
 (require 'emu)
+(require 'tl-822)
 (require 'mel)
 (require 'tm-def)
 
 
+;;; @ version
+;;;
+
+(defconst tm-ew-d/RCS-ID
+  "$Id: tm-ew-d.el,v 7.6 1995/12/06 08:15:51 morioka Exp $")
+(defconst mime/eword-decoder-version (get-version-string tm-ew-d/RCS-ID))
+
+
 ;;; @ MIME encoded-word definition
 ;;;
 
@@ -38,7 +65,8 @@
 ;;; @ for string
 ;;;
 
-(defun mime/decode-encoded-words-string (str)
+(defun mime-eword/decode-string (str)
+  (setq str (rfc822/unfolding-string str))
   (let ((dest "")(ew nil)
        beg end)
     (while (setq beg (string-match mime/encoded-word-regexp str))
@@ -62,7 +90,7 @@
 ;;; @ for region
 ;;;
 
-(defun mime/decode-encoded-words-region (beg end &optional unfolding)
+(defun mime-eword/decode-region (beg end &optional unfolding)
   (interactive "*r")
   (save-excursion
     (save-restriction
     (save-restriction
       (narrow-to-region (goto-char (point-min))
                        (progn (re-search-forward "^$" nil t) (point)))
-      (mime/decode-encoded-words-region (point-min) (point-max) t)
+      (mime-eword/decode-region (point-min) (point-max) t)
       )))
 
 (defun mime/unfolding ()
   (goto-char (point-min))
   (let (field beg end)
-    (while (re-search-forward message/field-name-regexp nil t)
+    (while (re-search-forward rfc822/field-top-regexp nil t)
       (setq beg (match-beginning 0))
-      (setq end (message/field-end))
+      (setq end (rfc822/field-end))
       (setq field (buffer-substring beg end))
       (if (string-match mime/encoded-word-regexp field)
          (save-restriction