Rewrite sasl-scram.el
[elisp/flim.git] / eword-decode.el
index 528a927..0fc7d33 100644 (file)
@@ -1,10 +1,10 @@
 ;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs
 
-;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
 
 ;; Author: ENAMI Tsugutomo <enami@sys.ptg.sony.co.jp>
-;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;         TANAKA Akira <akr@jaist.ac.jp>
+;;         MORIOKA Tomohiko <tomo@m17n.org>
+;;         TANAKA Akira <akr@m17n.org>
 ;; Created: 1995/10/03
 ;; Original: 1992/07/20 ENAMI Tsugutomo's `mime.el'.
 ;;     Renamed: 1993/06/03 to tiny-mime.el by MORIOKA Tomohiko
 
 ;;; Code:
 
-(require 'std11)
-(require 'mel)
 (require 'mime-def)
+(require 'mel)
+(require 'std11)
+
+(eval-when-compile (require 'cl))      ; list*, pop
 
-(eval-when-compile (require 'cl))
 
-(defgroup eword-decode nil
-  "Encoded-word decoding"
-  :group 'mime)
+;;; @ Variables
+;;;
 
-(defcustom eword-max-size-to-decode 1000
-  "*Max size to decode header field."
-  :group 'eword-decode
-  :type '(choice (integer :tag "Limit (bytes)")
-                (const :tag "Don't limit" nil)))
+;; User options are defined in mime-def.el.
 
 
 ;;; @ MIME encoded-word definition
@@ -152,8 +148,8 @@ decode the charset included in it, it is not decoded."
                                                    start-column
                                                    &optional max-column
                                                    start)
-  (if (and eword-max-size-to-decode
-          (> (length string) eword-max-size-to-decode))
+  (if (and mime-field-decoding-max-size
+          (> (length string) mime-field-decoding-max-size))
       string
     (or max-column
        (setq max-column fill-column))
@@ -270,7 +266,7 @@ such as a version of Net$cape)."
 
 ;;;###autoload
 (defun mime-set-field-decoder (field &rest specs)
-  "Set decoder of FILED.
+  "Set decoder of FIELD.
 SPECS must be like `MODE1 DECODER1 MODE2 DECODER2 ...'.
 Each mode must be `nil', `plain', `wide', `summary' or `nov'.
 If mode is `nil', corresponding decoder is set up for every modes."
@@ -505,8 +501,8 @@ If SEPARATOR is not nil, it is used as header separator."
        ))
    code-conversion))
 
-(define-obsolete-function-alias 'eword-decode-header
-  'mime-decode-header-in-buffer)
+(defalias 'eword-decode-header 'mime-decode-header-in-buffer)
+(make-obsolete 'eword-decode-header 'mime-decode-header-in-buffer)
 
 
 ;;; @ encoded-word decoder
@@ -594,7 +590,7 @@ as a version of Net$cape)."
   "*Max position of eword-lexical-analyze-cache.
 It is max size of eword-lexical-analyze-cache - 1.")
 
-(defcustom eword-lexical-analyzer
+(defvar mime-header-lexical-analyzer
   '(eword-analyze-quoted-string
     eword-analyze-domain-literal
     eword-analyze-comment
@@ -614,9 +610,7 @@ format.
 
 Previous function is preferred to next function.  If a function
 returns nil, next function is used.  Otherwise the return value will
-be the result."
-  :group 'eword-decode
-  :type '(repeat function))
+be the result.")
 
 (defun eword-analyze-quoted-string (string start &optional must-unfold)
   (let ((p (std11-check-enclosure string ?\" ?\" nil start)))
@@ -747,7 +741,7 @@ be the result."
        dest ret)
     (while (< start len)
       (setq ret
-           (let ((rest eword-lexical-analyzer)
+           (let ((rest mime-header-lexical-analyzer)
                  func r)
              (while (and (setq func (car rest))
                          (null