From 9b8b369bbe7ad17b40325f41590757e370b126cf Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 7 Oct 1998 15:24:59 +0000 Subject: [PATCH] update. --- mime-en.texi | 151 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 84 insertions(+), 67 deletions(-) diff --git a/mime-en.texi b/mime-en.texi index 3d94875..1f28037 100644 --- a/mime-en.texi +++ b/mime-en.texi @@ -1,13 +1,13 @@ \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 @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 @@ -101,8 +101,7 @@ mime-entity.@refill If @var{buffer} is omitted, current buffer is used.@refill @var{type} is representation-type of created -mime-entity. (cf. @ref{mm-backend}) - Default value is @var{buffer}. +mime-entity. (cf. @ref{mm-backend}) Default value is @var{buffer}. @end defun @@ -724,13 +723,13 @@ Content-Transfer-Encoding. @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 @@ -750,8 +749,8 @@ Content-Transfer-Encoding $BMs$,B8:_$7$J$$>l9g$O(B@var{default-encoding} $B$r -@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 @@ -767,105 +766,123 @@ Decode region @var{start} to @var{end} of current buffer using @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} $B$r(B @var{encoding} $B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#(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} $B$r(B @var{encoding} $B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#(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, Encoding information, 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 -@node Encoding information, , File encoder/decoder, Content-Transfer-Encoding -@section Other utilities +@lisp +(mel-define-method-function (mime-encode-string string (nil "base64")) + 'encode-base64-string) +@end lisp +@end defmac -@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 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 -@defun mime-encoding-alist &optional SERVICE +Define @var{name} as a service for Content-Transfer-Encodings.@refill -Return table of Content-Transfer-Encoding for completion.@refill +If @var{args} is specified, @var{name} is defined as a generic function +for the service.@refill -If @var{service} is specified, it returns available list of -Content-Transfer-Encoding for it. -@end defun +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 -- 1.7.10.4