+1998-09-01 Tanaka Akira <akr@jaist.ac.jp>
+
+ * 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 <akr@jaist.ac.jp>
* ew-dec.el (ew-decode-field-test): Change column.
* eword-decode.el: Copied from AKEMI branch of SEMI.
\f
+1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * FLIM: Version 1.9.1 (Tonosh\e.D\eNr) was released.\e*B
+
+ * mime-en.sgml (mm-backend): Translate a little.
+
+1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * 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 <morioka@jaist.ac.jp>
+
+ * eword-encode.el (eword-encode): New group.
+ (eword-field-encoding-method-alist): Now a user option (was:
+ variable).
+
+1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * 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 <morioka@jaist.ac.jp>
+
+ * 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 <morioka@jaist.ac.jp>
+
+ * 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 <shuhei-k@jaist.ac.jp>
+
+ * mime-def.el (mm-define-method): Put `edebug-form-spec'.
+
+1998-08-28 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * 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 <shuhei-k@jaist.ac.jp>
+
+ * 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 <morioka@jaist.ac.jp>
+
+ * FLIM-ELS (flim-modules): Don't add `mel-dl' unconditionally.
+
+1998-08-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * Delete mime-lib.el.
+
+1998-08-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * mmbuffer.el (write-entity): `write-region-as-CRLF' was renamed
+ to `write-region-as-raw-text-CRLF'.
+
+1998-08-07 MORIOKA Tomohiko <morioka@yo.rim.or.jp>
+
+ * mmbuffer.el (write-entity): Use `write-region-as-CRLF' instead
+ of `write-region-as-binary'.
+
+\f
1998-07-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* FLIM: Version 1.9.0 (Terada) was released.
9 \e$B`O!9Hl\e(B \e$B$7$g$&$8$g$&$R\e(B 7.5R4.5/14.0 FLIM-FLAM 1.9.1
10 \e$B9HHl\e(B \e$B$Y$K$R\e(B 7.5R5.0/13.0 FLAM-DOODLE 1.9.0
11 \e$B2+C0\e(B \e$B$o$&$?$s\e(B 10R5.5/14.0 FLAM-DOODLE 1.9.1
- 12 \e$B??Hl\e(B \e$B$^$R\e(B 10R6.0/11.0
+ 12 \e$B??Hl\e(B \e$B$^$R\e(B 10R6.0/11.0 FLAM-DOODLE 1.9.2
13 \e$(DT`\e(B \e$B$=$R\e(B 2.5YR7.0/11.0
14 \e$B3A\e(B \e$B$+$-\e(B 10R6.5/10.0
15 \e$B?<;Y;R\e(B \e$B$3$-$/$A$J$7\e(B 10YR7.5/8.0
;;; 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
ew-scan-u
ew-scan-n
ew-dec
- std11
eword-decode eword-encode
mime mime-parse mmbuffer mmcooked
- ;; mime-lib
mailcap
))
1.2.1 Kamitobaguchi \e$(B>eD;1)8}\e(B
1.2.2 Takeda \e$(BC]ED\e(B ; = \e$(B5~ET;T8rDL6I\e(B \e$(B1(4]@~\e(B
1.3.0 Fushimi \e$(BIz8+\e(B
-1.4.0 Kintetsu-Tanbabashi \e$(B6aE4C0GH66\e(B ; <=> \e$(B5~:e\e(B \e$(BC0GH66\e(B
+1.4.0 Kintetsu-Tambabashi \e$(B6aE4C0GH66\e(B ; <=> \e$(B5~:e\e(B \e$(BC0GH66\e(B
1.4.1 Momoyama-Gory\e-Dòmae\e-A \e$(BEm;38fNMA0\e(B
1.5.0 Mukaijima \e$(B8~Eg\e(B
1.6.0 Ogura \e$(B>.AR\e(B
1.8.0 \e-DÒkubo\e-A \e$(BBg5WJ]\e(B
1.8.1 Kutsukawa \e$(B5WDE@n\e(B
1.9.0 Terada \e$(B;{ED\e(B
+1.9.1 Tonosh\e-Dò\e-A \e$(BIYLnAq\e(B
+----- Shin-Tanabe \e$(B?7EDJU\e(B
+----- 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
+----- Komada \e$(B9}ED\e(B
+----- Shin-H\e-Dòsono\e-A \e$(B?7=K1`\e(B
+----- Kizugawadai \e$(BLZDE@nBf\e(B
+----- Yamadagawa \e$(B;3ED@n\e(B
+----- Takanohara \e$(B9b$N86\e(B
+----- Heij\e-Dò\e-A \e$(BJ?>k\e(B
+----- Saidaiji \e$(B@>Bg;{\e(B
+;;-------------------------------------------------------------------------
+;; Kinki Nippon Railway \e$(B6a5&F|K\E4F;\e(B http://www.kintetsu.co.jp/
+;; Ky\e-Dòto\e-A Line \e$(B3`86@~\e(B
+;;-------------------------------------------------------------------------
+ (Saidaiji) (\e$(B@>Bg;{\e(B)
+----- Amagatsuji \e$(BFt%vDT\e(B
+----- Nishinoky\e-Dò\e-A \e$(B@>$N5~\e(B
+----- Kuj\e-Dò\e-A \e$(B6e>r\e(B
+----- Kintetsu-K\e-Dòriyama\e-A \e$(B6aE474;3\e(B
[Chao Version names]
#
PACKAGE = flim
-VERSION = 1.9.0
+VERSION = 1.9.1
TAR = tar
RM = /bin/rm -f
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)'
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; 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
;;; @ 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)
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)
(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
(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)))
;;; @ 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))
(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))
(nconc
dest
(list (list "(" nil nil))
- (tm-eword::split-string (cdr token) 'comment)
+ (eword-encode-split-string (cdr token) 'comment)
(list (list ")" nil nil))
))
)
)
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))
(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.
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)
(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
;;;
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."
(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
;;;
"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.")
"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"
(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)
((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)
((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
;;; Code:
(defconst mime-library-version-string
- "FLAM-DOODLE 1.9.1 - \"\e$B2+C0\e(B\" 10R5.5/14.0")
+ "FLAM-DOODLE 1.9.2 - \"\e$B??Hl\e(B\" 10R6.0/11.0")
;;; @ variables
))))
(put 'mm-define-method 'lisp-indent-function 'defun)
+(put 'mm-define-method 'edebug-form-spec
+ '(&define name ((arg symbolp) &rest arg) def-body))
;;; @ end
<h2> Entity representations and implementations
<node> mm-backend
<p>
-Entity \e$B$OCj>]2=$5$l$?%G!<%?I=8=$G!"<B:]$N%G!<%?I=8=$H$7$F$OMQES$K1~$8$F\e(B
-\e$B$5$^$6$^$J$b$N$,MxMQ$G$-$k$h$&$K@_7W$5$l$F$$$^$9!#\e(B
+Entity is an abstraction. It is designed to use various data
+representations for their purposes.
<p>
-\e$B$3$3$G!"\e(Bentity \e$B$,$I$&$$$&<oN`$NI=8=$r9T$C$F$$$k$+$r<($9$N$,\e(B
-<concept>representation-type</concept> \e$B$G!"\e(Bentity \e$B$r@8@.$9$k;~$K$O$3$l$r\e(B
-\e$B;XDj$7$^$9!#\e(B<cf node="Entity Creation">
+Each entity has <concept>representation-type</concept>. It must be
+specified when an entity is created. <cf node="Entity Creation">
<p>
\e$BA0@a$^$G$K=R$Y$FMh$?\e(B entity \e$B$KBP$9$k=hM}$O!"\e(Bentity \e$B$KBP$7$F$=$N=hM}$r0M\e(B
\e$BMj$9$k$3$H$K$h$C$F<B8=$5$l$F$$$^$9!#\e(BEntity \e$B$O<+J,$N\e(B
@cindex entity \e$B=hM}\e(B method
@cindex representation-type
-Entity \e$B$OCj>]2=$5$l$?%G!<%?I=8=$G!"<B:]$N%G!<%?I=8=$H$7$F$OMQES$K1~$8$F\e(B
-\e$B$5$^$6$^$J$b$N$,MxMQ$G$-$k$h$&$K@_7W$5$l$F$$$^$9!#\e(B@refill
+Entity is an abstraction. It is designed to use various data
+representations for their purposes.@refill
-\e$B$3$3$G!"\e(Bentity \e$B$,$I$&$$$&<oN`$NI=8=$r9T$C$F$$$k$+$r<($9$N$,\e(B
-@strong{representation-type} \e$B$G!"\e(Bentity \e$B$r@8@.$9$k;~$K$O$3$l$r;XDj$7$^$9!#\e(B
-(cf. @ref{Entity Creation}) @refill
+Each entity has @strong{representation-type}. It must be specified when
+an entity is created. (cf. @ref{Entity Creation}) @refill
\e$BA0@a$^$G$K=R$Y$FMh$?\e(B entity \e$B$KBP$9$k=hM}$O!"\e(Bentity \e$B$KBP$7$F$=$N=hM}$r0M\e(B
\e$BMj$9$k$3$H$K$h$C$F<B8=$5$l$F$$$^$9!#\e(BEntity \e$B$O<+J,$N\e(B representation-type
(mm-define-method write-entity ((entity buffer) filename)
(save-excursion
(set-buffer (mime-entity-buffer-internal entity))
- (write-region-as-binary (mime-entity-header-start-internal entity)
- (mime-entity-body-end-internal entity)
- filename)
+ (write-region-as-raw-text-CRLF (mime-entity-header-start-internal entity)
+ (mime-entity-body-end-internal entity)
+ filename)
))
(mm-define-method write-entity-body ((entity buffer) filename)