From 0d3027eb439ffb21ca80cb7926a039810da6fee3 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 1 Sep 1998 04:05:29 +0000 Subject: [PATCH] * Sync up with flim-1_9_1. * mime-def.el (mime-library-version-string): bump up to FLAM-DOODLE 1.9.2. --- ChangeLog | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ DOODLE-VERSION | 2 +- FLIM-ELS | 5 +-- FLIM-VERSION | 23 ++++++++++- Makefile | 3 +- eword-encode.el | 121 +++++++++++++++++++++++++++++++++++-------------------- mel-b.el | 66 +++++++++++++++++++----------- mel.el | 104 ++++++++++++++++++++++++++++++----------------- mime-def.el | 4 +- mime-en.sgml | 9 ++--- mime-en.texi | 9 ++--- mmbuffer.el | 6 +-- 12 files changed, 349 insertions(+), 123 deletions(-) diff --git a/ChangeLog b/ChangeLog index 635323a..710cb90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-09-01 Tanaka Akira + + * Sync up with flim-1_9_1. + + * mime-def.el (mime-library-version-string): bump up to + FLAM-DOODLE 1.9.2. + 1998-08-28 Tanaka Akira * ew-dec.el (ew-decode-field-test): Change column. @@ -886,6 +893,119 @@ * eword-decode.el: Copied from AKEMI branch of SEMI. +1998-08-31 MORIOKA Tomohiko + + * FLIM: Version 1.9.1 (Tonosh.DNr) was released.*B + + * mime-en.sgml (mm-backend): Translate a little. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-default-start-column): New user + option. + (eword-encode-string): Use `eword-encode-default-start-column'. + (eword-encode-address-list): Likewise. + (eword-encode-structured-field-body): Likewise. + (eword-encode-unstructured-field-body): Likewise. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode): New group. + (eword-field-encoding-method-alist): Now a user option (was: + variable). + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el: Rename `tm-eword::mailbox-to-rwl' -> + `eword-encode-mailbox-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::phrase-to-rwl' -> + `eword-encode-phrase-to-rword-list'. + + * eword-encode.el: Rename `eword-addr-spec-to-rwl' -> + `eword-encode-addr-spec-to-rword-list'. + + * eword-encode.el: Rename `eword-phrase-route-addr-to-rwl' -> + `eword-encode-phrase-route-addr-to-rword-list'. + + * eword-encode.el: Rename `eword-addr-seq-to-rwl' -> + `eword-encode-addr-seq-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::split-string' -> + `eword-encode-split-string'. + + * eword-encode.el: Rename `tm-eword::addresses-to-rwl' -> + `eword-encode-addresses-to-rword-list'. + + * eword-encode.el: Rename `tm-eword::encode-rwl' -> + `eword-encode-rword-list'. + + * eword-encode.el (eword-encode-unstructured-field-body): New + function. + (eword-encode-field): Use `eword-encode-unstructured-field-body'. + +1998-08-31 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-string): Add DOC-string. + (eword-encode-address-list): Likewise. + (eword-encode-structured-field-body): Likewise. + + * eword-encode.el (eword-encode-field): Regard `In-Reply-To' as a + structured field. + +1998-08-28 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-field): Use `capitalize' instead + of `downcase' for `field-name'. + + * eword-encode.el (eword-encode-structured-field-body): New + function. + (eword-encode-field): Use `eword-encode-structured-field-body' for + "MIME-Version" and "User-Agent" field. + +1998-08-26 Shuhei KOBAYASHI + + * mime-def.el (mm-define-method): Put `edebug-form-spec'. + +1998-08-28 MORIOKA Tomohiko + + * eword-encode.el (eword-encode-address-list): New function. + (eword-encode-field): Use `eword-encode-address-list' instead of + `tm-eword::encode-address-list'; abolish + `tm-eword::encode-address-list'. + + * eword-encode.el (eword-encode-field): Use `eword-encode-string' + instead of `tm-eword::encode-string'; abolish + `tm-eword::encode-string'. + + * eword-encode.el: Rename `tm-eword::make-rword' -> + `make-ew-rword'; rename `tm-eword::rword-' -> `ew-rword-'. + +1998-08-26 Shuhei KOBAYASHI + + * mel-b.el (base64-insert-encoded-file): Conditionally use + internal converter. (cf. [tm-ja:3320]) + (base64-write-decoded-region): Ditto. + +1998-08-25 MORIOKA Tomohiko + + * FLIM-ELS (flim-modules): Don't add `mel-dl' unconditionally. + +1998-08-25 MORIOKA Tomohiko + + * Delete mime-lib.el. + +1998-08-10 MORIOKA Tomohiko + + * mmbuffer.el (write-entity): `write-region-as-CRLF' was renamed + to `write-region-as-raw-text-CRLF'. + +1998-08-07 MORIOKA Tomohiko + + * mmbuffer.el (write-entity): Use `write-region-as-CRLF' instead + of `write-region-as-binary'. + + 1998-07-15 MORIOKA Tomohiko * FLIM: Version 1.9.0 (Terada) was released. diff --git a/DOODLE-VERSION b/DOODLE-VERSION index 8d0333a..d980337 100644 --- a/DOODLE-VERSION +++ b/DOODLE-VERSION @@ -15,7 +15,7 @@ Order is not significant. 9 $B`O!9Hl(B $B$7$g$&$8$g$&$R(B 7.5R4.5/14.0 FLIM-FLAM 1.9.1 10 $B9HHl(B $B$Y$K$R(B 7.5R5.0/13.0 FLAM-DOODLE 1.9.0 11 $B2+C0(B $B$o$&$?$s(B 10R5.5/14.0 FLAM-DOODLE 1.9.1 - 12 $B??Hl(B $B$^$R(B 10R6.0/11.0 + 12 $B??Hl(B $B$^$R(B 10R6.0/11.0 FLAM-DOODLE 1.9.2 13 $(DT`(B $B$=$R(B 2.5YR7.0/11.0 14 $B3A(B $B$+$-(B 10R6.5/10.0 15 $B?<;Y;R(B $B$3$-$/$A$J$7(B 10YR7.5/8.0 diff --git a/FLIM-ELS b/FLIM-ELS index fa3c9e1..d112dad 100644 --- a/FLIM-ELS +++ b/FLIM-ELS @@ -4,7 +4,8 @@ ;;; Code: -(setq flim-modules '(mime-def +(setq flim-modules '(std11 + mime-def mel mel-dl mel-ccl mel-b mel-q mel-u mel-g closure natset @@ -25,10 +26,8 @@ ew-scan-u ew-scan-n ew-dec - std11 eword-decode eword-encode mime mime-parse mmbuffer mmcooked - ;; mime-lib mailcap )) diff --git a/FLIM-VERSION b/FLIM-VERSION index c5eee0f..7e93731 100644 --- a/FLIM-VERSION +++ b/FLIM-VERSION @@ -12,7 +12,7 @@ 1.2.1 Kamitobaguchi $(B>eD;1)8}(B 1.2.2 Takeda $(BC]ED(B ; = $(B5~ET;T8rDL6I(B $(B1(4]@~(B 1.3.0 Fushimi $(BIz8+(B -1.4.0 Kintetsu-Tanbabashi $(B6aE4C0GH66(B ; <=> $(B5~:e(B $(BC0GH66(B +1.4.0 Kintetsu-Tambabashi $(B6aE4C0GH66(B ; <=> $(B5~:e(B $(BC0GH66(B 1.4.1 Momoyama-Gory-Dòmae-A $(BEm;38fNMA0(B 1.5.0 Mukaijima $(B8~Eg(B 1.6.0 Ogura $(B>.AR(B @@ -20,6 +20,27 @@ 1.8.0 -DÒkubo-A $(BBg5WJ](B 1.8.1 Kutsukawa $(B5WDE@n(B 1.9.0 Terada $(B;{ED(B +1.9.1 Tonosh-Dò-A $(BIYLnAq(B +----- Shin-Tanabe $(B?7EDJU(B +----- K-Dòdo-A $(B6=8M(B +----- Miyamaki $(B;0;3LZ(B +----- Kintetsu-Miyazu $(B6aE45\DE(B +----- Komada $(B9}ED(B +----- Shin-H-Dòsono-A $(B?7=K1`(B +----- Kizugawadai $(BLZDE@nBf(B +----- Yamadagawa $(B;3ED@n(B +----- Takanohara $(B9b$N86(B +----- Heij-Dò-A $(BJ?>k(B +----- Saidaiji $(B@>Bg;{(B +;;------------------------------------------------------------------------- +;; Kinki Nippon Railway $(B6a5&F|K\E4F;(B http://www.kintetsu.co.jp/ +;; Ky-Dòto-A Line $(B3`86@~(B +;;------------------------------------------------------------------------- + (Saidaiji) ($(B@>Bg;{(B) +----- Amagatsuji $(BFt%vDT(B +----- Nishinoky-Dò-A $(B@>$N5~(B +----- Kuj-Dò-A $(B6e>r(B +----- Kintetsu-K-Dòriyama-A $(B6aE474;3(B [Chao Version names] diff --git a/Makefile b/Makefile index f170607..1eb017c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # PACKAGE = flim -VERSION = 1.9.0 +VERSION = 1.9.1 TAR = tar RM = /bin/rm -f @@ -56,7 +56,6 @@ ew-parse.el: ew-parse.scm lalr-el.scm check: $(EMACS) $(FLAGS_CURDIR) -l ./TESTPAT -eval '(report)' - # The file BENCHMARK is not a part of FLAM-DOODLE because it is so large. benchmark: $(EMACS) $(FLAGS_CURDIR) -l ./BENCHMARK -eval '(report)' diff --git a/eword-encode.el b/eword-encode.el index b0b34e1..7b2c1b9 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -5,7 +5,7 @@ ;; Author: MORIOKA Tomohiko ;; Keywords: encoded-word, MIME, multilingual, header, mail, news -;; This file is part of SEMI (Spadework for Emacs MIME Interfaces). +;; 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 @@ -34,7 +34,11 @@ ;;; @ variables ;;; -(defvar eword-field-encoding-method-alist +(defgroup eword-encode nil + "Encoded-word encoding" + :group 'mime) + +(defcustom eword-field-encoding-method-alist '(("X-Nsubject" . iso-2022-jp-2) ("Newsgroups" . nil) ("Message-ID" . nil) @@ -52,7 +56,15 @@ If method is `default-mime-charset', this field will be encoded as variable `default-mime-charset' when it must be convert into network-code. -If method is nil, this field will not be encoded.") +If method is nil, this field will not be encoded." + :group 'eword-encode + :type '(repeat (cons (choice :tag "Field" + (string :tag "Name") + (const :tag "Default" t)) + (choice :tag "Method" + (const :tag "MIME conversion" mime) + (symbol :tag "non-MIME conversion") + (const :tag "no-conversion" nil))))) (defvar eword-charset-encoding-alist '((us-ascii . nil) @@ -227,7 +239,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (reverse prev) )) -(defun tm-eword::split-string (str &optional mode) +(defun eword-encode-split-string (str &optional mode) (tm-eword::space-process (tm-eword::words-to-ruled-words (eword-encode-charset-words-to-words @@ -324,7 +336,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (list string len rwl) )) -(defun tm-eword::encode-rwl (column rwl) +(defun eword-encode-rword-list (column rwl) (let (ret dest ps special str ew-f pew-f) (while rwl (setq ew-f (nth 2 (car rwl))) @@ -377,7 +389,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is ;;; @ converter ;;; -(defun tm-eword::phrase-to-rwl (phrase) +(defun eword-encode-phrase-to-rword-list (phrase) (let (token type dest str) (while phrase (setq token (car phrase)) @@ -420,7 +432,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (tm-eword::space-process dest) )) -(defun eword-addr-seq-to-rwl (seq) +(defun eword-encode-addr-seq-to-rword-list (seq) (let (dest pname) (while seq (let* ((token (car seq)) @@ -434,7 +446,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (nconc dest (list (list "(" nil nil)) - (tm-eword::split-string (cdr token) 'comment) + (eword-encode-split-string (cdr token) 'comment) (list (list ")" nil nil)) )) ) @@ -462,7 +474,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is ) dest)) -(defun eword-phrase-route-addr-to-rwl (phrase-route-addr) +(defun eword-encode-phrase-route-addr-to-rword-list (phrase-route-addr) (if (eq (car phrase-route-addr) 'phrase-route-addr) (let ((phrase (nth 1 phrase-route-addr)) (route (nth 2 phrase-route-addr)) @@ -470,70 +482,94 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (if (eq (car (car phrase)) 'spaces) (setq phrase (cdr phrase)) ) - (setq dest (tm-eword::phrase-to-rwl phrase)) + (setq dest (eword-encode-phrase-to-rword-list phrase)) (if dest (setq dest (append dest '((" " nil nil)))) ) (append dest - (eword-addr-seq-to-rwl + (eword-encode-addr-seq-to-rword-list (append '((specials . "<")) route '((specials . ">")))) )))) -(defun eword-addr-spec-to-rwl (addr-spec) +(defun eword-encode-addr-spec-to-rword-list (addr-spec) (if (eq (car addr-spec) 'addr-spec) - (eword-addr-seq-to-rwl (cdr addr-spec)) + (eword-encode-addr-seq-to-rword-list (cdr addr-spec)) )) -(defun tm-eword::mailbox-to-rwl (mbox) +(defun eword-encode-mailbox-to-rword-list (mbox) (let ((addr (nth 1 mbox)) (comment (nth 2 mbox)) dest) - (setq dest (or (eword-phrase-route-addr-to-rwl addr) - (eword-addr-spec-to-rwl addr) + (setq dest (or (eword-encode-phrase-route-addr-to-rword-list addr) + (eword-encode-addr-spec-to-rword-list addr) )) (if comment (setq dest (append dest '((" " nil nil) ("(" nil nil)) - (tm-eword::split-string comment 'comment) + (eword-encode-split-string comment 'comment) '((")" nil nil)) ))) dest)) -(defun tm-eword::addresses-to-rwl (addresses) - (let ((dest (tm-eword::mailbox-to-rwl (car addresses)))) +(defsubst eword-encode-addresses-to-rword-list (addresses) + (let ((dest (eword-encode-mailbox-to-rword-list (car addresses)))) (if dest (while (setq addresses (cdr addresses)) - (setq dest (append dest - '(("," nil nil)) - '((" " nil nil)) - (tm-eword::mailbox-to-rwl (car addresses)) - )) + (setq dest + (append dest + '(("," nil nil)) + '((" " nil nil)) + (eword-encode-mailbox-to-rword-list (car addresses)) + )) )) dest)) + +;;; @ application interfaces +;;; + +(defcustom eword-encode-default-start-column 10 + "Default start column if it is omitted." + :group 'eword-encode + :type 'integer) + +(defun eword-encode-string (string &optional column mode) + "Encode STRING as encoded-words, and return the result. +Optional argument COLUMN is start-position of the field. +Optional argument MODE allows `text', `comment', `phrase' or nil. +Default value is `phrase'." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-split-string string mode)))) + (defun eword-encode-address-list (string &optional column) - (car (tm-eword::encode-rwl - (or column 0) - (tm-eword::addresses-to-rwl (std11-parse-addresses-string string)) + "Encode header field STRING as list of address, and return the result. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-addresses-to-rword-list + (std11-parse-addresses-string string)) ))) (defun eword-encode-structured-field-body (string &optional column) - (car (tm-eword::encode-rwl - (or column 0) - (eword-addr-seq-to-rwl (std11-lexical-analyze string)) + "Encode header field STRING as structured field, and return the result. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-addr-seq-to-rword-list (std11-lexical-analyze string)) ))) - -;;; @ application interfaces -;;; - -(defun eword-encode-string (str &optional column mode) - (car (tm-eword::encode-rwl (or column 0) (tm-eword::split-string str mode)))) +(defun eword-encode-unstructured-field-body (string &optional column) + "Encode header field STRING as unstructured field, and return the result. +Optional argument COLUMN is start-position of the field." + (car (eword-encode-rword-list + (or column eword-encode-default-start-column) + (eword-encode-split-string string 'text)))) (defun eword-encode-field (string) "Encode header field STRING, and return the result. @@ -554,21 +590,20 @@ encoded-word. ASCII token is not encoded." From Sender Resent-Reply-To Resent-From Resent-Sender To Resent-To - Cc Resent-Cc - Bcc Resent-Bcc Dcc)) + Cc Resent-Cc Bcc Resent-Bcc + Dcc)) (eword-encode-address-list field-body (+ (length field-name) 2)) ) ((memq field-name-symbol - '(Mime-Version User-Agent - In-Reply-To)) + '(In-Reply-To + Mime-Version User-Agent)) (eword-encode-structured-field-body field-body (+ (length field-name) 2)) ) (t - (eword-encode-string field-body - (1+ (length field-name)) - 'text) + (eword-encode-unstructured-field-body + field-body (1+ (length field-name))) )) ) (concat field-name ": " ret) diff --git a/mel-b.el b/mel-b.el index c82f4da..4eb9ca7 100644 --- a/mel-b.el +++ b/mel-b.el @@ -205,36 +205,35 @@ (save-excursion (save-restriction (narrow-to-region beg end) - (as-binary-process (apply (function call-process-region) - beg end (car base64-external-encoder) - t t nil (cdr base64-external-encoder)) - ) + (as-binary-process + (apply (function call-process-region) + beg end (car base64-external-encoder) + t t nil (cdr base64-external-encoder))) ;; for OS/2 ;; regularize line break code (goto-char (point-min)) (while (re-search-forward "\r$" nil t) - (replace-match "") - ) + (replace-match "")) ))) (defun base64-external-decode-region (beg end) (save-excursion - (as-binary-process (apply (function call-process-region) - beg end (car base64-external-decoder) - t t nil (cdr base64-external-decoder)) - ))) + (as-binary-process + (apply (function call-process-region) + beg end (car base64-external-decoder) + t t nil (cdr base64-external-decoder))) + )) (defun base64-external-decode-string (string) (with-temp-buffer (insert string) - (as-binary-process (apply (function call-process-region) - (point-min) (point-max) - (car base64-external-decoder) - t t nil (cdr base64-external-decoder)) - ) + (as-binary-process + (apply (function call-process-region) + (point-min) (point-max) + (car base64-external-decoder) + t t nil (cdr base64-external-decoder))) (buffer-string))) - ;;; @ base64 encoder/decoder for file ;;; @@ -245,9 +244,21 @@ It calls external base64 encoder specified by mmencode included in metamail or XEmacs package)." (interactive (list (read-file-name "Insert encoded file: "))) (apply (function call-process) (car base64-external-encoder) - filename t nil (cdr base64-external-encoder)) + filename t nil (cdr base64-external-encoder)) ) +(defun base64-internal-insert-encoded-file (filename) + "Encode contents of file FILENAME to base64, and insert the result." + (interactive (list (read-file-name "Insert encoded file: "))) + (insert + (base64-internal-encode-string + (with-temp-buffer + (insert-file-contents-as-binary filename) + (buffer-string)))) + (or (bolp) + (insert "\n")) + ) + (defun base64-external-write-decoded-region (start end filename) "Decode and write current region encoded by base64 into FILENAME. START and END are buffer positions." @@ -256,13 +267,22 @@ START and END are buffer positions." (read-file-name "Write decoded region to file: "))) (as-binary-process (apply (function call-process-region) - start end (car base64-external-decoder) - nil nil nil - (append (cdr base64-external-decoder) - base64-external-decoder-option-to-specify-file - (list filename)) - ))) + start end (car base64-external-decoder) + nil nil nil + (append (cdr base64-external-decoder) + base64-external-decoder-option-to-specify-file + (list filename))))) +(defun base64-internal-write-decoded-region (start end filename) + "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 (base64-internal-decode-string str)) + (write-region-as-binary (point-min) (point-max) filename)))) ;;; @ etc ;;; diff --git a/mel.el b/mel.el index b1c96e5..2f5ddd2 100644 --- a/mel.el +++ b/mel.el @@ -89,6 +89,10 @@ external decoder is called.") "Encode current region by base64." t) (autoload 'base64-internal-decode-region "mel-b" "Decode current region by base64." t) +(autoload 'base64-internal-insert-encoded-file "mel-b" + "Encode contents of file to base64, and insert the result." t) +(autoload 'base64-internal-write-decoded-region "mel-b" + "Decode and write current region encoded by base64 into FILENAME." t) (autoload 'base64-external-encode-string "mel-b" "Encode STRING to base64, and return the result.") @@ -98,7 +102,6 @@ external decoder is called.") "Encode current region by base64." t) (autoload 'base64-external-decode-region "mel-b" "Decode current region by base64." t) - (autoload 'base64-external-insert-encoded-file "mel-b" "Encode contents of file to base64, and insert the result." t) (autoload 'base64-external-write-decoded-region "mel-b" @@ -214,24 +217,40 @@ external decoder is called.") (t (defalias 'base64-encode-string 'base64-internal-encode-string))) +(defun base64-internal-external-decode-string (string) + "Decode STRING which is encoded in base64, and return the result. +This function calls internal base64 decoder if size of STRING is +smaller than `base64-internal-decoding-limit', otherwise it calls +external base64 decoder specified by `base64-external-decoder'. In +this case, you must install the program (maybe mmencode included in +metamail or XEmacs package)." + (interactive "r") + (if (and base64-internal-decoding-limit + (> (length string) base64-internal-decoding-limit)) + (base64-external-decode-string string) + (base64-internal-decode-string string))) + (cond ((fboundp 'base64-dl-decode-string) (defalias 'base64-decode-string 'base64-dl-decode-string)) ((fboundp 'base64-ccl-decode-string) (defalias 'base64-decode-string 'base64-ccl-decode-string)) (t - (defun base64-decode-string (string) - "Decode STRING which is encoded in base64, and return the result. -This function calls internal base64 decoder if size of STRING is -smaller than `base64-internal-decoding-limit', otherwise it calls -external base64 decoder specified by `base64-external-decoder'. In + (defalias 'base64-decode-string 'base64-internal-external-decode-string))) + +(defun base64-internal-external-encode-region (start end) + "Encode current region by base64. +START and END are buffer positions. +This function calls internal base64 encoder if size of region is +smaller than `base64-internal-encoding-limit', otherwise it calls +external base64 encoder specified by `base64-external-encoder'. In this case, you must install the program (maybe mmencode included in metamail or XEmacs package)." - (interactive "r") - (if (and base64-internal-decoding-limit - (> (length string) base64-internal-decoding-limit)) - (base64-external-decode-string string) - (base64-internal-decode-string string))))) + (interactive "r") + (if (and base64-internal-encoding-limit + (> (- end start) base64-internal-encoding-limit)) + (base64-external-encode-region start end) + (base64-internal-encode-region start end))) (cond ((fboundp 'base64-dl-encode-region) @@ -239,19 +258,21 @@ metamail or XEmacs package)." ((fboundp 'base64-ccl-encode-region) (defalias 'base64-encode-region 'base64-ccl-encode-region)) ; no fold (t - (defun base64-encode-region (start end) - "Encode current region by base64. + (defalias 'base64-encode-region 'base64-internal-external-encode-region))) ; LF fold + +(defun base64-internal-external-decode-region (start end) + "Decode current region by base64. START and END are buffer positions. -This function calls internal base64 encoder if size of region is -smaller than `base64-internal-encoding-limit', otherwise it calls -external base64 encoder specified by `base64-external-encoder'. In +This function calls internal base64 decoder if size of region is +smaller than `base64-internal-decoding-limit', otherwise it calls +external base64 decoder specified by `base64-external-decoder'. In this case, you must install the program (maybe mmencode included in metamail or XEmacs package)." - (interactive "r") - (if (and base64-internal-encoding-limit - (> (- end start) base64-internal-encoding-limit)) - (base64-external-encode-region start end) - (base64-internal-encode-region start end))))) ; LF fold + (interactive "r") + (if (and base64-internal-decoding-limit + (> (- end start) base64-internal-decoding-limit)) + (base64-external-decode-region start end) + (base64-internal-decode-region start end))) (cond ((fboundp 'base64-dl-decode-region) @@ -259,31 +280,42 @@ metamail or XEmacs package)." ((fboundp 'base64-ccl-decode-region) (defalias 'base64-decode-region 'base64-ccl-decode-region)) (t - (defun base64-decode-region (start end) - "Decode current region by base64. -START and END are buffer positions. -This function calls internal base64 decoder if size of region is -smaller than `base64-internal-decoding-limit', otherwise it calls -external base64 decoder specified by `base64-external-decoder'. In -this case, you must install the program (maybe mmencode included in -metamail or XEmacs package)." - (interactive "r") - (if (and base64-internal-decoding-limit - (> (- end start) base64-internal-decoding-limit)) - (base64-external-decode-region start end) - (base64-internal-decode-region start end))))) + (defalias 'base64-decode-region 'base64-internal-external-decode-region))) + +(defun base64-internal-external-insert-encoded-file (filename) + "Encode contents of file FILENAME to base64, and insert the result. +It calls external base64 encoder specified by +`base64-external-encoder'. So you must install the program (maybe +mmencode included in metamail or XEmacs package)." + (interactive (list (read-file-name "Insert encoded file: "))) + (if (and base64-internal-encoding-limit + (> (nth 7 (file-attributes filename)) + base64-internal-encoding-limit)) + (base64-external-insert-encoded-file filename) + (base64-internal-insert-encoded-file filename))) (cond ((fboundp 'base64-ccl-insert-encoded-file) (defalias 'base64-insert-encoded-file 'base64-ccl-insert-encoded-file)) (t - (defalias 'base64-insert-encoded-file 'base64-external-insert-encoded-file))) + (defalias 'base64-insert-encoded-file 'base64-internal-external-insert-encoded-file))) + +(defun base64-internal-external-write-decoded-region (start end filename) + "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: "))) + (if (and base64-internal-decoding-limit + (> (- end start) base64-internal-decoding-limit)) + (base64-external-write-decoded-region start end filename) + (base64-internal-write-decoded-region start end filename))) (cond ((fboundp 'base64-ccl-write-decoded-region) (defalias 'base64-write-decoded-region 'base64-ccl-write-decoded-region)) (t - (defalias 'base64-write-decoded-region 'base64-external-write-decoded-region))) + (defalias 'base64-write-decoded-region 'base64-internal-external-write-decoded-region))) (cond (t diff --git a/mime-def.el b/mime-def.el index f362130..662cdb2 100644 --- a/mime-def.el +++ b/mime-def.el @@ -25,7 +25,7 @@ ;;; Code: (defconst mime-library-version-string - "FLAM-DOODLE 1.9.1 - \"$B2+C0(B\" 10R5.5/14.0") + "FLAM-DOODLE 1.9.2 - \"$B??Hl(B\" 10R6.0/11.0") ;;; @ variables @@ -316,6 +316,8 @@ message/rfc822, `mime-entity' structures of them are included in )))) (put 'mm-define-method 'lisp-indent-function 'defun) +(put 'mm-define-method 'edebug-form-spec + '(&define name ((arg symbolp) &rest arg) def-body)) ;;; @ end diff --git a/mime-en.sgml b/mime-en.sgml index f9d5d4e..d7a7a3a 100644 --- a/mime-en.sgml +++ b/mime-en.sgml @@ -351,12 +351,11 @@ contains entity.

Entity representations and implementations mm-backend

-Entity $B$OCj>]2=$5$l$?%G!<%?I=8=$G!" -$B$3$3$G!"(Bentity $B$,$I$&$$$&representation-type $B$G!"(Bentity $B$r@8@.$9$k;~$K$O$3$l$r(B -$B;XDj$7$^$9!#(B +Each entity has representation-type. It must be +specified when an entity is created.

$BA0@a$^$G$K=R$Y$FMh$?(B entity $B$KBP$9$k=hM}$O!"(Bentity $B$KBP$7$F$=$N=hM}$r0M(B $BMj$9$k$3$H$K$h$C$F]2=$5$l$?%G!<%?I=8=$G!"