+1998-10-09 Tanaka Akira <akr@jaist.ac.jp>
+
+ * Sync up to flim-1_10_2 from flim-1_10_0.
+
+ * mime-def.el (mime-library-product): Bump up to FLAM-DOODLE
+ 1.10.1.
+
1998-09-30 Tanaka Akira <akr@jaist.ac.jp>
* Sync up with flim-1_10_0.
* eword-decode.el: Copied from AKEMI branch of SEMI.
\f
+1998-10-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * FLIM: Version 1.10.2 (Kintetsu-Miyazu) was released.
+
+ * mime-def.el, mel.el, mel-b-dl.el: Move variable
+ `base64-dl-module' from mel-b-dl.el and mel.el to mime-def.el.
+
+1998-10-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mel.el (mel-ccl-module): New variable; use it to check mel-ccl
+ is available.
+
+ * FLIM-ELS: Don't install mel-ccl for anything older than MULE
+ 2.3.
+
+1998-10-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mel-u.el: Use `mel-define-backend' to define "x-uue".
+ Define "x-uuencode" as a clone of "x-uue".
+
+ * Move variable `mel-encoding-module-alist' from mel.el to
+ mime-def.el.
+
+ * mel.el (mel-find-function): Use function
+ `mel-find-function-from-obarray'.
+ Use `mel-define-backend' to define "7bit", "8bit" and "binary";
+ don't define methods of "8bit" and "binary"; inherit methods from
+ "7bit".
+
+ * mime-def.el (mel-service-list): New variable.
+ (mel-define-service): New implementation.
+ (mel-find-function-from-obarray): New inline function.
+ (mel-copy-method): New inline function.
+ (mel-copy-backend): New inline function.
+ (mel-define-backend): New macro.
+
+1998-10-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mel-u.el: Define method functions of mel.
+ (mime-encode-region): Use `mel-define-method-function'; abolish
+ `uuencode-encode-region'.
+ (mime-decode-region): Use `mel-define-method-function'; abolish
+ `uuencode-decode-region'.
+ (mime-encode-string): New method.
+ (mime-decode-string): New method.
+ (mime-insert-encoded-file): Use `mel-define-method'; abolish
+ `uuencode-insert-encoded-file'.
+ (mime-write-decoded-region): Use `mel-define-method'; abolish
+ `uuencode-write-decoded-region'.
+
+1998-10-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-def.el (mel-define-service): Add DOC.
+ (mel-define-method): Add DOC.
+ (mel-define-method-function): Add DOC.
+
+ * mime-en.sgml, mime-ja.sgml: Modify for FLIM 1.10.
+
+\f
+1998-10-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * FLIM: Version 1.10.1 (Miyamaki) was released.
+
+1998-10-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mel-g.el: Define method functions of mel.
+ (mime-encode-region): Use `mel-define-method-function'; abolish
+ `gzip64-encode-region'.
+ (mime-decode-region): Use `mel-define-method-function'; abolish
+ `gzip64-decode-region'.
+ (mime-encode-string): New method.
+ (mime-decode-string): New method.
+ (mime-insert-encoded-file): Use `mel-define-method'; abolish
+ `gzip64-insert-encoded-file'.
+ (mime-write-decoded-region): Use `mel-define-method'; abolish
+ `gzip64-write-decoded-region'.
+
+ * mime-def.el (mime-library-product): New variable; abolish
+ `mime-library-version'.
+ (mime-product-name): New macro.
+ (mime-product-version): New macro.
+ (mime-product-code-name): New macro.
+ (mime-library-version): Renamed from
+ `mime-library-version-string'; use `mime-library-product',
+ `mime-product-name', `mime-product-version' and
+ `mime-product-code-name'.
+
+ * mime-def.el (mm-define-backend): Add DOC.
+ (mm-define-method): Add DOC.
+
+ * mel.el (mime-encoding-list): Modify DOC to add description about
+ optional argument SERVICE.
+
+1998-10-04 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mime-ja.sgml, mime-en.sgml (mm-backend module): Write
+ description of `mm-define-backend' and `mm-define-method'.
+
+\f
1998-09-29 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* FLIM: Version 1.10.0 (K\e-Dòdo)\e-A was released.
14 \e$B3A\e(B \e$B$+$-\e(B 10R6.5/10.0 FLAM-DOODLE 1.9.4
15 \e$B?<;Y;R\e(B \e$B$3$-$/$A$J$7\e(B 10YR7.5/8.0 FLAM-DOODLE 1.9.5
16 \e$B4;;R\e(B \e$B$3$&$8\e(B 7.5YR7.0/11.0 FLAM-DOODLE 1.10.0
- 17 \e$B5`MU\e(B \e$B$/$A$P\e(B 10YR7.5/10.0
+ 17 \e$B5`MU\e(B \e$B$/$A$P\e(B 10YR7.5/10.0 FLAM-DOODLE 1.10.1
18 \e$B@VGrFK\e(B \e$B$"$+$7$m$D$k$P$_\e(B 5.0YR8.0/6.0
19 \e$B>.F&\e(B \e$B$"$:$-\e(B 2.5R3.5/5.0
20 \e$BIrF:Cc\e(B \e$B$($S$A$c\e(B 5.0R4.0/11.0
(setq flim-modules (cons 'mel-b-dl flim-modules))
)
-(if (featurep 'mule)
+(if (and (featurep 'mule)
+ (not (and (boundp 'MULE) MULE)))
(setq flim-modules (cons 'mel-ccl flim-modules))
)
1.9.1 Tonosh\e-Dò\e-A \e$(BIYLnAq\e(B
1.9.2 Shin-Tanabe \e$(B?7EDJU\e(B
1.10.0 K\e-Dòdo\e-A \e$(B6=8M\e(B
------ Miyamaki \e$(B;0;3LZ\e(B
------ Kintetsu-Miyazu \e$(B6aE45\DE\e(B
+1.10.1 Miyamaki \e$(B;0;3LZ\e(B
+1.10.2 Kintetsu-Miyazu \e$(B6aE45\DE\e(B
----- Komada \e$(B9}ED\e(B
------ Shin-H\e-Dòsono\e-A \e$(B?7=K1`\e(B
+----- Shin-H\e-Dòsono\e-A \e$(B?7=K1`\e(B ; <=> JR \e$(BJRD.@~\e(B \e$(B=K1`\e(B
----- Kizugawadai \e$(BLZDE@nBf\e(B
----- Yamadagawa \e$(B;3ED@n\e(B
----- Takanohara \e$(B9b$N86\e(B
#
PACKAGE = flim
-VERSION = 1.10.0
+VERSION = 1.10.2
TAR = tar
RM = /bin/rm -f
(require 'mime-def)
(eval-and-compile
- (defvar base64-dl-module
- (expand-file-name "base64.so" exec-directory))
-
(defvar base64-dl-handle
(and (file-exists-p base64-dl-module)
(dynamic-link base64-dl-module)))
)
))
-(defalias 'gzip64-encode-region 'gzip64-external-encode-region)
-(defalias 'gzip64-decode-region 'gzip64-external-decode-region)
+(mel-define-method-function (mime-encode-region start end (nil "x-gzip64"))
+ 'gzip64-external-encode-region)
+(mel-define-method-function (mime-decode-region start end (nil "x-gzip64"))
+ 'gzip64-external-decode-region)
+
+
+;;; @ encoder/decoder for string
+;;;
+
+(mel-define-method mime-encode-string (string (nil "x-gzip64"))
+ (with-temp-buffer
+ (insert string)
+ (gzip64-external-encode-region (point-min)(point-max))
+ (buffer-string)))
+
+(mel-define-method mime-decode-string (string (nil "x-gzip64"))
+ (with-temp-buffer
+ (insert string)
+ (gzip64-external-decode-region (point-min)(point-max))
+ (buffer-string)))
;;; @ encoder/decoder for file
;;;
-(defun gzip64-insert-encoded-file (filename)
+(mel-define-method mime-insert-encoded-file (filename (nil "x-gzip64"))
(interactive (list (read-file-name "Insert encoded file: ")))
(apply (function call-process) (car gzip64-external-encoder)
filename t nil
(cdr gzip64-external-encoder))
)
-(defun gzip64-write-decoded-region (start end filename)
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "x-gzip64"))
"Decode and write current region encoded by gzip64 into FILENAME.
START and END are buffer positions."
(interactive
;; Created: 1995/10/25
;; Keywords: uuencode
-;; This file is part of MEL (MIME Encoding Library).
+;; This file is part of FLIM (Faithful Library about Internet Message).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
(require 'mime-def)
+(mel-define-backend "x-uue")
+
+
;;; @ variables
;;;
))
)))
-(defalias 'uuencode-encode-region 'uuencode-external-encode-region)
-(defalias 'uuencode-decode-region 'uuencode-external-decode-region)
+(mel-define-method-function (mime-encode-region start end (nil "x-uue"))
+ 'uuencode-external-encode-region)
+(mel-define-method-function (mime-decode-region start end (nil "x-uue"))
+ 'uuencode-external-decode-region)
+
+
+;;; @ encoder/decoder for string
+;;;
+
+(mel-define-method mime-encode-string (string (nil "x-uue"))
+ (with-temp-buffer
+ (insert string)
+ (uuencode-external-encode-region (point-min)(point-max))
+ (buffer-string)))
+
+(mel-define-method mime-decode-string (string (nil "x-uue"))
+ (with-temp-buffer
+ (insert string)
+ (uuencode-external-decode-region (point-min)(point-max))
+ (buffer-string)))
;;; @ uuencode encoder/decoder for file
;;;
-(defun uuencode-insert-encoded-file (filename)
+(mel-define-method mime-insert-encoded-file (filename (nil "x-uue"))
"Insert file encoded by unofficial uuencode format.
This function uses external uuencode encoder which is specified by
variable `uuencode-external-encoder'."
(file-name-nondirectory filename))
)
-(defun uuencode-write-decoded-region (start end filename)
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "x-gzip64"))
"Decode and write current region encoded by uuencode into FILENAME.
START and END are buffer positions."
(interactive
(provide 'mel-u)
+(mel-define-backend "x-uuencode" ("x-uue"))
+
;;; mel-u.el ends here
:group 'mime
:type '(repeat string))
-(defvar mel-encoding-module-alist nil)
-
(defun mime-encoding-list (&optional service)
- "Return list of Content-Transfer-Encoding."
+ "Return list of Content-Transfer-Encoding.
+If SERVICE is specified, it returns available list of
+Content-Transfer-Encoding for it."
(if service
(let (dest)
(mapatoms (lambda (sym)
)))
(defsubst mel-find-function (service encoding)
- (let* ((oba (symbol-value (intern (format "%s-obarray" service))))
- (f (intern-soft encoding oba)))
- (or f
- (let ((rest (cdr (assoc encoding mel-encoding-module-alist))))
- (while (and rest
- (progn
- (require (car rest))
- (null (setq f (intern-soft encoding oba)))
- ))
- (setq rest (cdr rest))
- )
- f))))
+ (mel-find-function-from-obarray
+ (symbol-value (intern (format "%s-obarray" service))) encoding))
;;; @ setting for modules
;;;
-(defvar base64-dl-module
- (and (fboundp 'dynamic-link)
- (let ((path (expand-file-name "base64.so" exec-directory)))
- (and (file-exists-p path)
- path))))
-
+(defvar mel-ccl-module
+ (and (featurep 'mule)
+ (module-installed-p 'mel-ccl)))
(mel-use-module 'mel-b '("base64" "B"))
(mel-use-module 'mel-q '("quoted-printable" "Q"))
(mel-use-module 'mel-g '("x-gzip64"))
(mel-use-module 'mel-u '("x-uue" "x-uuencode"))
-(if (featurep 'mule)
+(if mel-ccl-module
(mel-use-module 'mel-ccl '("base64" "quoted-printable" "B" "Q"))
)
(mel-use-module 'mel-b-dl '("base64" "B"))
)
+(mel-define-backend "7bit")
(mel-define-method-function (mime-encode-string string (nil "7bit"))
'identity)
(mel-define-method-function (mime-decode-string string (nil "7bit"))
start end filename (nil "7bit"))
'write-region-as-binary)
-(mel-define-method-function (mime-encode-string string (nil "8bit"))
- 'identity)
-(mel-define-method-function (mime-decode-string string (nil "8bit"))
- 'identity)
-(mel-define-method mime-encode-region (start end (nil "8bit")))
-(mel-define-method mime-decode-region (start end (nil "8bit")))
-(mel-define-method-function (mime-insert-encoded-file filename (nil "8bit"))
- 'insert-file-contents-as-binary)
-(mel-define-method-function (mime-write-decoded-region
- start end filename (nil "8bit"))
- 'write-region-as-binary)
+(mel-define-backend "8bit" ("7bit"))
-(mel-define-method-function (mime-encode-string string (nil "binary"))
- 'identity)
-(mel-define-method-function (mime-decode-string string (nil "binary"))
- 'identity)
-(mel-define-method mime-encode-region (start end (nil "binary")))
-(mel-define-method mime-decode-region (start end (nil "binary")))
-(mel-define-method-function (mime-insert-encoded-file filename (nil "binary"))
- 'insert-file-contents-as-binary)
-(mel-define-method-function (mime-write-decoded-region
- start end filename (nil "binary"))
- 'write-region-as-binary)
+(mel-define-backend "binary" ("8bit"))
;;; @ region
;;; Code:
-(defconst mime-library-version
- '("FLAM-DOODLE" "\e$B4;;R\e(B 7.5YR7.0/11.0" 1 10 0)
- "Implementation name, version name and numbers of MIME-library package.")
+(defconst mime-library-product ["FLAM-DOODLE" (1 10 1) "µàÍÕ 10YR7.5/10.0"]
+ "Product name, version number and code name of MIME-library package.")
+
+(defmacro mime-product-name (product)
+ `(aref ,product 0))
+
+(defmacro mime-product-version (product)
+ `(aref ,product 1))
-(defconst mime-library-version-string
- `,(concat (car mime-library-version) " "
+(defmacro mime-product-code-name (product)
+ `(aref ,product 2))
+
+(defconst mime-library-version
+ (eval-when-compile
+ (concat (mime-product-name mime-library-product) " "
(mapconcat #'number-to-string
- (cddr mime-library-version) ".")
- " - \"" (cadr mime-library-version) "\""))
+ (mime-product-version mime-library-product) ".")
+ " - \"" (mime-product-code-name mime-library-product) "\"")))
;;; @ variables
(defvar mime-entity-implementation-alist nil)
(defmacro mm-define-backend (type &optional parents)
+ "Define TYPE as a mm-backend.
+If PARENTS is specified, TYPE inherits PARENTS.
+Each parent must be backend name (symbol)."
(if parents
`(let ((rest ',(reverse parents)))
(while rest
))))
(defmacro mm-define-method (name args &rest body)
+ "Define NAME as a method function of (nth 1 (car ARGS)) backend.
+
+ARGS is like an argument list of lambda, but (car ARGS) must be
+specialized parameter. (car (car ARGS)) is name of variable and (nth
+1 (car ARGS)) is name of backend."
(let* ((specializer (car args))
(class (nth 1 specializer))
(self (car specializer)))
;;; @ for mel-backend
;;;
+(defvar mel-service-list nil)
+
(defmacro mel-define-service (name &optional args &rest rest)
- (if args
- `(progn
- (defvar ,(intern (format "%s-obarray" name)) (make-vector 1 nil))
- (defun ,name ,args
- ,@rest
- (funcall (mel-find-function ',name ,(car (last args)))
- ,@(mm-arglist-to-arguments (butlast args)))
- ))
- `(defvar ,(intern (format "%s-obarray" name)) (make-vector 1 nil))
- ))
+ "Define NAME as a service for Content-Transfer-Encodings.
+If ARGS is specified, NAME is defined as a generic function for the
+service."
+ `(progn
+ (add-to-list 'mel-service-list ',name)
+ (defvar ,(intern (format "%s-obarray" name)) (make-vector 1 nil))
+ ,@(if args
+ `((defun ,name ,args
+ ,@rest
+ (funcall (mel-find-function ',name ,(car (last args)))
+ ,@(mm-arglist-to-arguments (butlast args)))
+ )))
+ ))
(put 'mel-define-service 'lisp-indent-function 'defun)
+
+(defvar mel-encoding-module-alist nil)
+
+(defsubst mel-find-function-from-obarray (ob-array encoding)
+ (let* ((f (intern-soft encoding ob-array)))
+ (or f
+ (let ((rest (cdr (assoc encoding mel-encoding-module-alist))))
+ (while (and rest
+ (progn
+ (require (car rest))
+ (null (setq f (intern-soft encoding ob-array)))
+ ))
+ (setq rest (cdr rest))
+ )
+ f))))
+
+(defsubst mel-copy-method (service src-backend dst-backend)
+ (let* ((oa (symbol-value (intern (format "%s-obarray" service))))
+ (f (mel-find-function-from-obarray oa src-backend))
+ sym)
+ (when f
+ (setq sym (intern dst-backend oa))
+ (or (fboundp sym)
+ (fset sym (symbol-function f))
+ ))))
+
+(defsubst mel-copy-backend (src-backend dst-backend)
+ (let ((services mel-service-list))
+ (while services
+ (mel-copy-method (car services) src-backend dst-backend)
+ (setq services (cdr services)))))
+
+(defmacro mel-define-backend (type &optional parents)
+ "Define TYPE as a mel-backend.
+If PARENTS is specified, TYPE inherits PARENTS.
+Each parent must be backend name (string)."
+ (cons 'progn
+ (mapcar (lambda (parent)
+ `(mel-copy-backend ,parent ,type)
+ )
+ parents)))
+
(defmacro mel-define-method (name args &rest body)
+ "Define NAME as a method function of (nth 1 (car (last ARGS))) backend.
+ARGS is like an argument list of lambda, but (car (last ARGS)) must be
+specialized parameter. (car (car (last ARGS))) is name of variable
+and (nth 1 (car (last ARGS))) is name of backend (encoding)."
(let* ((specializer (car (last args)))
(class (nth 1 specializer)))
`(progn
(put 'mel-define-method 'lisp-indent-function 'defun)
(defmacro mel-define-method-function (spec function)
+ "Set SPEC's function definition to FUNCTION.
+First element of SPEC is service.
+Rest of ARGS is like an argument list of lambda, but (car (last ARGS))
+must be specialized parameter. (car (car (last ARGS))) is name of
+variable and (nth 1 (car (last ARGS))) is name of backend (encoding)."
(let* ((name (car spec))
(args (cdr spec))
(specializer (car (last args)))
(intern ,class ,(intern (format "%s-obarray" name))))
)))
+(defvar base64-dl-module
+ (and (fboundp 'dynamic-link)
+ (let ((path (expand-file-name "base64.so" exec-directory)))
+ (and (file-exists-p path)
+ path))))
+
;;; @ end
;;;
<!doctype sinfo system>
<head>
-<title>FLIM 1.9 Manual about MIME Features
+<title>FLIM 1.10 Manual about MIME Features
<author>MORIOKA Tomohiko <mail>morioka@jaist.ac.jp</mail>
<date>1998/07/01
</defun>
-<h3> How to make mm-backend
+<h3> Definition of mm-backend
<node> mm-backend module
<p>
-(It is not written yet, sorry. (^_^;)
+<defmacro name="mm-define-backend">
+<args> type
+<opts> parents
<p>
-(Please read mm*.el)
+Define <var>type</var> as a mm-backend.
+<p>
+If <var>PARENTS</var> is specified, <var>type</var> inherits parents.
+Each parent must be representation-type.
+<p>
+Example:
+<p>
+<lisp>
+(mm-define-backend chao (generic))
+</lisp>
+</defmacro>
+
+<defmacro name="mm-define-method">
+<args> name args <rest> body
+<p>
+Define <var>name</var> as a method function of (nth 1 (car
+<var>args</var>)) backend.
+<p>
+<var>args</var> is like an argument list of lambda, but (car
+<var>args</var>) must be specialized parameter. (car (car
+<var>args</var>)) is name of variable and (nth 1 (car
+<var>args</var>)) is name of backend (representation-type).
+<p>
+Example:
+<p>
+<lisp>
+(mm-define-method entity-cooked-p ((entity chao)) nil)
+</lisp>
+</defmacro>
<h1> Information of Content-Type field
</defun>
-<h2> Region encoding/decoding
-<node> Region encoder/decoder
+<h2> Encoder/decoder
+<node> encoder/decoder
<p>
<defun name="mime-encode-region">
<args> start end encoding
using <var>encoding</var>.
</defun>
-<defvar name="mime-encoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to encode region.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code> or
-<code>(STRING . nil)</code>. <var>string</var> is
-content-transfer-encoding. <code>function</code> is region encoder
-and <code>nil</code> means not to encode.
-</defvar>
-<defvar name="mime-decoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to decode region.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code> or
-<code>(STRING . nil)</code>. <var>string</var> is
-content-transfer-encoding. <code>function</code> is region decoder
-and <code>nil</code> means not to decode.
-</defvar>
-
-
-<h2> String encoding/decoding
-<node> String encoder/decoder
-<p>
<defun name="mime-decode-string">
<args> string encoding
<p>
<var>string</var> \e$B$r\e(B <var>encoding</var> \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
</defun>
-<defvar name="mime-string-decoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to decode string.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code>.
-STRING is content-transfer-encoding.
-FUNCTION is string decoder.
-</defvar>
-
-<h2> File encoding/decoding
-<node> File encoder/decoder
-<p>
<defun name="mime-insert-encoded-file">
<args> filename encoding
<p>
<var>start</var> and <var>end</var> are buffer positions.
</defun>
-<defvar name="mime-file-encoding-method-alist">
+
+<h2> Other utilities
+<node> Encoding information
<p>
-Alist of encoding vs. corresponding method to insert encoded file.
+<defun name="mime-encoding-list">
+ <opts> SERVICE
<p>
-Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
-content-transfer-encoding. FUNCTION is function to insert encoded
-file.
-</defvar>
+Return list of Content-Transfer-Encoding.
+<p>
+If <var>service</var> is specified, it returns available list of
+Content-Transfer-Encoding for it.
+</defun>
-<defvar name="mime-file-decoding-method-alist">
+<defun name="mime-encoding-alist">
+ <opts> SERVICE
<p>
-Alist of encoding vs. corresponding method to write decoded region to
-file.
+Return table of Content-Transfer-Encoding for completion.
<p>
-Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded
-region to file.
-</defvar>
+If <var>service</var> is specified, it returns available list of
+Content-Transfer-Encoding for it.
+</defun>
+
+
+<h2> How to write encoder/decoder module
+<node> mel-backend
+<p>
+<defmacro name="mel-define-method">
+<args> name args <rest> body
+<p>
+Define <var>name</var> as a method function of (nth 1 (car (last
+<var>args</var>))) backend.
+<p>
+<var>args</var> is like an argument list of lambda, but (car (last
+<var>args</var>)) must be specialized parameter. (car (car (last
+<var>args</var>))) is name of variable and (nth 1 (car (last
+<var>args</var>))) is name of backend (encoding).
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "base64"))
+ "Decode and write current region encoded by base64 into FILENAME.
+START and END are buffer positions."
+ (interactive
+ (list (region-beginning) (region-end)
+ (read-file-name "Write decoded region to file: ")))
+ (let ((str (buffer-substring start end)))
+ (with-temp-buffer
+ (insert (decode-base64-string str))
+ (write-region-as-binary (point-min) (point-max) filename)
+ )))
+</lisp>
+</defmacro>
+
+<defmacro name="mel-define-method-function">
+<args> spec function
+<p>
+Set <var>spec</var>'s function definition to <var>function</var>.
+<p>
+First element of <var>spec</var> is service.
+<p>
+Rest of <var>args</var> is like an argument list of lambda, but (car
+(last <var>args</var>)) must be specialized parameter. (car (car
+(last <var>args</var>))) is name of variable and (nth 1 (car (last
+<var>args</var>))) is name of backend (encoding).
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-method-function (mime-encode-string string (nil "base64"))
+ 'encode-base64-string)
+</lisp>
+</defmacro>
+
+
+<h2> How to add encoding/decoding service
+<node> generic function for mel-backend
+<p>
+<defmacro name="mel-define-service">
+<args> name
+<opts> args doc-string
+<p>
+Define <var>name</var> as a service for Content-Transfer-Encodings.
+<p>
+If <var>args</var> is specified, <var>name</var> is defined as a
+generic function for the service.
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-service encoded-text-encode-string (string encoding)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.")
+</lisp>
+</defmacro>
<h1> Network representation of header
\input texinfo.tex
@setfilename mime-en.info
-@settitle{FLIM 1.9 Manual about MIME Features}
+@settitle{FLIM 1.10 Manual about MIME Features}
@titlepage
-@title FLIM 1.9 Manual about MIME Features
+@title FLIM 1.10 Manual about MIME Features
@author MORIOKA Tomohiko <morioka@@jaist.ac.jp>
@subtitle 1998/07/01
@end titlepage
@node Top, Introduction, (dir), (dir)
-@top FLIM 1.9 Manual about MIME Features
+@top FLIM 1.10 Manual about MIME Features
@ifinfo
@menu
* Request for entity:: Message-passing for entity
-* mm-backend module:: How to make mm-backend
+* mm-backend module:: Definition of mm-backend
@end menu
@node Request for entity, mm-backend module, mm-backend, mm-backend
@node mm-backend module, , Request for entity, mm-backend
-@subsection How to make mm-backend
+@subsection Definition of mm-backend
-(It is not written yet, sorry. (^_^;)@refill
+@defmac mm-define-backend type &optional parents
+
+Define @var{type} as a mm-backend.@refill
+
+If @var{PARENTS} is specified, @var{type} inherits parents. Each parent
+must be representation-type.@refill
+
+Example:@refill
+
+@lisp
+(mm-define-backend chao (generic))
+@end lisp
+@end defmac
+
+
+@defmac mm-define-method name args &rest body
+
+Define @var{name} as a method function of (nth 1 (car @var{args}))
+backend.@refill
+
+@var{args} is like an argument list of lambda, but (car @var{args}) must
+be specialized parameter. (car (car @var{args})) is name of variable
+and (nth 1 (car @var{args})) is name of backend
+(representation-type).@refill
+
+Example:@refill
+
+@lisp
+(mm-define-method entity-cooked-p ((entity chao)) nil)
+@end lisp
+@end defmac
-(Please read mm*.el)
@node Content-Type, Content-Disposition, Entity, Top
@menu
* Content-Transfer-Encoding parser:: Parser
-* Region encoder/decoder:: Region encoding/decoding
-* String encoder/decoder:: String encoding/decoding
-* File encoder/decoder:: File encoding/decoding
+* encoder/decoder:: Encoder/decoder
+* Encoding information:: Other utilities
+* mel-backend:: How to write encoder/decoder module
+* generic function for mel-backend:: How to add encoding/decoding service
@end menu
-@node Content-Transfer-Encoding parser, Region encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
+@node Content-Transfer-Encoding parser, encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
@section Parser
@defun mime-parse-Content-Transfer-Encoding string
-@node Region encoder/decoder, String encoder/decoder, Content-Transfer-Encoding parser, Content-Transfer-Encoding
-@section Region encoding/decoding
+@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding
+@section Encoder/decoder
@defun mime-encode-region start end encoding
@end defun
-@defvar mime-encoding-method-alist
-
-Alist of encoding vs. corresponding method to encode region.@refill
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region encoder and @code{nil} means not to encode.
-@end defvar
+@defun mime-decode-string string encoding
+@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
+@end defun
-@defvar mime-decoding-method-alist
-Alist of encoding vs. corresponding method to decode region.@refill
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region decoder and @code{nil} means not to decode.
-@end defvar
+@defun mime-insert-encoded-file filename encoding
+Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+@end defun
-@node String encoder/decoder, File encoder/decoder, Region encoder/decoder, Content-Transfer-Encoding
-@section String encoding/decoding
+@defun mime-write-decoded-region start end filename encoding
-@defun mime-decode-string string encoding
+Decode and write current region encoded by @var{encoding} into
+@var{filename}.@refill
-@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
+@var{start} and @var{end} are buffer positions.
@end defun
-@defvar mime-string-decoding-method-alist
-Alist of encoding vs. corresponding method to decode string.@refill
+@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding
+@section Other utilities
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is string decoder.
-@end defvar
+@defun mime-encoding-list &optional SERVICE
+Return list of Content-Transfer-Encoding.@refill
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
+@end defun
-@node File encoder/decoder, , String encoder/decoder, Content-Transfer-Encoding
-@section File encoding/decoding
-@defun mime-insert-encoded-file filename encoding
+@defun mime-encoding-alist &optional SERVICE
-Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+Return table of Content-Transfer-Encoding for completion.@refill
+
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
@end defun
-@defun mime-write-decoded-region start end filename encoding
-Decode and write current region encoded by @var{encoding} into
-@var{filename}.@refill
+@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding
+@section How to write encoder/decoder module
-@var{start} and @var{end} are buffer positions.
-@end defun
+@defmac mel-define-method name args &rest body
+Define @var{name} as a method function of (nth 1 (car (last
+@var{args}))) backend.@refill
-@defvar mime-file-encoding-method-alist
+@var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
-Alist of encoding vs. corresponding method to insert encoded
-file.@refill
+Example:@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to insert encoded file.
-@end defvar
+@lisp
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "base64"))
+ "Decode and write current region encoded by base64 into FILENAME.
+START and END are buffer positions."
+ (interactive
+ (list (region-beginning) (region-end)
+ (read-file-name "Write decoded region to file: ")))
+ (let ((str (buffer-substring start end)))
+ (with-temp-buffer
+ (insert (decode-base64-string str))
+ (write-region-as-binary (point-min) (point-max) filename)
+ )))
+@end lisp
+@end defmac
-@defvar mime-file-decoding-method-alist
+@defmac mel-define-method-function spec function
-Alist of encoding vs. corresponding method to write decoded region to
-file.@refill
+Set @var{spec}'s function definition to @var{function}.@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded region
-to file.
-@end defvar
+First element of @var{spec} is service.@refill
+
+Rest of @var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
+
+Example:@refill
+
+@lisp
+(mel-define-method-function (mime-encode-string string (nil "base64"))
+ 'encode-base64-string)
+@end lisp
+@end defmac
+
+
+
+@node generic function for mel-backend, , mel-backend, Content-Transfer-Encoding
+@section How to add encoding/decoding service
+
+@defmac mel-define-service name &optional args doc-string
+
+Define @var{name} as a service for Content-Transfer-Encodings.@refill
+
+If @var{args} is specified, @var{name} is defined as a generic function
+for the service.@refill
+
+Example:@refill
+
+@lisp
+(mel-define-service encoded-text-encode-string (string encoding)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.")
+@end lisp
+@end defmac
<!doctype sinfo system>
<head>
-<title>FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+<title>FLIM 1.10 MIME \e$B5!G=@bL@=q\e(B
<author>\e$B<i2,\e(B \e$BCNI'\e(B <mail>morioka@jaist.ac.jp</mail>
<date>1998/07/01
<h3> mm-backend \e$B$N:n$jJ}\e(B
<node> mm-backend module
<p>
-\e$B!J$9$_$^$;$s!#$=$N$&$A=q$-$^$9\e(B (^_^;\e$B!K\e(B
+<defmacro name="mm-define-backend">
+<args> type
+<opts> parents
<p>
-\e$B!J$H$j$"$($:!"\e(Bmm*.el \e$B$r;29M$K$7$F$/$@$5$$!K\e(B
+Define <var>type</var> as a mm-backend.
+<p>
+If <var>PARENTS</var> is specified, <var>type</var> inherits parents.
+Each parent must be representation-type.
+<p>
+Example:
+<p>
+<lisp>
+(mm-define-backend chao (generic))
+</lisp>
+</defmacro>
+
+<defmacro name="mm-define-method">
+<args> name args <rest> body
+<p>
+Define <var>name</var> as a method function of (nth 1 (car
+<var>args</var>)) backend.
+<p>
+<var>args</var> is like an argument list of lambda, but (car
+<var>args</var>) must be specialized parameter. (car (car
+<var>args</var>)) is name of variable and (nth 1 (car
+<var>args</var>)) is name of backend (representation-type).
+<p>
+Example:
+<p>
+<lisp>
+(mm-define-method entity-cooked-p ((entity chao)) nil)
+</lisp>
+</defmacro>
<h1> Content-Type \e$BMs$N>pJs\e(B
</defun>
-<h2> \e$BNN0h$NId9f2=!&I|9f2=\e(B
-<node> Region encoder/decoder
+<h2> \e$BId9f2=!&I|9f2=\e(B
+<node> encoder/decoder
<p>
<defun name="mime-encode-region">
<args> start end encoding
using <var>encoding</var>.
</defun>
-<defvar name="mime-encoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to encode region.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code> or
-<code>(STRING . nil)</code>. <var>string</var> is
-content-transfer-encoding. <code>function</code> is region encoder
-and <code>nil</code> means not to encode.
-</defvar>
-<defvar name="mime-decoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to decode region.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code> or
-<code>(STRING . nil)</code>. <var>string</var> is
-content-transfer-encoding. <code>function</code> is region decoder
-and <code>nil</code> means not to decode.
-</defvar>
-
-
-<h2> \e$BJ8;zNs$NId9f2=!&I|9f2=\e(B
-<node> String encoder/decoder
-<p>
<defun name="mime-decode-string">
<args> string encoding
<p>
<var>string</var> \e$B$r\e(B <var>encoding</var> \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
</defun>
-<defvar name="mime-string-decoding-method-alist">
-<p>
-Alist of encoding vs. corresponding method to decode string.
-<p>
-Each element looks like <code>(STRING . FUNCTION)</code>.
-STRING is content-transfer-encoding.
-FUNCTION is string decoder.
-</defvar>
-
-<h2> File \e$B$NId9f2=!&I|9f2=\e(B
-<node> File encoder/decoder
-<p>
<defun name="mime-insert-encoded-file">
<args> filename encoding
<p>
<var>start</var> and <var>end</var> are buffer positions.
</defun>
-<defvar name="mime-file-encoding-method-alist">
+
+<h2> Other utilities
+<node> Encoding information
<p>
-Alist of encoding vs. corresponding method to insert encoded file.
+<defun name="mime-encoding-list">
+ <opts> SERVICE
<p>
-Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
-content-transfer-encoding. FUNCTION is function to insert encoded
-file.
-</defvar>
+Return list of Content-Transfer-Encoding.
+<p>
+If <var>service</var> is specified, it returns available list of
+Content-Transfer-Encoding for it.
+</defun>
-<defvar name="mime-file-decoding-method-alist">
+<defun name="mime-encoding-alist">
+ <opts> SERVICE
<p>
-Alist of encoding vs. corresponding method to write decoded region to
-file.
+Return table of Content-Transfer-Encoding for completion.
<p>
-Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded
-region to file.
-</defvar>
+If <var>service</var> is specified, it returns available list of
+Content-Transfer-Encoding for it.
+</defun>
+
+
+<h2> How to write encoder/decoder module
+<node> mel-backend
+<p>
+<defmacro name="mel-define-method">
+<args> name args <rest> body
+<p>
+Define <var>name</var> as a method function of (nth 1 (car (last
+<var>args</var>))) backend.
+<p>
+<var>args</var> is like an argument list of lambda, but (car (last
+<var>args</var>)) must be specialized parameter. (car (car (last
+<var>args</var>))) is name of variable and (nth 1 (car (last
+<var>args</var>))) is name of backend (encoding).
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "base64"))
+ "Decode and write current region encoded by base64 into FILENAME.
+START and END are buffer positions."
+ (interactive
+ (list (region-beginning) (region-end)
+ (read-file-name "Write decoded region to file: ")))
+ (let ((str (buffer-substring start end)))
+ (with-temp-buffer
+ (insert (decode-base64-string str))
+ (write-region-as-binary (point-min) (point-max) filename)
+ )))
+</lisp>
+</defmacro>
+
+<defmacro name="mel-define-method-function">
+<args> spec function
+<p>
+Set <var>spec</var>'s function definition to <var>function</var>.
+<p>
+First element of <var>spec</var> is service.
+<p>
+Rest of <var>args</var> is like an argument list of lambda, but (car
+(last <var>args</var>)) must be specialized parameter. (car (car
+(last <var>args</var>))) is name of variable and (nth 1 (car (last
+<var>args</var>))) is name of backend (encoding).
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-method-function (mime-encode-string string (nil "base64"))
+ 'encode-base64-string)
+</lisp>
+</defmacro>
+
+
+<h2> How to add encoding/decoding service
+<node> generic function for mel-backend
+<p>
+<defmacro name="mel-define-service">
+<args> name
+<opts> args doc-string
+<p>
+Define <var>name</var> as a service for Content-Transfer-Encodings.
+<p>
+If <var>args</var> is specified, <var>name</var> is defined as a
+generic function for the service.
+<p>
+Example:
+<p>
+<lisp>
+(mel-define-service encoded-text-encode-string (string encoding)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.")
+</lisp>
+</defmacro>
<h1> Header \e$B$N\e(B network \e$BI=8=\e(B
\input texinfo.tex
@setfilename mime-ja.info
-@settitle{FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B}
+@settitle{FLIM 1.10 MIME \e$B5!G=@bL@=q\e(B}
@titlepage
-@title FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@title FLIM 1.10 MIME \e$B5!G=@bL@=q\e(B
@author \e$B<i2,\e(B \e$BCNI'\e(B <morioka@@jaist.ac.jp>
@subtitle 1998/07/01
@end titlepage
@node Top, Introduction, (dir), (dir)
-@top FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@top FLIM 1.10 MIME \e$B5!G=@bL@=q\e(B
@ifinfo
@node mm-backend module, , Request for entity, mm-backend
@subsection mm-backend \e$B$N:n$jJ}\e(B
-\e$B!J$9$_$^$;$s!#$=$N$&$A=q$-$^$9\e(B (^_^;\e$B!K\e(B@refill
+@defmac mm-define-backend type &optional parents
+
+Define @var{type} as a mm-backend.@refill
+
+If @var{PARENTS} is specified, @var{type} inherits parents. Each parent
+must be representation-type.@refill
+
+Example:@refill
+
+@lisp
+(mm-define-backend chao (generic))
+@end lisp
+@end defmac
+
+
+@defmac mm-define-method name args &rest body
+
+Define @var{name} as a method function of (nth 1 (car @var{args}))
+backend.@refill
+
+@var{args} is like an argument list of lambda, but (car @var{args}) must
+be specialized parameter. (car (car @var{args})) is name of variable
+and (nth 1 (car @var{args})) is name of backend
+(representation-type).@refill
+
+Example:@refill
+
+@lisp
+(mm-define-method entity-cooked-p ((entity chao)) nil)
+@end lisp
+@end defmac
-\e$B!J$H$j$"$($:!"\e(Bmm*.el \e$B$r;29M$K$7$F$/$@$5$$!K\e(B
@node Content-Type, Content-Disposition, Entity, Top
@menu
* Content-Transfer-Encoding parser:: Content-Transfer-Encoding \e$BMs$N2r@O4o\e(B
-* Region encoder/decoder:: \e$BNN0h$NId9f2=!&I|9f2=\e(B
-* String encoder/decoder:: \e$BJ8;zNs$NId9f2=!&I|9f2=\e(B
-* File encoder/decoder:: File \e$B$NId9f2=!&I|9f2=\e(B
+* encoder/decoder:: \e$BId9f2=!&I|9f2=\e(B
+* Encoding information:: Other utilities
+* mel-backend:: How to write encoder/decoder module
+* generic function for mel-backend:: How to add encoding/decoding service
@end menu
-@node Content-Transfer-Encoding parser, Region encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
+@node Content-Transfer-Encoding parser, encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
@section Content-Transfer-Encoding \e$BMs$N2r@O4o\e(B
@defun mime-parse-Content-Transfer-Encoding string
-@node Region encoder/decoder, String encoder/decoder, Content-Transfer-Encoding parser, Content-Transfer-Encoding
-@section \e$BNN0h$NId9f2=!&I|9f2=\e(B
+@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding
+@section \e$BId9f2=!&I|9f2=\e(B
@defun mime-encode-region start end encoding
@end defun
-@defvar mime-encoding-method-alist
-
-Alist of encoding vs. corresponding method to encode region.@refill
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region encoder and @code{nil} means not to encode.
-@end defvar
+@defun mime-decode-string string encoding
+@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
+@end defun
-@defvar mime-decoding-method-alist
-Alist of encoding vs. corresponding method to decode region.@refill
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region decoder and @code{nil} means not to decode.
-@end defvar
+@defun mime-insert-encoded-file filename encoding
+Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+@end defun
-@node String encoder/decoder, File encoder/decoder, Region encoder/decoder, Content-Transfer-Encoding
-@section \e$BJ8;zNs$NId9f2=!&I|9f2=\e(B
+@defun mime-write-decoded-region start end filename encoding
-@defun mime-decode-string string encoding
+Decode and write current region encoded by @var{encoding} into
+@var{filename}.@refill
-@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
+@var{start} and @var{end} are buffer positions.
@end defun
-@defvar mime-string-decoding-method-alist
-Alist of encoding vs. corresponding method to decode string.@refill
+@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding
+@section Other utilities
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is string decoder.
-@end defvar
+@defun mime-encoding-list &optional SERVICE
+Return list of Content-Transfer-Encoding.@refill
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
+@end defun
-@node File encoder/decoder, , String encoder/decoder, Content-Transfer-Encoding
-@section File \e$B$NId9f2=!&I|9f2=\e(B
-@defun mime-insert-encoded-file filename encoding
+@defun mime-encoding-alist &optional SERVICE
-Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+Return table of Content-Transfer-Encoding for completion.@refill
+
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
@end defun
-@defun mime-write-decoded-region start end filename encoding
-Decode and write current region encoded by @var{encoding} into
-@var{filename}.@refill
+@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding
+@section How to write encoder/decoder module
-@var{start} and @var{end} are buffer positions.
-@end defun
+@defmac mel-define-method name args &rest body
+Define @var{name} as a method function of (nth 1 (car (last
+@var{args}))) backend.@refill
-@defvar mime-file-encoding-method-alist
+@var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
-Alist of encoding vs. corresponding method to insert encoded
-file.@refill
+Example:@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to insert encoded file.
-@end defvar
+@lisp
+(mel-define-method mime-write-decoded-region (start end filename
+ (nil "base64"))
+ "Decode and write current region encoded by base64 into FILENAME.
+START and END are buffer positions."
+ (interactive
+ (list (region-beginning) (region-end)
+ (read-file-name "Write decoded region to file: ")))
+ (let ((str (buffer-substring start end)))
+ (with-temp-buffer
+ (insert (decode-base64-string str))
+ (write-region-as-binary (point-min) (point-max) filename)
+ )))
+@end lisp
+@end defmac
-@defvar mime-file-decoding-method-alist
+@defmac mel-define-method-function spec function
-Alist of encoding vs. corresponding method to write decoded region to
-file.@refill
+Set @var{spec}'s function definition to @var{function}.@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded region
-to file.
-@end defvar
+First element of @var{spec} is service.@refill
+
+Rest of @var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
+
+Example:@refill
+
+@lisp
+(mel-define-method-function (mime-encode-string string (nil "base64"))
+ 'encode-base64-string)
+@end lisp
+@end defmac
+
+
+
+@node generic function for mel-backend, , mel-backend, Content-Transfer-Encoding
+@section How to add encoding/decoding service
+
+@defmac mel-define-service name &optional args doc-string
+
+Define @var{name} as a service for Content-Transfer-Encodings.@refill
+
+If @var{args} is specified, @var{name} is defined as a generic function
+for the service.@refill
+
+Example:@refill
+
+@lisp
+(mel-define-service encoded-text-encode-string (string encoding)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.")
+@end lisp
+@end defmac