+2000-12-22 Keiichi Suzuki <keiichi@mdcnet.co.jp>
+
+ * mel-q.el: Require `poem' for `string-to-char-list' when
+ compiling.
+
+2000-12-22 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * eword-decode.el (eword-decode-header): Revert to obsolete alias.
+
+2000-12-22 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mmgeneric.el: Add comment for eword-decode.
+
+2000-12-21 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mailcap.el: Require `poe' for `define-obsolete-function-alias'.
+
+2000-12-21 Daiki Ueno <ueno@unixuser.org>
+
+ * smtp.el (smtp-send-buffer): Add DOC.
+ (smtp-via-smtp): Add DOC.
+
+ * FLIM-API.en (QMTP): Remove section.
+ (smtp-send-buffer): Add description.
+ (smtp-via-smtp): Likewise.
+
+\f
+2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * FLIM: Version 1.14.0 (Ninokuchi) released.
+
+ * mime.el (mime-entity-media-type): Add DOC.
+ (mime-entity-media-subtype): Add DOC.
+ (mime-entity-parameters): Add DOC.
+ (mime-entity-type/subtype): Add DOC.
+
+ * FLIM-API.en: Add some usages.
+ (mime-entity-media-type): New description.
+ (mime-entity-media-subtype): Likewise.
+ (mime-entity-type/subtype): Likewise.
+ (mime-entity-parameters): Likewise.
+
+2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * eword-encode.el (eword-encode-text): Specify `mode' of
+ `encoded-text-encode-string'.
+
+ * mel.el (encoded-text-encode-string): Add optional argument
+ `mode'; use `base64-encode-string' directly for "B"-encoding.
+
+2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * FLIM-API.en: Renamed from FLIM-1.14-API.en; reordered and add
+ some sections.
+
+ * mime.el (mime-entity-set-content-type): Add DOC.
+ (mime-entity-set-encoding): Add DOC.
+
+ * mime-def.el (mime-content-type-subtype): Fix DOC.
+ (mime-content-type-parameters): Fix DOC.
+
+2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * FLIM-1.14-API.en: New file.
+
+ * smtp.el (smtp-open-connection-function): Add autoload cookie.
+
+ * qmtp.el (qmtp-open-connection-function): Add autoload cookie.
+
+ * mime.el (mime-entity-children): Add DOC.
+ (mime-entity-node-id): Add DOC.
+ (mime-entity-content-type): Add DOC.
+ (mime-entity-content-disposition): Add DOC.
+ (mime-entity-encoding): Add DOC.
+
+2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime.el (mime-encode-field-body): Add autoload setting.
+
+ * eword-encode.el (mime-encode-field-body): Renamed from
+ `eword-encode-field-body'; declare `eword-encode-field-body' as
+ obsolete alias.
+ (mime-encode-header-in-buffer): Use `mime-encode-field-body'
+ instead of `eword-encode-field-body'.
+
+2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime.el (mime-encode-header-in-buffer): Renamed from
+ `eword-encode-header'.
+
+ * mmdbuffer.el: Deleted.
+
+ * mime-def.el (mime-header): New group.
+ (mime-field-decoding-max-size): New user option [moved from
+ eword-decode.el].
+ (mime-field-encoding-method-alist): New user option [moved from
+ eword-encode.el].
+
+ * eword-encode.el (eword-field-encoding-method-alist): Moved to
+ mime-def.el and renamed to `mime-field-encoding-method-alist'.
+ (mime-header-charset-encoding-alist): Renamed from
+ `eword-charset-encoding-alist'.
+ (mime-header-default-charset-encoding): New variable.
+ (ew-find-charset-rule): Use
+ `mime-header-default-charset-encoding'.
+ (eword-in-subject-p): Declare as obsolete function.
+ (mime-encode-header-in-buffer): Renamed from
+ `eword-encode-header'; declare `eword-encode-header' as obsolete
+ alias.
+
+ * eword-decode.el (eword-max-size-to-decode): Moved to mime-def.el
+ and renamed to `mime-field-decoding-max-size'.
+ (mime-header-lexical-analyzer): Renamed from
+ `eword-lexical-analyzer'; switch to variable.
+
+ * FLIM-ELS (flim-modules): Add `raw-io'.
+
+2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * eword-encode.el (eword-encode-default-start-column): Switch to
+ variable.
+
+2000-12-19 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * raw-io.el (start-process): New function.
+ (binary-start-process-shell-command): New function.
+
+2000-12-17 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mel-g.el (gzip64-external-encode-region): Don't use
+ `as-binary-process'; comment out code to regularize line break
+ code for OS/2 [if it is needed, it is better to implement by
+ coding-system].
+ (gzip64-external-decode-region): Don't use `as-binary-process'.
+ (mime-write-decoded-region): Likewise.
+
+ * mime-parse.el: Require `luna'.
+
+2000-12-16 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * eword-encode.el (eword-encode-divide-into-charset-words): Use
+ `aref' instead of `sref'.
+ (ew-encode-rword-1): Use `1+' instead of `char-next-index'.
+ (eword-encode-phrase-to-rword-list): Use `find-charset-string'
+ instead of `find-non-ascii-charset-string'.
+ (eword-encode-addr-seq-to-rword-list): Don't use `butlast'.
+ (eword-encode-header): Use `find-charset-region' instead of
+ `find-non-ascii-charset-string'.
+
+ * mel.el: Require `raw-io'.
+
+ * mime-def.el (binary-insert-file-contents): Moved to raw-io.el.
+ (binary-write-region): Likewise.
+
+ * mmbabyl.el (mime-write-entity): Use `raw-message-write-region'
+ instead of `write-region-as-raw-text-CRLF'.
+
+ * raw-io.el: New file.
+
+ * smtpmail.el: - Require `raw-io'.
+ - Delete definition of obsolete variable aliases for XEmacs.
+ (smtpmail-send-queued-mail): Use `binary-find-file-noselect'
+ instead of `find-file-noselect-as-binary'.
+
+ * smtp.el (smtp-open-connection-function): Use
+ `binary-open-network-stream' instead of `open-network-stream' as
+ initial value.
+ (smtp-open-connection): Don't guard as `binary'.
+
+ * qmtp.el (qmtp-open-connection-function): Use
+ `binary-open-network-stream' instead of `open-network-stream' as
+ initial value.
+ (qmtp-send-buffer): Don't guard as `binary'.
+
+2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime/eword-decode.el: Don't use
+ `define-obsolete-function-alias'; so `eword-decode-header' is
+ deleted.
+
+ * mime/mmexternal.el: Don't require `pces'.
+
+2000-12-15 TAKAHASHI Kaoru <kaoru@kaisei.org>
+
+ * Makefile (tar): Use `cvs tag -R' instead of `cvs tag -RF'.
+
+2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime-def.el (char-int): New alias.
+
+ * eword-encode.el (eword-encode-divide-into-charset-words): Don't
+ use `char-length' and `char-next-index'.
+
+2000-12-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * eword-decode.el: Fix typo in doc-string of
+ `mime-set-field-decoder'.
+
+2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mel.el: Don't require `path-util'.
+
+2000-12-15 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * std11.el, smtpmail.el, mime-def.el: Don't require `poe'.
+
+ * mel.el: Don't require `poem'.
+
+2000-12-14 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mmexternal.el (mime-write-entity): Don't use
+ `write-region-as-raw-text-CRLF'.
+ (mmexternal-require-buffer): Use `binary-insert-file-contents'
+ instead of `insert-file-contents-as-binary'.
+ (mime-write-entity-body): Use `binary-write-region' instead of
+ `write-region-as-binary'.
+
+ * smtpmail.el (smtpmail-send-it): Use `binary-write-region'
+ instead of `write-region-as-binary'.
+
+ * smtp.el (smtp-open-connection): Don't use `as-binary-process'.
+
+ * mel.el (mime-insert-encoded-file of "base64"): Use
+ `binary-insert-file-contents' instead of
+ `insert-file-contents-as-binary'.
+ (mime-insert-encoded-file of "7bit"): Use
+ `binary-insert-file-contents' instead of
+ `insert-file-contents-as-binary'.
+ (mime-write-decoded-region of "7bit"): Use `binary-write-region'
+ instead of `write-region-as-binary'.
+
+ * mmbuffer.el (mime-write-entity-body): Use `binary-write-region'
+ instead of `write-region-as-binary'.
+ (mime-write-entity): Don't use `write-region-as-raw-text-CRLF'.
+
+ * mime-def.el: Don't require `poem'.
+ (binary-insert-file-contents): New function.
+ (binary-write-region): New function.
+
+ * mel-u.el (uuencode-external-encode-region): Don't use
+ `as-binary-process'.
+ (uuencode-external-decode-region): Don't use `as-binary-process'
+ and `as-binary-input-file'.
+ (mime-write-decoded-region): Don't use `as-binary-process'.
+
+ * mel-q-ccl.el (quoted-printable-ccl-insert-encoded-file): Don't
+ use `insert-file-contents-as-coding-system'.
+ (quoted-printable-ccl-write-decoded-region): Don't use
+ `write-region-as-coding-system'.
+
+ * mel-b-ccl.el (base64-ccl-insert-encoded-file): Don't use
+ `insert-file-contents-as-coding-system'.
+ (base64-ccl-write-decoded-region): Don't use
+ `write-region-as-coding-system'.
+
+ * std11.el: Don't require `poem'.
+ (std11-parse-ascii-token): Don't use
+ `find-non-ascii-charset-string'.
+
+ * qmtp.el: Don't require `poem'.
+ (qmtp-send-buffer): Don't use `as-binary-process'.
+
+2000-12-14 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime-def.el, qmtp.el, smtp.el, smtpmail.el, std11.el: Require
+ `custom' instead of `pcustom'.
+
+2000-12-12 Daiki Ueno <ueno@unixuser.org>
+
+ * sasl.el: Rewrite with luna.
+
+2000-12-06 Daiki Ueno <ueno@unixuser.org>
+
+ * FLIM-ELS: Don't install md5-dl.el, md5-el.el, sha1-dl.el and
+ sha1-el.el if the running emacs has builtin message digest
+ functions.
+
+ * md5-dl.el, sha1-dl.el: Don't bind `dynamic-link' and
+ `dynamic-call'.
+
+ * md5.el (md5-dl-module): Moved from md5-dl.el.
+ * sha1.el: Don't bind `sha1-string'.
+
+2000-12-04 Daiki Ueno <ueno@unixuser.org>
+
+ * README.ja, README.en (load-path): Remove section.
+ (What's FLIM): Specify prerequisite version of Emacsen.
+
+2000-11-21 Daiki Ueno <ueno@unixuser.org>
+
+ * sasl.el (sasl-client-set-encoder): New function.
+ (sasl-client-set-decoder): New function.
+ (sasl-client-encoder): New function.
+ (sasl-client-decoder): New function.
+
+ * sasl-digest.el: Require 'cl' when compiling.
+ (sasl-digest-md5-signing-encode-magic): New constant.
+ (sasl-digest-md5-signing-decode-magic): New constant.
+ (sasl-digest-md5-htonl-string): New function.
+ (sasl-digest-md5-make-integrity-encoder): New function.
+ (sasl-digest-md5-make-integrity-decoder): New function.
+ (sasl-digest-md5-ha1): New function.
+ (sasl-digest-md5-response-value): Accept the 1st argument `ha1'.
+ (sasl-digest-md5-response): Use `sasl-digest-md5-ha1'.
+ - Set integrity encoder and decoder of the client.
+
+ * smtp.el: Require `luna'.
+ (smtp-read-response): Accept `smtp-connection' object rather than
+ process-object.
+ (smtp-send-command): Likewise.
+ (smtp-send-data): Likewise.
+
+2000-11-10 Daiki Ueno <ueno@unixuser.org>
+
+ * tests/test-sasl.el (test-sasl-digest-md5-imap): New testcase.
+ (test-sasl-digest-md5-acap): New testcase.
+
+2000-11-10 Daiki Ueno <ueno@unixuser.org>
+
+ * lunit.el (lunit-make-test-suite-from-class): New function.
+ (lunit-class): Abolish.
+ (lunit-test-results-buffer): Abolish.
+
+ * FLIM-ELS (check-flim): New function.
+
+ * Makefile (check): New target.
+
+ * tests: New directory.
+
+2000-11-09 Daiki Ueno <ueno@unixuser.org>
+
+ * lunit.el (lunit-test-method-regexp): New variable.
+ (lunit-class): New function.
+
+2000-11-09 Daiki Ueno <ueno@unixuser.org>
+
+ * lunit.el: New file.
+
+2000-12-13 Kenichi Handa <handa@etl.go.jp>
+
+ * luna.el: Fix and add DOCs and comments; fix coding style.
+
+2000-12-09 MORIOKA Tomohiko <tomo@m17n.org>
+
+ * mmbuffer.el (mmbuffer-parse-multipart): Add new optional
+ argument `representation-type'.
+ (mmbuffer-parse-encapsulated): Likewise.
+
+2000-12-07 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mmexternal.el: Must require `mmgeneric'.
+
+ * sha1.el: Don't use `defun-maybe'.
+
+2000-12-04 Daiki Ueno <ueno@unixuser.org>
+
+ * luna.el (luna-class-find-functions): Don't quote colon keywords.
+ (luna-send): Ditto.
+ (luna-call-next-method): Ditto.
+
+2000-11-28 Daiki Ueno <ueno@unixuser.org>
+
+ * luna.el: Don't require `static'.
+ (luna-define-class-function): Don't bind colon keywords.
+ (luna-class-find-functions): Quote colon keywords.
+ (luna-send): Likewise.
+ (luna-call-next-method): Likewise.
+
+2000-11-12 Daiki Ueno <ueno@unixuser.org>
+
+ * luna.el (luna-define-method): Clear method cache.
+ (luna-apply-generic): New function.
+ (luna-define-generic): Use `luna-apply-generic' instead of
+ `luna-send'.
+
2000-12-04 Daiki Ueno <ueno@unixuser.org>
* smtpmail.el (smtpmail-send-it): Use `smtp-send-buffer' instead of
2000-11-24 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
- * FLIM-MK (compile-flim): Compile `flim-version-specific-modules'.
- (install-flim): Install `flim-version-specific-modules' to
- `FLIM_VERSION_SPECIFIC_DIR'.
- (compile-flim-package): Compile `flim-version-specific-modules'.
- (install-flim-package): Install `flim-version-specific-modules'.
-
- * FLIM-ELS (flim-modules): Add `mime-conf' instead of `mailcap'.
- (flim-version-specific-modules): New variable; specify `mailcap'.
-
- * FLIM-CFG (FLIM_VERSION_SPECIFIC_DIR): New variable.
-
- * mailcap.el: Completely rewrote to use mime-conf.el.
-
- * mime-conf.el: New file.
+ * FLIM-MK (compile-flim): Compile `flim-version-specific-modules'.
+ (install-flim): Install `flim-version-specific-modules' to
+ `FLIM_VERSION_SPECIFIC_DIR'.
+ (compile-flim-package): Compile `flim-version-specific-modules'.
+ (install-flim-package): Install `flim-version-specific-modules'.
-2000-11-26 Kenichi OKADA <okada@opaopa.org>
+ * FLIM-ELS (flim-modules): Add `mime-conf' instead of `mailcap'.
+ (flim-version-specific-modules): New variable; specify `mailcap'.
- * SLIM: Version 1.14.4 released.
- * mime-def.el (mime-library-product): Up.
- * SLIM-VERSION: Added.
+ * FLIM-CFG (FLIM_VERSION_SPECIFIC_DIR): New variable.
-2000-11-22 Kenichi OKADA <okada@opaopa.org>
+ * mailcap.el: Completely rewrote to use mime-conf.el.
- * smtp.el (smtp-primitive-starttls): Call `smtp-primitive-helo'
- after `starttls-negotiate'.
+ * mime-conf.el: New file.
-2000-11-20 Kenichi OKADA <okada@opaopa.org>
+2000-11-16 Kenichi OKADA <okada@opaopa.org>
* sasl-digest.el (sasl-digest-md5-response): Fix typo.
-2000-11-20 Kenichi OKADA <okada@opaopa.org>
+2000-11-12 Daiki Ueno <ueno@unixuser.org>
- * FLIM-ELS (flim-modules): Add `sasl-cram', `sasl-digest' , `qmtp'.
- Remove `digest-md5'.
- * sasl.el: sync up with flim-1_14.
- * smtp.el: sync up with flim-1_14.
- * qmtp.el: New file.
- * sasl-cram.el: New file.
- * sasl-digest.el: New file.
- * digest-md5.el: Delete.
+ * smtp.el (smtp-primitive-data): Use `beginning-of-line' instead of
+ `forward-char'.
+ (smtp-read-response): Don't bind `case-fold-search'.
+ (smtp-send-data): Don't save excursion.
-\f
-2000-10-20 Kenichi OKADA <okada@opaopa.org>
+2000-11-10 Daiki Ueno <ueno@unixuser.org>
- * SLIM: Version 1.14.3 released.
+ * sasl-digest.el (sasl-digest-md5-challenge): Abolish.
+ (sasl-digest-md5-syntax-table): Rename from
+ `sasl-digest-md5-parse-digest-challenge-syntax-table'.
+ (sasl-digest-md5-parse-string): Rename from
+ `sasl-digest-md5-parse-digest-challenge'; only return a property
+ list.
+ (sasl-digest-md5-challenge): Abolish.
+ (sasl-digest-md5-build-response-value-1): Abolish.
+ (sasl-digest-md5-response-value): Define as function.
+ (sasl-digest-md5-response): Rewrite.
-2000-09-21 Kenichi OKADA <okada@opaopa.org>
+2000-11-07 Kenichi OKADA <okada@opaopa.org>
- * smtp.el (smtp-via-smtp): Cause an error if `smtp-notify-success'
- is not available.
+ * sasl.el (sasl-login-response-1): Fix.
+ (sasl-login-response-2): Fix.
-2000-09-18 KUSANO Takayuki <AE5T-KSN@asahi-net.or.jp>
+2000-11-07 Daiki Ueno <ueno@unixuser.org>
- * smtp.el (smtp-via-smtp): Check `service extensions' for DSN.
+ * smtp.el (smtp-sasl-properties): New user option.
+ (smtp-sasl-user-realm): Abolish.
-2000-09-21 Kenichi OKADA <okada@opaopa.org>
+2000-11-05 Daiki Ueno <ueno@unixuser.org>
- * mime-def.el (mime-library-product): Up.
- * SLIM-VERSION: Up.
+ * qmtp.el (qmtp-send-package): Don't check "K" reply per recipient.
+ (qmtp-via-smtp): Mark as obsolete.
+ (qmtp-send-buffer): New function.
-\f
-2000-09-16 Kenichi OKADA <okada@opaopa.org>
+ * sasl.texi: New file.
- * SLIM: Version 1.14.2 released.
+2000-11-05 Daiki Ueno <ueno@unixuser.org>
-2000-08-28 Yuuichi Teranishi <teranisi@gohome.org>
+ * sasl.el (sasl-step-data): New function.
+ (sasl-step-set-data): New function.
- * eword-encode.el (eword-encode-mailboxes-to-rword-list):
- New inline function.
- (eword-encode-address-to-rword-list): Ditto.
- (eword-encode-addresses-to-rword-list):
- Use `eword-encode-address-to-rword-list' instead of
- `eword-encode-mailbox-to-rword-list'.
+2000-11-04 Daiki Ueno <ueno@unixuser.org>
- * std11.el (std11-address-string): Fix for group list.
+ * sasl.el: Don't require 'poe'
+ - Rename `sasl-*instantiator*' to `sasl-*client*'.
+ - Rename `sasl-*authenticator*' to `sasl-*mechanism*'.
+ - Rename `sasl-*continuations*' to `sasl-*steps*'.
+ (sasl-make-client): Accept 1st argument `mechanism'.
+ (sasl-next-step): Rename from `sasl-evaluate-challenge'.
-2000-08-23 Kenichi OKADA <okada@opaopa.org>
+2000-11-04 Daiki Ueno <ueno@unixuser.org>
- * smtp.el (smtp-fqdn): New variable.
- (smtp-make-fqdn): Use `smtp-fqdn' if non-nil.
+ * sasl.el (sasl-make-instantiator): Define as function.
+ (sasl-instantiator-name): Ditto.
+ (sasl-instantiator-service): Ditto.
+ (sasl-instantiator-server): Ditto.
+ (sasl-instantiator-set-properties): Ditto.
+ (sasl-instantiator-set-property): Ditto.
+ (sasl-instantiator-property): Ditto.
+ (sasl-instantiator-properties): Ditto.
+ (sasl-authenticator-mechanism): Ditto.
+ (sasl-authenticator-continuations): Ditto.
-2000-08-23 Kenichi OKADA <okada@opaopa.org>
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
- * mime-def.el (mime-library-product): Up.
- * SLIM-VERSION: Up.
+ * sasl.el: Rename `sasl-*principal*' to `sasl-*instantiator*'.
+ (sasl-make-instantiator): Abolish optional 4th argument.
+ (sasl-instantiator-set-properties): New function.
+ (sasl-instantiator-put-property): New function.
+ (sasl-instantiator-property): New function.
+ (sasl-instantiator-properties): New function.
-\f
-2000-08-12 Kenichi OKADA <okada@opaopa.org>
+ * smtp.el (smtp-sasl-user-name): Rename from
+ `smtp-sasl-principal-user'.
+ (smtp-sasl-user-realm): Rename from `smtp-sasl-principal-realm'.
- * SLIM: Version 1.14.1 released.
- SLIM-TIPS: Update.
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
-2000-08-12 Kenichi OKADA <okada@opaopa.org>
+ * sasl.el (sasl-mechanisms): Add `LOGIN' and `ANONYMOUS'.
+ (sasl-mechanism-alist): Likewise.
+ (sasl-error): Define.
+ (sasl-login-continuations): New variable.
+ (sasl-login-response-1): New function.
+ (sasl-login-response-2): New function.
+ (sasl-anonymous-continuations): New variable.
+ (sasl-anonymous-response): New function.
- * starttls.el (starttls-open-stream): Put `starttls-extra-args' on
- the last arg.
+ * smtp.el (smtp-error): Define.
+ (smtp-via-smtp): Use it.
-2000-08-11 Kenichi OKADA <okada@opaopa.org>
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
- * starttls.el (starttls-open-ssl-stream): New function.
- (starttls-open-stream): Move `starttls-extra-args'.
+ * smtp.el (smtp-via-smtp): Mark as obsolete.
+ (smtp-send-buffer): Rename from `smtp-via-smtp'.
-2000-07-12 Kenichi OKADA <okada@opaopa.org>
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
- * mime-def.el (mime-library-product): Up.
+ * sasl.el (sasl-make-authenticator): Allocate a freshly generated
+ symbol for each continuation.
-\f
-2000-07-12 Kenichi OKADA <okada@opaopa.org>
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
- * SLIM: Version 1.14.0 released.
- (Sync with FLIM-Chao 1.14.1).
+ * sasl-digest.el (sasl-digest-md5-response-1): Rename from
+ `sasl-digest-md5-digest-response'.
+ (sasl-digest-md5-response-2): New alias.
+ (sasl-digest-md5-parse-digest-challenge): Save excursion.
-2000-07-12 Kenichi OKADA <okada@opaopa.org>
+ * sasl.el (sasl-mechanism-alist): Rename from `sasl-mechanisms'.
+ (sasl-mechanisms): New variable.
+ (sasl-find-authenticator): Check `sasl-mechanisms' rather than
+ `sasl-mechanism-alist'.
- * md5-dl.el (TopLevel): Define-maybe
- `md5-string', `dynamic-link' and `dynamic-call'.
- * sha1-dl.el (TopLevel): Define-maybe `dynamic-link' and `dynamic-call'.
- * md5-el.el (TopLevel): Provide `md5-el' instead of `md5'.
- * md5.el (TopLevel): Require `md5-el' and `md5-dl'.
+ * smtp.el (smtp-submit-package): Use `smtp-primitive-ehlo'.
+ (smtp-primitive-auth): Check authenticator.
-2000-07-10 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+2000-11-02 Daiki Ueno <ueno@unixuser.org>
- * mmexternal.el (initialize-instance): Deleted.
- (mmexternal-require-file-name): New function.
- (mmexternal-require-buffer): Use `mmexternal-require-file-name'.
+ * FLIM-ELS (hmac-modules): New variable.
+ (flim-modules): Move HMAC modules to `hmac-modules'
+ - Add `sasl-digest'.
-2000-06-30 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+ * smtp.el (smtp-sasl-principal-realm): New user option.
- * mime.el (mime-entity-read-field): Fix a bug when FIELD-NAME is a
- string.
+ * sasl.el (sasl-plain-response): New function.
+ (sasl-mechanisms): Add `DIGEST-MD5' and `PLAIN'.
+ (sasl-unique-id-function): New variable.
+ (sasl-plain-continuations): New variable.
+ (sasl-unique-id): New function.
+ (sasl-unique-id-char): New variable.
-2000-06-27 Kenichi OKADA <okada@opaopa.org>
+ * sasl-digest.el: New file.
- * smtp.el (smtp-via-smtp): additional HELO for sendmail warning.
+2000-11-01 Daiki Ueno <ueno@unixuser.org>
-2000-06-25 Kenichi OKADA <okada@opaopa.org>
+ * smtp.el: Bind `sasl-mechanisms'; add autoload settings for
+ `sasl-make-principal', `sasl-find-authenticator',
+ `sasl-authenticator-mechanism-internal' and
+ `sasl-evaluate-challenge'.
+ (smtp-use-sasl): New user option.
+ (smtp-sasl-principal-name): New user option.
+ (smtp-sasl-mechanisms): New user option.
+ (smtp-submit-package): Call `smtp-primitive-starttls' and
+ `smtp-primitive-auth'.
+ (smtp-primitive-ehlo): Don't modify the rest of a extension line.
+ (smtp-primitive-auth): New function.
+ (smtp-primitive-starttls): Check the response code.
- * SLIM-VERION: Add code name.
+ * sasl.el: New implementation.
-2000-06-24 Kenichi OKADA <okada@opaopa.org>
+ * sasl-cram.el: New file.
- * mime-def.el (mime-library-product): Fix.
+ * FLIM-ELS (flim-modules): Add `md5', `md5-el', `md5-dl',
+ `hex-util', `hmac-def', `hmac-md5', `sasl' and `sasl-cram'.
-2000-06-24 Kenichi OKADA <okada@opaopa.org>
+2000-11-01 Daiki Ueno <ueno@unixuser.org>
- * mime-def.el (mime-library-product): Up.
+ * smtp.el: Add autoload settings for `starttls-open-stream' and
+ `starttls-negotiate'.
+ (smtp-connection-set-extensions-internal): New macro.
+ (smtp-connection-extensions-internal): New macro.
+ (smtp-make-connection): Set the `extension' slot to nil.
+ (smtp-primitive-ehlo): New function.
+ (smtp-submit-package): Rename from `smtp-commit'.
+ (smtp-submit-package-function): Rename from `smtp-commit-function'.
+ (smtp-primitive-starttls): New function.
+ (smtp-extensions): New group.
+ (smtp-use-8bitmime): New variable.
+ (smtp-use-size): New variable.
+ (smtp-use-starttls): New variable.
+ (smtp-via-smtp): Bind `smtp-open-connection-function'.
+
+2000-10-31 Daiki Ueno <ueno@unixuser.org>
+
+ * smtp.el: New implementation.
+
+2000-08-16 Daiki Ueno <ueno@unixuser.org>
+
+ * FLIM-ELS (flim-modules): Add `qmtp'.
+
+ * qmtp.el: New file.
+
+2000-08-28 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * eword-encode.el (eword-encode-mailboxes-to-rword-list):
+ New inline function.
+ (eword-encode-address-to-rword-list): Ditto.
+ (eword-encode-addresses-to-rword-list):
+ Use `eword-encode-address-to-rword-list' instead of
+ `eword-encode-mailbox-to-rword-list'.
+
+ * std11.el (std11-address-string): Fix for group list.
+
+2000-08-10 MORIOKA Tomohiko <tomo@m17n.org>
+
+ * mmgeneric.el: Enclose definition of class `mime-entity' and its
+ internal accessors by `eval-and-compile'.
+
+ * luna.el: Define `luna-class-name' before it is used in macros.
+
+\f
+2000-07-12 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * FLIM-Chao: Version 1.14.1 (Rokujiz\e-Dò)\e-A released.
+
+2000-07-10 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mmexternal.el (initialize-instance): Deleted.
+ (mmexternal-require-file-name): New function.
+ (mmexternal-require-buffer): Use `mmexternal-require-file-name'.
+
+2000-06-30 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * mime.el (mime-entity-read-field): Fix a bug when FIELD-NAME is a
+ string.
2000-06-23 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
\f
1999-05-31 MORIOKA Tomohiko <tomo@m17n.org>
- * FLIM: Version 1.12.7 (Y\e-D\ e~\ fzaki) released.
+ * FLIM: Version 1.12.7 (Y\e-Dþzaki)\e-A released.
1999-05-31 MORIOKA Tomohiko <tomo@m17n.org>
\f
1999-05-11 MORIOKA Tomohiko <tomo@m17n.org>
- * FLIM: Version 1.12.6 (Family-K\e-D\ er\ fenmae) released.
+ * FLIM: Version 1.12.6 (Family-K\e-Dòenmae)\e-A released.
1999-04-27 Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
\f
1999-01-23 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.3 (Kintetsu-K\e-D\ er\ friyama) released.
+ * FLIM: Version 1.12.3 (Kintetsu-K\e-Dòriyama)\e-A released.
1999-01-23 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.2 (Kuj\e-D\ er\ f) released.
+ * FLIM: Version 1.12.2 (Kuj\e-Dò)\e-A released.
1999-01-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-12-02 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.1 (Nishinoky\e-D\ er\ f) released.
+ * FLIM: Version 1.12.1 (Nishinoky\e-Dò)\e-A released.
1998-11-30 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-10-26 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.11.2 (Heij\e-D\ er\ f) was released.
+ * FLIM: Version 1.11.2 (Heij\e-Dò)\e-A was released.
* NEWS (Abolish variable `mime-temp-directory'): New subsection.
\f
1998-10-12 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.10.4 (Shin-H\e-D\ er\ fsono) was released.
+ * FLIM: Version 1.10.4 (Shin-H\e-Dòsono)\e-A was released.
1998-10-12 Katsumi Yamaoka <yamaoka@jpl.org>
\f
1998-09-29 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.10.0 (K\e-D\ er\ fdo) was released.
+ * FLIM: Version 1.10.0 (K\e-Dòdo)\e-A was released.
* README.en (What's FLIM): Add mel-ccl.el.
\f
1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.9.1 (Tonosh\e-D\ er\ f) was released.
+ * FLIM: Version 1.9.1 (Tonosh\e-Dò)\e-A was released.
* mime-en.sgml (mm-backend): Translate a little.
\f
1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM-Chao: Version 1.8.0 (Shij\e-D\ er\ f) was released.
+ * FLIM-Chao: Version 1.8.0 (Shij\e-Dò)\e-A was released.
1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-07-01 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.8.0 (\e-D\ eR\ fkubo) was released.
+ * FLIM: Version 1.8.0 (\e-DÃ’kubo)\e-A was released.
* README.en: Delete `How to use'.
\f
1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM-Chao: Version 1.7.0 (Goj\e-D\ er\ f) was released.
+ * FLIM-Chao: Version 1.7.0 (Goj\e-Dò)\e-A was released.
1998-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.4.1 (Momoyama-Gory\e-D\ er\ fmae) was released.
+ * FLIM: Version 1.4.1 (Momoyama-Gory\e-Dòmae)\e-A was released.
1998-06-18 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.2.0 (J\e-D\ e~\ fj\ er\ f) was released.
+ * FLIM: Version 1.2.0 (J\e-Dþjò)\e-A was released.
* README.en (What's FLIM): Delete description about
std11-parse.el; add description about mailcap.el.
\f
1998-05-05 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.1.0 (T\e-D\ er\ fji) was released.
+ * FLIM: Version 1.1.0 (T\e-Dòji)\e-A was released.
1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.0.1 (Ky\e-D\ er\ fto) was released.
+ * FLIM: Version 1.0.1 (Ky\e-Dòto)\e-A was released.
* mime-def.el (mime-spadework-module-version-string): New
constant.
--- /dev/null
+ FLIM (Faithful Library about Internet Message) API
+ Version 1.14
+ Draft Release 1
+
+* Notation
+
+Each function is described by following notation:
+
+[Function] NAME-OF-FUNCTION (SIGNATURE)
+ DESCRIPTIONS
+ [ILEVEL]<ULEVEL>
+
+Each inline function is described by following notation:
+
+[Inline function] NAME-OF-FUNCTION (SIGNATURE)
+ DESCRIPTIONS
+ [ILEVEL]<ULEVEL>
+
+Each macro is described by following notation:
+
+[Macro] NAME-OF-MACRO (SIGNATURE)
+ DESCRIPTIONS
+ [ILEVEL]<ULEVEL>
+
+Each variable is described by following notation:
+
+[Variable] NAME-OF-VARIABLE
+ DESCRIPTIONS
+ [ILEVEL]<ULEVEL>
+
+ILEVEL specifies implementation level:
+
+ Required: Must implement
+ Suggest: Should implement
+ Optional: Optional
+
+ULEVEL specifies implementation level:
+
+ Suggest: Should use
+ Not Suggest: Should not use
+ Obsolete: Should not use (historical)
+
+
+* MIME entity
+
+** How to use
+
+(require 'mime)
+
+
+** MIME-Entity Creation
+
+[Function] mime-open-entity (type location)
+ Open an entity and return it.
+
+ TYPE is representation-type.
+
+ LOCATION is location of entity. Specification of it is depended on
+ representation-type.
+
+ [Required]<Suggest>
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-parse-buffer (&optional buffer representation-type)
+ Parse BUFFER as a MIME message.
+
+ If buffer is omitted, it parses current-buffer.
+
+ [Optional]<Not Suggest>
+
+
+** MIME-Entity Hierarchy
+
+[Function] mime-entity-children (entity)
+ Return list of entities included in the ENTITY.
+
+ [Required]<Suggest>
+ (Usage: SEMI 1.14 MIME-View, MIME-PGP)
+
+
+[Function] mime-entity-parent (entity &optional message)
+ Return mother entity of ENTITY.
+
+ If MESSAGE is specified, it is regarded as root entity.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View, MIME-PGP)
+
+
+[Function] mime-find-root-entity (entity)
+ Return root entity of ENTITY.
+
+ [Suggest]
+
+
+[Function] mime-root-entity-p (entity &optional message)
+ Return t if ENTITY is root-entity (message).
+
+ If MESSAGE is specified, it is regarded as root entity.
+
+ [Suggest]<Suggest>
+
+
+[Function] mime-entity-node-id (entity)
+ Return node-id of ENTITY.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View, MIME-PGP)
+
+
+[Function] mime-entity-number (entity)
+ Return entity-number of ENTITY.
+
+ [Optional]
+ (Usage: SEMI 1.14 MIME-View, MIME-PGP)
+
+
+** MIME-Entity Search
+
+[Function] mime-find-entity-from-node-id (entity-node-id message)
+ Return entity from ENTITY-NODE-ID in MESSAGE.
+
+ [Suggest]
+
+
+[Function] mime-find-entity-from-number (entity-number message)
+ Return entity from ENTITY-NUMBER in MESSAGE.
+
+ [Optional]
+
+
+[Function] mime-find-entity-from-content-id (cid message)
+ Return entity from CID in MESSAGE.
+
+ [Suggest]<Suggest>
+
+
+** MIME-Entity Attributes
+
+[Function] mime-entity-content-type (entity)
+ Return content-type of ENTITY.
+
+ (cf. <** Content-Type>)
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Inline function] mime-entity-media-type (entity)
+ Return primary media-type of ENTITY.
+
+ [Suggest]<Not Suggest>
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Inline function] mime-entity-media-subtype (entity)
+ Return media-subtype of ENTITY.
+
+ [Suggest]<Not Suggest>
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Inline function] mime-entity-type/subtype (entity)
+ Return media-type/subtype of ENTITY.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-W3)
+
+
+[Inline function] mime-entity-parameters (entity)
+ Return parameters of Content-Type of ENTITY.
+
+ [Suggest]<Not Suggest>
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-set-content-type (entity content-type)
+ Set ENTITY's content-type to CONTENT-TYPE.
+
+ (cf. <** Content-Type>)
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-content-disposition (entity)
+ Return content-disposition of ENTITY.
+
+ (cf. <** Content-Disposition>)
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-filename (entity)
+ Return filename of ENTITY.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-encoding (entity &optional default-encoding)
+ Return content-transfer-encoding of ENTITY.
+
+ If the ENTITY does not have Content-Transfer-Encoding field, this
+ function returns DEFAULT-ENCODING. If it is nil, "7bit" is used as
+ default value.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-set-encoding (entity encoding)
+ Set ENTITY's content-transfer-encoding to ENCODING.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+[Function] mime-entity-cooked-p (entity)
+ Return non-nil if contents of ENTITY has been already
+ code-converted.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-PGP)
+
+
+[Function] mime-entity-name (entity)
+ Return unique name of the ENTITY.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View)
+
+
+** MIME-Entity Header
+
+[Function] mime-entity-fetch-field (entity field-name)
+ Return the value of the ENTITY's header field whose type is
+ FIELD-NAME.
+
+ The results is network representation.
+
+ If FIELD-NAME field is not found, this function returns nil.
+
+ [Required]<Suggest>
+ (Usage: SEMI 1.14 MIME-View, MIME-BBDB)
+
+
+[Function] mime-entity-read-field (entity field-name)
+ Parse FIELD-NAME field in header of ENTITY, and return the result.
+
+ Format of result is depended on kind of field. For non-structured
+ field, this function returns string. For structured field, it
+ returns list corresponding with structure of the field.
+
+ Strings in the result will be converted to internal representation
+ of Emacs.
+
+ If FIELD-NAME field is not found, this function returns nil.
+
+ [Suggest]
+ (Usage: SEMI 1.14 MIME-View, MIME-BBDB)
+
+
+** Text Presentation of MIME-Entity Content
+
+[Function] mime-insert-header (entity &optional invisible-fields
+ visible-fields)
+ Insert before point a decoded header of ENTITY.
+
+ INVISIBLE-FIELDS is list of regexps to match field-name to hide.
+ VISIBLE-FIELDS is list of regexps to match field-name to hide.
+
+ If a field-name is matched with some elements of INVISIBLE-FIELDS
+ and matched with none of VISIBLE-FIELDS, this function don't insert
+ the field.
+
+ Each encoded-word in the header is decoded. ``Raw non us-ascii
+ characters'' are also decoded as `default-mime-charset'.
+
+ [Suggest]
+
+
+[Function] mime-insert-text-content (entity)
+ Insert before point a contents of ENTITY as text entity.
+
+ Contents of the ENTITY are decoded as MIME charset. If the ENTITY
+ does not have charset parameter of Content-Type field,
+ `default-mime-charset' is used as default value.
+
+ [Required]
+
+
+[Variable] default-mime-charset
+ Symbol to indicate default value of MIME charset.
+
+ It is used when MIME charset is not specified.
+
+ It is originally variable of APEL.
+
+ [Required]
+
+
+** Bytes Representation of MIME-Entity Content
+
+[Function] mime-entity-content (entity)
+ Return content of ENTITY as byte sequence (string).
+
+ [Required]
+ (Usage: SEMI 1.14 MIME-View, Postpet)
+
+
+[Function] mime-insert-entity-content (entity)
+ Insert content of ENTITY (byte sequence) at point.
+
+ [Suggest]
+
+
+[Function] mime-write-entity-content (entity filename)
+ Write content of ENTITY (byte sequence) into FILENAME.
+
+ [Required]
+
+
+** Network Representation of MIME-Entity
+
+[Function] mime-entity-string (entity)
+ Return header and body of ENTITY (string).
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-insert-entity (entity)
+ Insert header and body of ENTITY at point.
+
+ [Required]
+
+
+[Function] mime-write-entity (entity filename)
+ Write header and body of ENTITY into FILENAME.
+
+ [Required]
+
+
+[Function] mime-entity-header (entity)
+ Return network representation of ENTITY header (string).
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-insert-entity-header (entity)
+ Insert network representation of ENTITY header at point.
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-write-entity-header (entity filename)
+ Write network representation of ENTITY header FILENAME.
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-entity-body (entity)
+ Return network representation of ENTITY body (string).
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-insert-entity-body (entity)
+ Insert network representation of ENTITY body at point.
+
+ [Required]
+
+
+[Function] mime-write-entity-body (entity filename)
+ Write body of ENTITY into FILENAME.
+
+ [Required]
+
+
+* MIME content information
+
+** How to use
+
+(require 'mime)
+
+
+** Content-Type
+
+[Function] mime-parse-Content-Type (string)
+ Parse STRING as field-body of Content-Type field, and
+ return the result as `mime-content-type' structure.
+
+ [Suggest]
+
+
+[Function] mime-read-Content-Type ()
+ Read field-body of Content-Type field from current-buffer,
+ and return the parsed result.
+
+ Format of return value is as same as `mime-parse-Content-Type'.
+
+ Return `nil' if Content-Type field is not found.
+
+ [Suggest]
+
+
+[Inline function] mime-content-type-primary-type (content-type)
+ Return primary-type of CONTENT-TYPE.
+
+ [Required]
+
+
+[Inline function] mime-content-type-subtype (content-type)
+ Return subtype of CONTENT-TYPE.
+
+ [Required]
+
+
+[Inline function] mime-content-type-parameter (content-type parameter)
+ Return PARAMETER value of CONTENT-TYPE.
+
+ [Required]
+
+
+[Inline function] mime-content-type-parameters (content-type)
+ Return parameters of CONTENT-TYPE.
+
+ [Suggest]
+
+
+[Inline function] mime-type/subtype-string (type &optional subtype)
+ Return type/subtype string from TYPE and SUBTYPE.
+
+ [Suggest]
+
+
+** Content-Disposition
+
+[Function] mime-parse-Content-Disposition (string)
+ Parse STRING as field-body of Content-Disposition field.
+
+ [Suggest]
+
+
+[Function] mime-read-Content-Disposition ()
+ Read field-body of Content-Disposition field from current-buffer,
+and return parsed it.
+
+ [Suggest]
+
+
+[Inline function] mime-content-disposition-type (content-disposition)
+ Return disposition-type of CONTENT-DISPOSITION.
+
+ [Required]
+
+
+[Inline function] mime-content-disposition-parameter
+ (content-disposition parameter)
+ Return PARAMETER value of CONTENT-DISPOSITION.
+
+ [Required]
+
+
+[Inline function] mime-content-disposition-filename (content-disposition)
+ Return filename of CONTENT-DISPOSITION.
+
+ [Suggest]<Suggest>
+
+
+[Inline function] mime-content-disposition-parameters (content-disposition)
+ Return disposition-parameters of CONTENT-DISPOSITION.
+
+ [Suggest]
+
+
+* encoded-word
+
+** How to use
+
+(require 'mime)
+
+
+** decoder
+
+[Function] mime-decode-header-in-buffer (&optional code-conversion
+ separator)
+ Decode MIME encoded-words in header fields.
+
+ If CODE-CONVERSION is nil, it decodes only encoded-words. If it is
+ mime-charset, it decodes non-ASCII bit patterns as the mime-charset.
+ Otherwise it decodes non-ASCII bit patterns as the
+ default-mime-charset.
+
+ If SEPARATOR is not nil, it is used as header separator.
+
+ [Suggest]
+
+
+[Function] [Function] eword-decode-header (&optional code-conversion
+ separator)
+ As same as `mime-decode-header-in-buffer', q.v.
+
+ Note that
+
+ (require 'eword-decode)
+
+ is necessary to use this function.
+
+ [Optional]<Obsolete> (Usage: cmail 2.61)
+
+
+[Function] mime-decode-header-in-region (start end
+ &optional code-conversion)
+ Decode MIME encoded-words in region between START and END.
+
+ If CODE-CONVERSION is nil, it decodes only encoded-words. If it is
+ mime-charset, it decodes non-ASCII bit patterns as the mime-charset.
+ Otherwise it decodes non-ASCII bit patterns as the
+ default-mime-charset.
+
+ [Suggest]
+
+
+[Function] mime-decode-field-body (field-body field-name
+ &optional mode max-column)
+ Decode FIELD-BODY as FIELD-NAME in MODE, and return the result.
+
+ Optional argument MODE must be `plain', `wide', `summary' or `nov'.
+ Default mode is `summary'.
+
+ If MODE is `wide' and MAX-COLUMN is non-nil, the result is folded
+ with MAX-COLUMN.
+
+ Non MIME encoded-word part in FILED-BODY is decoded with
+ `default-mime-charset'.
+
+ [Required]<Suggest>
+
+
+[Function] mime-set-field-decoder (field &rest specs)
+ Set decoder of FIELD.
+
+ SPECS must be like `MODE1 DECODER1 MODE2 DECODER2 ...'.
+
+ Each mode must be `nil', `plain', `wide', `summary' or `nov'. If
+ mode is `nil', corresponding decoder is set up for every modes.
+
+ [Suggest]
+
+
+[Macro] mime-find-field-presentation-method (name)
+ Return field-presentation-method from NAME.
+
+ NAME must be `plain', `wide', `summary' or `nov'.
+
+ [Suggest]
+
+
+[Function] mime-find-field-decoder (field &optional mode)
+ Return function to decode field-body of FIELD in MODE.
+
+ Optional argument MODE must be object or name of
+ field-presentation-method. Name of field-presentation-method must
+ be `plain', `wide', `summary' or `nov'. Default value of MODE is
+ `summary'.
+
+ [Suggest]
+
+
+[Function] mime-update-field-decoder-cache (field mode &optional function)
+ Update field decoder cache `mime-field-decoder-cache'.
+
+ [Suggest]
+
+
+** encoder
+
+[Function] mime-encode-header-in-buffer (&optional code-conversion)
+ Encode header fields to network representation, such as MIME
+ encoded-word.
+
+ It refer variable `mime-field-encoding-method-alist'.
+
+ [Suggest]
+
+
+[Function] mime-encode-field-body (field-body field-name)
+ Encode FIELD-BODY as FIELD-NAME, and return the result.
+
+ A lexical token includes non-ASCII character is encoded as MIME
+ encoded-word. ASCII token is not encoded.
+
+ [Required]<Suggest>
+
+
+* Content-Transfer-Encoding
+
+** How to use
+
+(require 'mel)
+
+
+** Encoding Name
+
+[Variable] mime-encoding-list
+ List of Content-Transfer-Encoding. Each encoding must be string.
+
+ [Suggest]
+
+
+[Function] mime-encoding-list (&optional service)
+ Return list of Content-Transfer-Encoding.
+
+ If SERVICE is specified, it returns available list of
+ Content-Transfer-Encoding for it.
+
+ [Required]<Suggest>
+
+
+[Function] mime-encoding-alist (&optional service)
+ Return table of Content-Transfer-Encoding for completion.
+
+ [Suggest]
+
+
+** Decoder
+
+[Function] mime-decode-string (string encoding)
+ Decode STRING using ENCODING.
+
+ ENCODING must be string. If ENCODING is found in
+ `mime-encoding-list', this function decodes the STRING by its value.
+
+ [Required]<Suggest>
+
+
+[Function] mime-decode-region (start end encoding)
+ Decode region START to END of current buffer using ENCODING.
+
+ ENCODING must be string.
+
+ [Suggest]<Not Suggest>
+
+
+[Function] mime-write-decoded-region (start end filename encoding)
+ Decode and write current region encoded by ENCODING into FILENAME.
+
+ START and END are buffer positions.
+
+ [Required]<Suggest>
+
+
+** Encoder
+
+[Function] mime-encode-string (string encoding)
+ Encode STRING using ENCODING.
+
+ ENCODING must be string.
+
+ [Optional]<Not Suggest>
+
+
+[Function] mime-encode-region (start end encoding)
+ Encode region START to END of current buffer using ENCODING.
+
+ ENCODING must be string.
+
+ [Suggest]<Not Suggest>
+
+
+[Function] mime-insert-encoded-file (filename encoding)
+ Insert file FILENAME encoded by ENCODING format.
+
+ [Required]<Suggest>
+
+
+** encoded-text
+
+[Function] encoded-text-decode-string (string encoding)
+ Decode STRING as encoded-text using ENCODING.
+
+ ENCODING must be string.
+
+ [Suggest]
+
+
+[Function] encoded-text-encode-string (string encoding &optional mode)
+ Encode STRING as encoded-text using ENCODING.
+
+ ENCODING must be string.
+
+ MODE allows `text', `comment', `phrase' or nil. Default value is
+ `phrase'.
+
+ [Suggest]
+
+
+[Function] base64-encoded-length (string)
+ Return length of B-encoded STRING.
+
+ [Suggest]
+
+
+[Function] Q-encoded-text-length (string &optional mode)
+ Return length of Q-encoded STRING.
+
+ MODE allows `text', `comment', `phrase' or nil. Default value is
+ `phrase'.
+
+ [Suggest]
+
+
+* Mailcap
+
+** How to use
+
+(require 'mime-conf)
+
+
+** Parsing
+
+[Function] mime-parse-mailcap-buffer (&optional buffer order)
+ Parse BUFFER as a mailcap, and return the result.
+
+ If optional argument ORDER is a function, result is sorted by it.
+ If optional argument ORDER is not specified, result is sorted
+ original order. Otherwise result is not sorted.
+
+ [Required]<Suggest>
+
+
+[Variable] mime-mailcap-file
+ File name of user's mailcap file.
+
+ [Required]<Suggest> (default value may be "~/.mailcap")
+
+
+[Function] mime-parse-mailcap-file (&optional filename order)
+ Parse FILENAME as a mailcap, and return the result.
+
+ If optional argument ORDER is a function, result is sorted by it.
+ If optional argument ORDER is not specified, result is sorted
+ original order. Otherwise result is not sorted.
+
+ [Required]<Suggest>
+
+
+** Apply
+
+[Function] mime-format-mailcap-command (mtext situation)
+ Return formated command string from MTEXT and SITUATION.
+
+ MTEXT is a command text of mailcap specification, such as
+ view-command.
+
+ SITUATION is an association-list about information of entity. Its
+ key may be:
+
+ 'type primary media-type
+ 'subtype media-subtype
+ 'filename filename
+ STRING parameter of Content-Type field
+
+ [Required]<Suggest>
+
+
+* MIME Field parsing
+
+** How to use
+
+(require 'mime)
+
+
+** Level 2 features
+
+[Variable] mime-field-parser-alist
+ Alist to specify field parser.
+
+
+[Function] mime-parse-Content-Type (string)
+ Parse STRING as field-body of Content-Type field.
+
+Return value is
+ (PRIMARY-TYPE SUBTYPE (NAME1 . VALUE1)(NAME2 . VALUE2) ...)
+or nil. PRIMARY-TYPE and SUBTYPE are symbol and NAME_n and VALUE_n
+are string.
+
+
+[Function] mime-read-Content-Type ()
+ Read field-body of Content-Type field from current-buffer,
+and return parsed it. Format of return value is as same as
+`mime-parse-Content-Type'.
+
+
+[Function] mime-parse-Content-Disposition (string)
+ Parse STRING as field-body of Content-Disposition field.
+
+
+[Function] mime-read-Content-Disposition ()
+ Read field-body of Content-Disposition field from current-buffer,
+and return parsed it.
+
+
+[Function] mime-parse-Content-Transfer-Encoding (string)
+ Parse STRING as field-body of Content-Transfer-Encoding field.
+
+
+[Function] mime-read-Content-Transfer-Encoding (&optional default-encoding)
+ Read field-body of Content-Transfer-Encoding field from
+current-buffer, and return it.
+
+If is is not found, return DEFAULT-ENCODING.
+
+
+[Function] mime-parse-msg-id (tokens)
+ Parse TOKENS as msg-id of Content-Id or Message-Id field.
+
+
+[Function] mime-uri-parse-cid (string)
+ Parse STRING as cid URI.
+
+
+* STD 11 parsing
+
+** How to use
+
+(require 'std11)
+
+
+** Level 1 features
+
+[Function] std11-fetch-field (name)
+ Return the value of the header field NAME.
+
+The buffer is expected to be narrowed to just the headers of the message.
+
+
+[Function] std11-narrow-to-header (&optional boundary)
+ Narrow to the message header.
+
+If BOUNDARY is not nil, it is used as message header separator.
+
+
+[Function] std11-field-body (name &optional boundary)
+ Return the value of the header field NAME.
+
+If BOUNDARY is not nil, it is used as message header separator.
+
+
+[Function] std11-unfold-string (string)
+ Unfold STRING as message header field.
+
+
+** Level 2 features
+
+[Function] std11-lexical-analyze (string &optional analyzer start)
+ Analyze STRING as lexical tokens of STD 11.
+
+
+[Function] std11-address-string (address)
+ Return string of address part from parsed ADDRESS of RFC 822.
+
+
+[Function] std11-full-name-string (address)
+ Return string of full-name part from parsed ADDRESS of RFC 822.
+
+
+[Function] std11-msg-id-string (msg-id)
+ Return string from parsed MSG-ID of RFC 822.
+
+
+[Function] std11-fill-msg-id-list-string (string &optional column)
+ Fill list of msg-id in STRING, and return the result.
+
+
+[Function] std11-parse-address-string (string)
+ Parse STRING as mail address.
+
+
+[Function] std11-parse-addresses-string (string)
+ Parse STRING as mail address list.
+
+
+[Function] std11-parse-msg-id-string (string)
+ Parse STRING as msg-id.
+
+
+[Function] std11-parse-msg-ids-string (string)
+ Parse STRING as `*(phrase / msg-id)'.
+
+
+[Function] std11-extract-address-components (string)
+ Extract full name and canonical address from STRING.
+
+ Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). If no
+ name can be extracted, FULL-NAME will be nil.
+
+
+* SMTP
+
+** How to use
+
+(require 'smtp)
+
+
+** Features
+
+[Function] smtp-send-buffer (sender recipients buffer)
+ Send a message.
+
+ SENDER is an envelope sender address.
+ RECIPIENTS is a list of envelope recipient addresses.
+ BUFFER may be a buffer or a buffer name which contains mail message.
+
+ [Suggest]
+
+[Function] smtp-via-smtp (sender recipients buffer)
+ Like `smtp-send-buffer', but sucks in any errors.
+
+ [Optional]<Not Suggest>
(progn
(add-to-list 'default-load-path LISPDIR)
(add-to-list 'load-path LISPDIR)
- (add-to-list 'load-path (expand-file-name "apel" LISPDIR))
- ))
+ (add-to-list 'load-path (expand-file-name "apel" LISPDIR))))
(if (boundp 'VERSION_SPECIFIC_LISPDIR)
(add-to-list 'load-path VERSION_SPECIFIC_LISPDIR))
;;; Code:
(setq flim-modules '(std11
- luna mime-def
+ luna lunit mime-def
mel mel-q mel-u mel-g
eword-decode eword-encode
mime mime-parse mmgeneric
mmbuffer mmcooked mmdbuffer mmexternal
mime-conf
+ unique-id scram-md5
sasl sasl-cram sasl-digest
- scram-md5 unique-id
- smtp qmtp smtpmail))
+ smtp qmtp smtpmail
+ raw-io))
(setq flim-version-specific-modules '(mailcap))
(setq hmac-modules '(hex-util
- hmac-def
- md5 md5-el md5-dl
- sha1 sha1-el sha1-dl
+ hmac-def md5 sha1
hmac-md5 hmac-sha1))
-(setq flim-modules (nconc hmac-modules flim-modules))
-
(if (and (fboundp 'base64-encode-string)
(subrp (symbol-function 'base64-encode-string)))
nil
(unless-broken ccl-usable
(setq flim-modules (cons 'mel-b-ccl (cons 'mel-q-ccl flim-modules))))
+(if (and (fboundp 'md5)
+ (subrp (symbol-function 'md5)))
+ nil
+ (if (fboundp 'dynamic-link)
+ (setq hmac-modules (cons 'md5-dl hmac-modules))
+ (setq hmac-modules (cons 'md5-el hmac-modules))))
+
+(if (fboundp 'dynamic-link)
+ (setq hmac-modules (cons 'sha1-dl hmac-modules))
+ (setq hmac-modules (cons 'sha1-el hmac-modules)))
+
+(setq flim-modules (nconc hmac-modules flim-modules))
+
;;; FLIM-ELS ends here
(let (prefix lisp-dir version-specific-lisp-dir)
(and (setq prefix (car command-line-args-left))
(or (string-equal "NONE" prefix)
- (defvar PREFIX prefix)
- ))
+ (defvar PREFIX prefix)))
(setq command-line-args-left (cdr command-line-args-left))
(and (setq lisp-dir (car command-line-args-left))
(or (string-equal "NONE" lisp-dir)
- (defvar LISPDIR lisp-dir)
- ))
+ (defvar LISPDIR lisp-dir)))
(setq command-line-args-left (cdr command-line-args-left))
(and (setq version-specific-lisp-dir (car command-line-args-left))
(or (string-equal "NONE" version-specific-lisp-dir)
(progn
(defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)
(princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
- VERSION_SPECIFIC_LISPDIR)))
- ))
+ VERSION_SPECIFIC_LISPDIR)))))
(setq command-line-args-left (cdr command-line-args-left))
(load-file "FLIM-CFG")
(load-file "FLIM-ELS")
(princ (format "PREFIX=%s
-LISPDIR=%s\n" PREFIX LISPDIR))
- ))
+LISPDIR=%s\n" PREFIX LISPDIR))))
(defun compile-flim ()
(config-flim)
(compile-elisp-modules flim-version-specific-modules ".")
- (compile-elisp-modules flim-modules ".")
- )
+ (compile-elisp-modules flim-modules "."))
(defun install-flim ()
(config-flim)
(install-elisp-modules flim-version-specific-modules "./"
FLIM_VERSION_SPECIFIC_DIR)
- (install-elisp-modules flim-modules "./" FLIM_DIR)
- )
+ (install-elisp-modules flim-modules "./" FLIM_DIR))
+
+(defun check-flim ()
+ (config-flim)
+ (require 'lunit)
+ (let ((files (directory-files "tests" t))
+ (suite (lunit-make-test-suite)))
+ (while files
+ (if (file-regular-p (car files))
+ (progn
+ (load-file (car files))
+ (lunit-test-suite-add-test
+ suite (lunit-make-test-suite-from-class
+ (intern (file-name-sans-extension
+ (file-name-nondirectory (car files))))))))
+ (setq files (cdr files)))
+ (lunit suite)))
(defun config-flim-package ()
(let (package-dir)
(and (setq package-dir (car command-line-args-left))
(or (string= "NONE" package-dir)
- (defvar PACKAGEDIR package-dir)
- ))
+ (defvar PACKAGEDIR package-dir)))
(setq command-line-args-left (cdr command-line-args-left))
(load-file "FLIM-CFG")
(load-file "FLIM-ELS")
(setq flim-modules (append flim-modules
'(auto-autoloads custom-load)))
- (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))
- ))
+ (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))))
(defun compile-flim-package ()
(config-flim-package)
(Custom-make-dependencies)
(compile-elisp-modules flim-version-specific-modules ".")
- (compile-elisp-modules flim-modules ".")
- )
+ (compile-elisp-modules flim-modules "."))
(defun install-flim-package ()
(config-flim-package)
(expand-file-name "lisp"
PACKAGEDIR)))
(delete-file "./auto-autoloads.el")
- (delete-file "./custom-load.el")
- )
+ (delete-file "./custom-load.el"))
;;; FLIM-MK ends here
$(EMACS) $(FLAGS) -f compile-flim $(PREFIX) $(LISPDIR) \
$(VERSION_SPECIFIC_LISPDIR)
+check:
+ $(EMACS) $(FLAGS) -f check-flim $(PREFIX) $(LISPDIR) \
+ $(VERSION_SPECIFIC_LISPDIR)
+
install: elc
$(EMACS) $(FLAGS) -f install-flim $(PREFIX) $(LISPDIR) \
$(VERSION_SPECIFIC_LISPDIR)
tar:
cvs commit
- sh -c 'cvs tag -RF $(PACKAGE)-`echo $(VERSION) | tr . _`; \
+ sh -c 'cvs tag -R $(PACKAGE)-`echo $(VERSION) | tr . _`; \
cd /tmp; \
cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root \
export -d $(PACKAGE)-$(VERSION) \
mailcap.el --- mailcap parser and utility
+ This library should work on:
+
+ Emacs 20.4 and up
+ XEmacs 21.1 and up
+
Installation
============
Notice that XEmacs package system requires XEmacs 21.0 or later.
-load-path (for Emacs or MULE)
-=============================
-
- If you are using Emacs or Mule, please add directory of FLIM to
- load-path. If you install by default setting, you can write
- subdirs.el for example:
-
- --------------------------------------------------------------------
- (normal-top-level-add-to-load-path '("apel" "flim"))
- --------------------------------------------------------------------
-
- If you are using XEmacs, there are no need of setting about
- load-path.
-
-
Bug reports
===========
mailcap.el --- mailcap \e$B$N2r@O=hM}Ey\e(B
+ \e$B0J2<$N4D6-$GF0:n$7$^$9!'\e(B
+
+ Emacs 20.4 \e$B0J9_\e(B
+ XEmacs 21.1 \e$B0J9_\e(B
+
\e$BF3F~\e(B (install)
==============
`PREFIX=...' \e$B$,>JN,$5$l$k$H!";XDj$5$l$?\e(B emacs \e$B%3%^%s%I$N%G%#%l%/%H%j!<\e(B
\e$BLZ$N@\F,<-$,;HMQ$5$l$^$9\e(B (\e$B$*$=$i$/\e(B /usr/local \e$B$G$9\e(B)\e$B!#\e(B
- \e$BNc$($P!"\e(BPREFIX=/usr/local \e$B$H\e(B Emacs 19.34 \e$B$,;XDj$5$l$l$P!"0J2<$N%G%#%l\e(B
+ \e$BNc$($P!"\e(BPREFIX=/usr/local \e$B$H\e(B Emacs 20.7 \e$B$,;XDj$5$l$l$P!"0J2<$N%G%#%l\e(B
\e$B%/%H%j!<LZ$,:n@.$5$l$^$9!#\e(B
/usr/local/share/emacs/site-lisp/flim/ --- FLIM
+ /usr/local/share/emacs/20.7/site-lisp/flim/ --- FLIM
Emacs Lisp \e$B%W%m%0%i%`$N$?$a$N\e(B lisp \e$B%G%#%l%/%H%j!<$r;XDj$9$k$3$H$,$G\e(B
\e$B$-$^$9!#Nc$($P!"\e(B:
\e$B$G$9!#\e(B
-load-path (Emacs \e$B$H\e(B MULE \e$BMQ\e(B)
-=============================
-
- Emacs \e$B$+\e(B Mule \e$B$r;H$C$F$$$k$J$i!"\e(BFLIM \e$B$N%G%#%l%/%H%j!<$r\e(B load-path \e$B$K\e(B
- \e$BDI2C$7$F$/$@$5$$!#=i4|@_Dj$N$^$^F3F~$7$?$J$i!"<!$N$h$&$K\e(B subdirs.el
- \e$B$r=q$/$3$H$,$G$-$^$9!#Nc\e(B:
-
- --------------------------------------------------------------------
- (normal-top-level-add-to-load-path '("apel" "flim"))
- --------------------------------------------------------------------
-
- XEmacs \e$B$r;H$C$F$$$k$J$i!"\e(Bload-path \e$B$r@_Dj$9$kI,MW$O$"$j$^$;$s!#\e(B
-
-
\e$B%P%0Js9p\e(B
========
1.13.1 Tawaramoto \e$(BED86K\\e(B ; <=> \e$(B6aE4\e(B \e$(B@>ED86K\\e(B
1.13.2 Kasanui \e$(B3^K%\e(B
1.14.0 Ninokuchi \e$(B?7%N8}\e(B
------- Yagi \e$(BH,LZ\e(B ; = \e$(B6aE4\e(B \e$(BBg:e@~\e(B
+1.14.1 Yagi \e$(BH,LZ\e(B ; = \e$(B6aE4\e(B \e$(BBg:e@~\e(B
------ Yagi-Nishiguchi \e$(BH,LZ@>8}\e(B
------ Unebigory\e-Dòmae\e-A \e$(B@&K58fNMA0\e(B
------ Kashiharajingu-mae \e$(B3`86?@5\A0\e(B ; = \e$(B6aE4\e(B \e$(BFnBg:e@~!"5HLn@~\e(B
;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs
-;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
;; Author: ENAMI Tsugutomo <enami@sys.ptg.sony.co.jp>
-;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; TANAKA Akira <akr@jaist.ac.jp>
+;; MORIOKA Tomohiko <tomo@m17n.org>
+;; TANAKA Akira <akr@m17n.org>
;; Created: 1995/10/03
;; Original: 1992/07/20 ENAMI Tsugutomo's `mime.el'.
;; Renamed: 1993/06/03 to tiny-mime.el by MORIOKA Tomohiko
(eval-when-compile (require 'cl)) ; list*, pop
-(defgroup eword-decode nil
- "Encoded-word decoding"
- :group 'mime)
-(defcustom eword-max-size-to-decode 1000
- "*Max size to decode header field."
- :group 'eword-decode
- :type '(choice (integer :tag "Limit (bytes)")
- (const :tag "Don't limit" nil)))
+;;; @ Variables
+;;;
+
+;; User options are defined in mime-def.el.
;;; @ MIME encoded-word definition
start-column
&optional max-column
start)
- (if (and eword-max-size-to-decode
- (> (length string) eword-max-size-to-decode))
+ (if (and mime-field-decoding-max-size
+ (> (length string) mime-field-decoding-max-size))
string
(or max-column
(setq max-column fill-column))
;;;###autoload
(defun mime-set-field-decoder (field &rest specs)
- "Set decoder of FILED.
+ "Set decoder of FIELD.
SPECS must be like `MODE1 DECODER1 MODE2 DECODER2 ...'.
Each mode must be `nil', `plain', `wide', `summary' or `nov'.
If mode is `nil', corresponding decoder is set up for every modes."
))
code-conversion))
-(define-obsolete-function-alias 'eword-decode-header
- 'mime-decode-header-in-buffer)
+(defalias 'eword-decode-header 'mime-decode-header-in-buffer)
+(make-obsolete 'eword-decode-header 'mime-decode-header-in-buffer)
;;; @ encoded-word decoder
"*Max position of eword-lexical-analyze-cache.
It is max size of eword-lexical-analyze-cache - 1.")
-(defcustom eword-lexical-analyzer
+(defvar mime-header-lexical-analyzer
'(eword-analyze-quoted-string
eword-analyze-domain-literal
eword-analyze-comment
Previous function is preferred to next function. If a function
returns nil, next function is used. Otherwise the return value will
-be the result."
- :group 'eword-decode
- :type '(repeat function))
+be the result.")
(defun eword-analyze-quoted-string (string start &optional must-unfold)
(let ((p (std11-check-enclosure string ?\" ?\" nil start)))
dest ret)
(while (< start len)
(setq ret
- (let ((rest eword-lexical-analyzer)
+ (let ((rest mime-header-lexical-analyzer)
func r)
(while (and (setq func (car rest))
(null
;;; eword-encode.el --- RFC 2047 based encoded-word encoder for GNU Emacs
-;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: encoded-word, MIME, multilingual, header, mail, news
;; This file is part of FLIM (Faithful Library about Internet Message).
;;; @ variables
;;;
-(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)
- (t . mime)
- )
- "*Alist to specify field encoding method.
-Its key is field-name, value is encoding method.
-
-If method is `mime', this field will be encoded into MIME format.
-
-If method is a MIME-charset, this field will be encoded as the charset
-when it must be convert into network-code.
-
-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."
- :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
+;; User options are defined in mime-def.el.
+
+(defvar mime-header-charset-encoding-alist
'((us-ascii . nil)
(iso-8859-1 . "Q")
(iso-8859-2 . "Q")
(utf-8 . "B")
))
+(defvar mime-header-default-charset-encoding "Q")
+
;;; @ encoded-text encoder
;;;
ENCODING allows \"B\" or \"Q\".
MODE is allows `text', `comment', `phrase' or nil. Default value is
`phrase'."
- (let ((text (encoded-text-encode-string string encoding)))
+ (let ((text (encoded-text-encode-string string encoding mode)))
(if text
(concat "=?" (upcase (symbol-name charset)) "?"
encoding "?" text "?=")
(let ((len (length string))
dest)
(while (> len 0)
- (let* ((chr (sref string 0))
+ (let* ((chr (aref string 0))
+ ;; (chr (sref string 0))
(charset (eword-encode-char-type chr))
- (i (char-length chr)))
+ (i 1)
+ ;; (i (char-length chr))
+ )
(while (and (< i len)
- (setq chr (sref string i))
- (eq charset (eword-encode-char-type chr))
- )
- (setq i (char-next-index chr i))
+ (setq chr (aref string i))
+ ;; (setq chr (sref string i))
+ (eq charset (eword-encode-char-type chr)))
+ (setq i (1+ i))
+ ;; (setq i (char-next-index chr i))
)
(setq dest (cons (cons charset (substring string 0 i)) dest)
string (substring string i)
- len (- len i)
- )))
- (nreverse dest)
- ))
+ len (- len i))))
+ (nreverse dest)))
;;; @ word
(defun ew-find-charset-rule (charsets)
(if charsets
(let* ((charset (find-mime-charset-by-charsets charsets))
- (encoding (cdr (or (assq charset eword-charset-encoding-alist)
- '(nil . "Q")))))
- (list charset encoding)
- )))
+ (encoding
+ (cdr (or (assq charset mime-header-charset-encoding-alist)
+ (cons charset mime-header-default-charset-encoding)))))
+ (list charset encoding))))
(defun tm-eword::words-to-ruled-words (wl &optional mode)
(mapcar (function
(str "") nstr)
(while (and (< p len)
(progn
- (setq np (char-next-index (sref string p) p))
+ (setq np (1+ p))
+ ;;(setq np (char-next-index (sref string p) p))
(setq nstr (substring string 0 np))
(setq ret (tm-eword::encoded-word-length
(cons nstr (cdr rword))
(append dest
(list
(let ((ret (ew-find-charset-rule
- (find-non-ascii-charset-string str))))
+ (find-charset-string str))))
(make-ew-rword
str (car ret)(nth 1 ret) 'phrase)
)
(if (or (eq pname 'spaces)
(eq pname 'comment))
(nconc dest (list (list (cdr token) nil nil)))
- (nconc (butlast dest)
+ (nconc (nreverse (cdr (reverse dest)))
+ ;; (butlast dest)
(list
(list (concat (car (car (last dest)))
(cdr token))
;;; @ application interfaces
;;;
-(defcustom eword-encode-default-start-column 10
- "Default start column if it is omitted."
- :group 'eword-encode
- :type 'integer)
+(defvar eword-encode-default-start-column 10
+ "Default start column if it is omitted.")
(defun eword-encode-string (string &optional column mode)
"Encode STRING as encoded-words, and return the result.
(or column eword-encode-default-start-column)
(eword-encode-split-string string 'text))))
-(defun eword-encode-field-body (field-body field-name)
+;;;###autoload
+(defun mime-encode-field-body (field-body field-name)
"Encode FIELD-BODY as FIELD-NAME, and return the result.
A lexical token includes non-ASCII character is encoded as MIME
encoded-word. ASCII token is not encoded."
Resent-Sender To Resent-To
Cc Resent-Cc Bcc Resent-Bcc
Dcc))
- (eword-encode-address-list field-body start)
- )
+ (eword-encode-address-list field-body start))
((eq field-name 'In-Reply-To)
- (eword-encode-in-reply-to field-body start)
- )
+ (eword-encode-in-reply-to field-body start))
((memq field-name '(Mime-Version User-Agent))
- (eword-encode-structured-field-body field-body start)
- )
+ (eword-encode-structured-field-body field-body start))
(t
- (eword-encode-unstructured-field-body field-body start)
- ))
- )))
+ (eword-encode-unstructured-field-body field-body start))))))
+(defalias 'eword-encode-field-body 'mime-encode-field-body)
+(make-obsolete 'eword-encode-field-body 'mime-encode-field-body)
(defun eword-in-subject-p ()
(let ((str (std11-field-body "Subject")))
(if (and str (string-match eword-encoded-word-regexp str))
str)))
+(make-obsolete 'eword-in-subject-p "Don't use it.")
(defsubst eword-find-field-encoding-method (field-name)
(setq field-name (downcase field-name))
- (let ((alist eword-field-encoding-method-alist))
+ (let ((alist mime-field-encoding-method-alist))
(catch 'found
(while alist
(let* ((pair (car alist))
(throw 'found (cdr pair))
))
(setq alist (cdr alist)))
- (cdr (assq t eword-field-encoding-method-alist))
+ (cdr (assq t mime-field-encoding-method-alist))
)))
-(defun eword-encode-header (&optional code-conversion)
+;;;###autoload
+(defun mime-encode-header-in-buffer (&optional code-conversion)
"Encode header fields to network representation, such as MIME encoded-word.
-It refer variable `eword-field-encoding-method-alist'."
+It refer variable `mime-field-encoding-method-alist'."
(interactive "*")
(save-excursion
(save-restriction
(setq bbeg (match-end 0)
field-name (buffer-substring (match-beginning 0) (1- bbeg))
end (std11-field-end))
- (and (find-non-ascii-charset-region bbeg end)
+ (and (delq 'ascii (find-charset-region bbeg end))
(let ((method (eword-find-field-encoding-method
(downcase field-name))))
(cond ((eq method 'mime)
(buffer-substring-no-properties bbeg end)
))
(delete-region bbeg end)
- (insert (eword-encode-field-body field-body
- field-name))
- ))
+ (insert (mime-encode-field-body field-body
+ field-name))))
(code-conversion
(let ((cs
(or (mime-charset-to-coding-system
))
))
)))
+(defalias 'eword-encode-header 'mime-encode-header-in-buffer)
+(make-obsolete 'eword-encode-header 'mime-encode-header-in-buffer)
;;; @ end
(eval-when-compile (require 'cl))
-(eval-when-compile (require 'static))
-
-(static-condition-case nil
- :symbol-for-testing-whether-colon-keyword-is-available-or-not
- (void-variable
- (defconst :before ':before)
- (defconst :after ':after)
- (defconst :around ':around)))
-
;;; @ class
;;;
(defmacro luna-find-class (name)
- "Return the luna-class of the given NAME."
+ "Return a luna-class that has NAME."
`(get ,name 'luna-class))
+;; Give NAME (symbol) the luna-class CLASS.
(defmacro luna-set-class (name class)
`(put ,name 'luna-class ,class))
+;; Return the obarray of luna-class CLASS.
(defmacro luna-class-obarray (class)
`(aref ,class 1))
+;; Return the parents of luna-class CLASS.
(defmacro luna-class-parents (class)
`(aref ,class 2))
+;; Return the number of slots of luna-class CLASS.
(defmacro luna-class-number-of-slots (class)
`(aref ,class 3))
-(defmacro luna-define-class (type &optional parents slots)
- "Define TYPE as a luna-class.
-If PARENTS is specified, TYPE inherits PARENTS.
-Each parent must be name of luna-class (symbol).
-If SLOTS is specified, TYPE will be defined to have them."
- `(luna-define-class-function ',type ',(append parents '(standard-object))
+(defmacro luna-define-class (class &optional parents slots)
+ "Define CLASS as a luna-class.
+CLASS always inherits the luna-class `standard-object'.
+
+The optional 1st arg PARENTS is a list luna-class names. These
+luna-classes are also inheritted by CLASS.
+
+The optional 2nd arg SLOTS is a list of slots CLASS will have."
+ `(luna-define-class-function ',class ',(append parents '(standard-object))
',slots))
-(defun luna-define-class-function (type &optional parents slots)
- (static-condition-case nil
- :symbol-for-testing-whether-colon-keyword-is-available-or-not
- (void-variable
- (let (key)
- (dolist (slot slots)
- (setq key (intern (format ":%s" slot)))
- (set key key)))))
+
+;; Define CLASS as a luna-class. PARENTS, if non-nil, is a list of
+;; luna-class names inherited by CLASS. SLOTS, if non-nil, is a list
+;; of slots belonging to CLASS.
+
+(defun luna-define-class-function (class &optional parents slots)
(let ((oa (make-vector 31 0))
(rest parents)
parent name
(setq name (symbol-name sym))
(unless (intern-soft name oa)
(put (intern name oa) 'luna-slot-index (+ j b))
- (setq i (1+ i))
- )))
- (luna-class-obarray (luna-find-class parent)))
- )
+ (setq i (1+ i)))))
+ (luna-class-obarray (luna-find-class parent))))
(setq rest slots)
(while rest
(setq name (symbol-name (pop rest)))
(unless (intern-soft name oa)
(put (intern name oa) 'luna-slot-index i)
- (setq i (1+ i))
- ))
- (luna-set-class type (vector 'class oa parents i))
- ))
+ (setq i (1+ i))))
+ (luna-set-class class (vector 'class oa parents i))))
+
+
+;; Return a member (slot or method) of CLASS that has name
+;; MEMBER-NAME.
(defun luna-class-find-member (class member-name)
(or (stringp member-name)
member-name)))))
ret)))
+
+;; Return a member (slot or method) of CLASS that has name
+;; MEMBER-NAME. If CLASS doesnt' have such a member, make it in
+;; CLASS.
+
(defsubst luna-class-find-or-make-member (class member-name)
(or (stringp member-name)
(setq member-name (symbol-name member-name)))
(intern member-name (luna-class-obarray class)))
+
+;; Return the index number of SLOT-NAME in CLASS.
+
(defmacro luna-class-slot-index (class slot-name)
`(get (luna-class-find-member ,class ,slot-name) 'luna-slot-index))
(defmacro luna-define-method (name &rest definition)
- "Define NAME as a method function of a class.
+ "Define NAME as a method of a luna class.
Usage of this macro follows:
- (luna-define-method NAME [METHOD-QUALIFIER] ARGLIST [DOCSTRING] BODY...)
+ (luna-define-method NAME [METHOD-QUALIFIER] ARGLIST [DOCSTRING] BODY...)
+
+The optional 1st argument METHOD-QUALIFIER specifies when and how the
+method is called.
+
+If it is :before, call the method before calling the parents' methods.
+
+If it is :after, call the method after calling the parents' methods.
-NAME is the name of method.
+If it is :around, call the method only. The parents' methods can be
+executed by calling the function `luna-call-next-method' in BODY.
-Optional argument METHOD-QUALIFIER must be :before, :after or :around.
-If it is :before / :after, the method is called before / after a
-method of parent class is finished. ARGLIST is like an argument list
-of lambda, but (car ARGLIST) must be specialized parameter. (car (car
-ARGLIST)) is name of variable and \(nth 1 (car ARGLIST)) is name of
-class.
+Otherwize, call the method only, and the parents' methods are never
+executed. In this case, METHOD-QUALIFIER is treated as ARGLIST.
-Optional argument DOCSTRING is the documentation of method.
+ARGLIST has the form ((VAR CLASS) METHOD-ARG ...), where VAR is a
+variable name that should be bound to an entity that receives the
+message NAME, CLASS is a class name. The first argument to the method
+is VAR, and the remaining arguments are METHOD-ARGs.
-BODY is the body of method."
+If VAR is nil, arguments to the method are METHOD-ARGs. This kind of
+methods can't be called from generic-function (see
+`luna-define-generic').
+
+The optional 4th argument DOCSTRING is the documentation of the
+method. If it is not string, it is treated as BODY.
+
+The optional 5th BODY is the body of the method."
(let ((method-qualifier (pop definition))
args specializer class self)
(if (memq method-qualifier '(:before :after :around))
(setq args (pop definition))
(setq args method-qualifier
- method-qualifier nil)
- )
+ method-qualifier nil))
(setq specializer (car args)
class (nth 1 specializer)
self (car specializer))
(cdr args))
,@definition))
(sym (luna-class-find-or-make-member
- (luna-find-class ',class) ',name)))
+ (luna-find-class ',class) ',name))
+ (cache (get ',name 'luna-method-cache)))
+ (if cache
+ (unintern ',class cache))
(fset sym func)
- (put sym 'luna-method-qualifier ,method-qualifier)
- )))
+ (put sym 'luna-method-qualifier ,method-qualifier))))
(put 'luna-define-method 'lisp-indent-function 'defun)
((arg symbolp)
[&rest arg]
[&optional ["&optional" arg &rest arg]]
- &optional ["&rest" arg]
- )
+ &optional ["&rest" arg])
def-body))
+
+;; Return a list of method functions named SERVICE registered in the
+;; parents of CLASS.
+
(defun luna-class-find-parents-functions (class service)
(let ((parents (luna-class-parents class))
ret)
service)))))
ret))
+;; Return a list of method functions named SERVICE registered in CLASS
+;; and the parents..
+
(defun luna-class-find-functions (class service)
(let ((sym (luna-class-find-member class service)))
(if (fboundp sym)
(cond ((eq (get sym 'luna-method-qualifier) :before)
(cons (symbol-function sym)
- (luna-class-find-parents-functions class service))
- )
+ (luna-class-find-parents-functions class service)))
((eq (get sym 'luna-method-qualifier) :after)
(nconc (luna-class-find-parents-functions class service)
- (list (symbol-function sym)))
- )
+ (list (symbol-function sym))))
((eq (get sym 'luna-method-qualifier) :around)
- (cons sym (luna-class-find-parents-functions class service))
- )
+ (cons sym (luna-class-find-parents-functions class service)))
(t
- (list (symbol-function sym))
- ))
- (luna-class-find-parents-functions class service)
- )))
+ (list (symbol-function sym))))
+ (luna-class-find-parents-functions class service))))
;;; @ instance (entity)
(defsubst luna-send (entity message &rest luna-current-method-arguments)
"Send MESSAGE to ENTITY, and return the result.
+ENTITY is an instance of a luna class, and MESSAGE is a method name of
+the luna class.
LUNA-CURRENT-METHOD-ARGUMENTS is arguments of the MESSAGE."
(let ((luna-next-methods (luna-find-functions entity message))
luna-current-method
(eval-when-compile
(defvar luna-next-methods nil)
- (defvar luna-current-method-arguments nil)
- )
+ (defvar luna-current-method-arguments nil))
(defun luna-call-next-method ()
- "Call the next method in a method with :around qualifier."
+ "Call the next method in the current method function.
+A method function that has :around qualifier should call this function
+to execute the parents' methods."
(let (luna-current-method
luna-previous-return-value)
(while (and luna-next-methods
t))))
luna-previous-return-value))
-(defun luna-make-entity (type &rest init-args)
- "Make instance of luna-class TYPE and return it.
-If INIT-ARGS is specified, it is used as initial values of the slots.
-It must be plist and each slot name must have prefix `:'."
- (let* ((c (get type 'luna-class))
+(defun luna-make-entity (class &rest init-args)
+ "Make an entity (instance) of luna-class CLASS and return it.
+INIT-ARGS is a plist of the form (:SLOT1 VAL1 :SLOT2 VAL2 ...),
+where SLOTs are slots of CLASS and the VALs are initial values of
+the corresponding SLOTs."
+ (let* ((c (get class 'luna-class))
(v (make-vector (luna-class-number-of-slots c) nil)))
- (luna-set-class-name v type)
+ (luna-set-class-name v class)
(luna-set-obarray v (make-vector 7 0))
- (apply #'luna-send v 'initialize-instance v init-args)
- ))
+ (apply #'luna-send v 'initialize-instance v init-args)))
;;; @ interface (generic function)
;;;
+;; Find a method of ENTITY that handles MESSAGE, and call it with
+;; arguments LUNA-CURRENT-METHOD-ARGUMENTS.
+
+(defun luna-apply-generic (entity message &rest luna-current-method-arguments)
+ (let* ((class (luna-class-name entity))
+ (cache (get message 'luna-method-cache))
+ (sym (intern-soft (symbol-name class) cache))
+ luna-next-methods)
+ (if sym
+ (setq luna-next-methods (symbol-value sym))
+ (setq luna-next-methods
+ (luna-find-functions entity message))
+ (set (intern (symbol-name class) cache)
+ luna-next-methods))
+ (luna-call-next-method)))
+
+
+;; Convert ARGLIST (argument list spec for a method function) to the
+;; actual list of arguments.
+
(defsubst luna-arglist-to-arguments (arglist)
(let (dest)
(while arglist
(let ((arg (car arglist)))
(or (memq arg '(&optional &rest))
- (setq dest (cons arg dest)))
- )
+ (setq dest (cons arg dest))))
(setq arglist (cdr arglist)))
(nreverse dest)))
+
(defmacro luna-define-generic (name args &optional doc)
- "Define generic-function NAME.
-ARGS is argument of and DOC is DOC-string."
+ "Define a function NAME that provides a generic interface to the method NAME.
+ARGS is the argument list for NAME. The first element of ARGS is an
+entity.
+
+The function handles a message sent to the entity by calling the
+method with proper arguments.
+
+The optional 3rd argument DOC is the documentation string for NAME."
(if doc
- `(defun ,(intern (symbol-name name)) ,args
- ,doc
- (luna-send ,(car args) ',name
- ,@(luna-arglist-to-arguments args))
- )
- `(defun ,(intern (symbol-name name)) ,args
- (luna-send ,(car args) ',name
- ,@(luna-arglist-to-arguments args))
- )))
+ `(progn
+ (defun ,(intern (symbol-name name)) ,args
+ ,doc
+ (luna-apply-generic ,(car args) ',name
+ ,@(luna-arglist-to-arguments args)))
+ (put ',name 'luna-method-cache (make-vector 31 0)))
+ `(progn
+ (defun ,(intern (symbol-name name)) ,args
+ (luna-apply-generic ,(car args) ',name
+ ,@(luna-arglist-to-arguments args)))
+ (put ',name 'luna-method-cache (make-vector 31 0)))))
(put 'luna-define-generic 'lisp-indent-function 'defun)
;;;
(defun luna-define-internal-accessors (class-name)
- "Define internal accessors for an entity of CLASS-NAME."
+ "Define internal accessors for instances of the luna class CLASS-NAME.
+
+Internal accessors are macros to refer and set a slot value of the
+instances. For instance, if the class has SLOT, macros
+CLASS-NAME-SLOT-internal and CLASS-NAME-set-SLOT-internal are defined.
+
+CLASS-NAME-SLOT-internal accepts one argument INSTANCE, and returns
+the value of SLOT.
+
+CLASS-NAME-set-SLOT-internal accepts two arguemnt INSTANCE and VALUE,
+and sets SLOT to VALUE."
(let ((entity-class (luna-find-class class-name))
parents parent-class)
(mapatoms
(setq parent-class (luna-find-class (car parents)))
(if (luna-class-slot-index parent-class slot)
(throw 'derived nil))
- (setq parents (cdr parents))
- )
+ (setq parents (cdr parents)))
(eval
`(progn
(defmacro ,(intern (format "%s-%s-internal"
(entity)
(list 'aref entity
,(luna-class-slot-index entity-class
- (intern (symbol-name slot)))
- ))
+ (intern (symbol-name slot)))))
(defmacro ,(intern (format "%s-set-%s-internal"
class-name slot))
(entity value)
(list 'aset entity
,(luna-class-slot-index
entity-class (intern (symbol-name slot)))
- value))
- ))
- )))
+ value)))))))
(luna-class-obarray entity-class))))
;;; @ standard object
;;;
+;; Define super class of all luna classes.
(luna-define-class-function 'standard-object)
(luna-define-method initialize-instance ((entity standard-object)
&rest init-args)
+ "Initialize slots of ENTITY by INIT-ARGS."
(let* ((c (luna-find-class (luna-class-name entity)))
(oa (luna-class-obarray c))
s i)
(setq s (intern-soft (substring (symbol-name (pop init-args)) 1) oa)
i (pop init-args))
(if s
- (aset entity (get s 'luna-slot-index) i)
- ))
+ (aset entity (get s 'luna-slot-index) i)))
entity))
;;; Code:
(require 'mime-conf)
+(require 'poe) ; define-obsolete-function-alias
(define-obsolete-function-alias
'mailcap-parse-buffer 'mime-parse-mailcap-buffer)
;;; mel-b-ccl.el --- Base64 encoder/decoder using CCL.
-;; Copyright (C) 1998,1999 Tanaka Akira
+;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
-;; Author: Tanaka Akira <akr@jaist.ac.jp>
+;; Author: Tanaka Akira <akr@m17n.org>
;; Created: 1998/9/17
;; Keywords: MIME, Base64
(defun base64-ccl-insert-encoded-file (filename)
"Encode contents of file FILENAME to base64, and insert the result."
(interactive "*fInsert encoded file: ")
- (insert-file-contents-as-coding-system 'mel-ccl-base64-lf-rev filename))
+ (let ((coding-system-for-read 'mel-ccl-base64-lf-rev)
+ format-alist)
+ (insert-file-contents filename)))
(mel-define-method-function (mime-encode-string string (nil "base64"))
'base64-ccl-encode-string)
(defun base64-ccl-write-decoded-region (start end filename)
"Decode the region from START to END and write out to FILENAME."
(interactive "*r\nFWrite decoded region to file: ")
- (write-region-as-coding-system 'mel-ccl-b-rev start end filename))
+ (let ((coding-system-for-write 'mel-ccl-b-rev)
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end filename)))
(mel-define-method-function (mime-decode-string string (nil "base64"))
'base64-ccl-decode-string)
(defun gzip64-external-encode-region (beg end)
(interactive "*r")
(save-excursion
- (as-binary-process
- (apply (function call-process-region)
- beg end (car gzip64-external-encoder)
- t t nil
- (cdr gzip64-external-encoder)))
+ (let ((coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ beg end (car gzip64-external-encoder)
+ t t nil
+ (cdr gzip64-external-encoder)))
;; for OS/2
;; regularize line break code
- (goto-char (point-min))
- (while (re-search-forward "\r$" nil t)
- (replace-match ""))))
+ ;;(goto-char (point-min))
+ ;;(while (re-search-forward "\r$" nil t)
+ ;; (replace-match ""))
+ ))
(defun gzip64-external-decode-region (beg end)
(interactive "*r")
(save-excursion
- (as-binary-process
- (apply (function call-process-region)
- beg end (car gzip64-external-decoder)
- t t nil
- (cdr gzip64-external-decoder)))))
+ (let ((coding-system-for-read 'binary))
+ (apply (function call-process-region)
+ beg end (car gzip64-external-decoder)
+ t t nil
+ (cdr gzip64-external-decoder)))))
(mel-define-method-function (mime-encode-region start end (nil "x-gzip64"))
'gzip64-external-encode-region)
"Decode and write current region encoded by gzip64 into FILENAME.
START and END are buffer positions."
(interactive "*r\nFWrite decoded region to file: ")
- (as-binary-process
- (apply (function call-process-region)
- start end (car gzip64-external-decoder)
- nil nil nil
- (let ((args (cdr gzip64-external-decoder)))
- (append (butlast args)
- (list (concat (car (last args)) ">" filename)))))))
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ start end (car gzip64-external-decoder)
+ nil nil nil
+ (let ((args (cdr gzip64-external-decoder)))
+ (append (butlast args)
+ (list (concat (car (last args)) ">" filename)))))))
;;; @ end
(defun quoted-printable-ccl-insert-encoded-file (filename)
"Encode contents of the file named as FILENAME, and insert it."
(interactive "*fInsert encoded file: ")
- (insert-file-contents-as-coding-system
- 'mel-ccl-quoted-printable-lf-lf-rev filename))
+ (let ((coding-system-for-read 'mel-ccl-quoted-printable-lf-lf-rev)
+ format-alist)
+ (insert-file-contents filename)))
(mel-define-method-function
(mime-encode-string string (nil "quoted-printable"))
(defun quoted-printable-ccl-write-decoded-region (start end filename)
"Decode quoted-printable encoded current region and write out to FILENAME."
(interactive "*r\nFWrite decoded region to file: ")
- (write-region-as-coding-system 'mel-ccl-quoted-printable-lf-lf-rev
- start end filename))
+ (let ((coding-system-for-write 'mel-ccl-quoted-printable-lf-lf-rev)
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end filename)))
(mel-define-method-function
(mime-decode-string string (nil "quoted-printable"))
(require 'mime-def)
(require 'path-util)
-
+(eval-when-compile
+ ;; XXX: should provide char-list instead of string-to-char-list.
+ (require 'poem))
;;; @ Quoted-Printable encoder
;;;
variable `uuencode-external-encoder'."
(interactive "*r")
(save-excursion
- (as-binary-process
- (apply (function call-process-region)
- start end (car uuencode-external-encoder)
- t t nil
- (cdr uuencode-external-encoder)))
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ start end (car uuencode-external-encoder)
+ t t nil
+ (cdr uuencode-external-encoder)))
;; for OS/2
;; regularize line break code
(goto-char (point-min))
(match-end 0)))))))
(default-directory temporary-file-directory))
(if filename
- (as-binary-process
- (apply (function call-process-region)
- start end (car uuencode-external-decoder)
- t nil nil
- (cdr uuencode-external-decoder))
- (as-binary-input-file (insert-file-contents filename))
- ;; The previous line causes the buffer to be made read-only, I
- ;; do not pretend to understand the control flow leading to this
- ;; but suspect it has something to do with image-mode. -slb
- ;; Use `inhibit-read-only' to avoid to force
- ;; buffer-read-only nil. - tomo.
- (let ((inhibit-read-only t))
- (delete-file filename)))))))
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ start end (car uuencode-external-decoder)
+ t nil nil
+ (cdr uuencode-external-decoder))
+ (insert-file-contents filename)
+ ;; The previous line causes the buffer to be made read-only, I
+ ;; do not pretend to understand the control flow leading to this
+ ;; but suspect it has something to do with image-mode. -slb
+ ;; Use `inhibit-read-only' to avoid to force
+ ;; buffer-read-only nil. - tomo.
+ (let ((inhibit-read-only t))
+ (delete-file filename)))))))
(mel-define-method-function (mime-encode-region start end (nil "x-uue"))
'uuencode-external-encode-region)
(match-end 0)))))))
(default-directory temporary-file-directory))
(if file
- (as-binary-process
- (apply (function call-process-region)
- start end (car uuencode-external-decoder)
- nil nil nil
- (cdr uuencode-external-decoder))
- (rename-file file filename 'overwrites))))))
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ start end (car uuencode-external-decoder)
+ nil nil nil
+ (cdr uuencode-external-decoder))
+ (rename-file file filename 'overwrites))))))
;;; @ end
;;; Code:
(require 'mime-def)
-(require 'poem)
+(require 'raw-io)
(require 'alist)
-(require 'path-util)
(defcustom mime-encoding-list
'("7bit" "8bit" "binary" "base64" "quoted-printable")
(mel-define-method mime-encode-region (start end (nil "7bit")))
(mel-define-method mime-decode-region (start end (nil "7bit")))
(mel-define-method-function (mime-insert-encoded-file filename (nil "7bit"))
- 'insert-file-contents-as-binary)
+ 'binary-insert-file-contents)
(mel-define-method-function (mime-write-decoded-region
start end filename (nil "7bit"))
- 'write-region-as-binary)
+ 'binary-write-region)
(mel-define-backend "8bit" ("7bit"))
(insert (base64-encode-string
(with-temp-buffer
(set-buffer-multibyte nil)
- (insert-file-contents-as-binary filename)
+ (binary-insert-file-contents filename)
(buffer-string))))
(or (bolp) (insert ?\n)))
- (mel-define-method-function (encoded-text-encode-string string (nil "B"))
- 'base64-encode-string)
+ ;; (mel-define-method-function (encoded-text-encode-string string (nil "B"))
+ ;; 'base64-encode-string)
(mel-define-method encoded-text-decode-string (string (nil "B"))
(if (string-match (eval-when-compile
(concat "\\`" B-encoded-text-regexp "\\'"))
the STRING by its value."
(let ((f (mel-find-function 'mime-decode-string encoding)))
(if f
- (condition-case nil
- (funcall f string)
- (error
- (message "Wrong Content-Transfer-Encoding: %s"
- encoding)
- string))
+ (funcall f string)
string)))
-(mel-define-service encoded-text-encode-string (string encoding)
- "Encode STRING as encoded-text using ENCODING. ENCODING must be string.")
+(mel-define-service encoded-text-encode-string)
+(defun encoded-text-encode-string (string encoding &optional mode)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.
+Optional argument MODE allows `text', `comment', `phrase' or nil.
+Default value is `phrase'."
+ (if (string= encoding "B")
+ (base64-encode-string string 'no-line-break)
+ (let ((f (mel-find-function 'encoded-text-encode-string encoding)))
+ (if f
+ (funcall f string mode)
+ string))))
(mel-define-service encoded-text-decode-string (string encoding)
"Decode STRING as encoded-text using ENCODING. ENCODING must be string.")
;;; Code:
-(require 'poe)
-(require 'poem)
-(require 'pcustom)
+(require 'custom)
(require 'mcharset)
(require 'alist)
)
(eval-and-compile
- (defconst mime-library-product ["SLIM" (1 14 4) "\e$BA0ED0&\e(B"]
+ (defconst mime-library-product ["SLIM" (1 14 4) "\e$(BA0ED0&\e(B"]
"Product name, version number and code name of MIME-library package."))
(defmacro mime-product-name (product)
;;; @ variables
;;;
-(require 'custom)
-
(defgroup mime '((default-mime-charset custom-variable))
"Emacs MIME Interfaces"
:group 'news
:type '(repeat string))
+;;; @@ for encoded-word
+;;;
+
+(defgroup mime-header nil
+ "Header representation, specially encoded-word"
+ :group 'mime)
+
+;;; @@@ decoding
+;;;
+
+(defcustom mime-field-decoding-max-size 1000
+ "*Max size to decode header field."
+ :group 'mime-header
+ :type '(choice (integer :tag "Limit (bytes)")
+ (const :tag "Don't limit" nil)))
+
+;;; @@@ encoding
+;;;
+
+(defcustom mime-field-encoding-method-alist
+ '(("X-Nsubject" . iso-2022-jp-2)
+ ("Newsgroups" . nil)
+ ("Message-ID" . nil)
+ (t . mime)
+ )
+ "*Alist to specify field encoding method.
+Its key is field-name, value is encoding method.
+
+If method is `mime', this field will be encoded into MIME format.
+
+If method is a MIME-charset, this field will be encoded as the charset
+when it must be convert into network-code.
+
+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."
+ :group 'mime-header
+ :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)))))
+
+
;;; @ required functions
;;;
(defsubst regexp-or (&rest args)
(concat "\\(" (mapconcat (function identity) args "\\|") "\\)"))
+(or (fboundp 'char-int)
+ (defalias 'char-int 'identity))
+
;;; @ about STD 11
;;;
(cdr (car content-type)))
(defsubst mime-content-type-subtype (content-type)
- "Return primary-type of CONTENT-TYPE."
+ "Return subtype of CONTENT-TYPE."
(cdr (cadr content-type)))
(defsubst mime-content-type-parameters (content-type)
- "Return primary-type of CONTENT-TYPE."
+ "Return parameters of CONTENT-TYPE."
(cddr content-type))
(defsubst mime-content-type-parameter (content-type parameter)
;;; Code:
(require 'mime-def)
+(require 'luna)
(require 'std11)
(autoload 'mime-entity-body-buffer "mime")
(eval-and-compile
-(autoload 'eword-encode-header "eword-encode"
+(autoload 'mime-encode-header-in-buffer "eword-encode"
"Encode header fields to network representation, such as MIME encoded-word.")
(autoload 'mime-parse-Content-Type "mime-parse"
)
+(autoload 'mime-encode-field-body "eword-encode"
+ "Encode FIELD-BODY as FIELD-NAME, and return the result.")
+
+
;;; @ Entity Representation and Implementation
;;;
;;;
(defun mime-entity-children (entity)
+ "Return list of entities included in the ENTITY."
(or (mime-entity-children-internal entity)
(luna-send entity 'mime-entity-children entity)))
(defun mime-entity-node-id (entity)
+ "Return node-id of ENTITY."
(mime-entity-node-id-internal entity))
(defun mime-entity-number (entity)
;; (make-obsolete 'mime-fetch-field 'mime-entity-fetch-field)
(defun mime-entity-content-type (entity)
+ "Return content-type of ENTITY."
(or (mime-entity-content-type-internal entity)
(let ((ret (mime-entity-fetch-field entity "Content-Type")))
(if ret
))))
(defun mime-entity-content-disposition (entity)
+ "Return content-disposition of ENTITY."
(or (mime-entity-content-disposition-internal entity)
(let ((ret (mime-entity-fetch-field entity "Content-Disposition")))
(if ret
))))
(defun mime-entity-encoding (entity &optional default-encoding)
+ "Return content-transfer-encoding of ENTITY.
+If the ENTITY does not have Content-Transfer-Encoding field, this
+function returns DEFAULT-ENCODING. If it is nil, \"7bit\" is used as
+default value."
(or (mime-entity-encoding-internal entity)
(let ((ret (mime-entity-fetch-field entity "Content-Transfer-Encoding")))
(mime-entity-set-encoding-internal
(defsubst mime-entity-media-type (entity)
+ "Return primary media-type of ENTITY."
(mime-content-type-primary-type (mime-entity-content-type entity)))
+
(defsubst mime-entity-media-subtype (entity)
+ "Return media-subtype of ENTITY."
(mime-content-type-subtype (mime-entity-content-type entity)))
+
(defsubst mime-entity-parameters (entity)
+ "Return parameters of Content-Type of ENTITY."
(mime-content-type-parameters (mime-entity-content-type entity)))
+
(defsubst mime-entity-type/subtype (entity-info)
+ "Return type/subtype of Content-Type of ENTITY."
(mime-type/subtype-string (mime-entity-media-type entity-info)
(mime-entity-media-subtype entity-info)))
(defun mime-entity-set-content-type (entity content-type)
+ "Set ENTITY's content-type to CONTENT-TYPE."
(mime-entity-set-content-type-internal entity content-type))
(defun mime-entity-set-encoding (entity encoding)
+ "Set ENTITY's content-transfer-encoding to ENCODING."
(mime-entity-set-encoding-internal entity encoding))
(luna-define-method mime-write-entity ((entity mime-buffer-entity) filename)
(save-excursion
(set-buffer (mime-buffer-entity-buffer-internal entity))
- (write-region-as-raw-text-CRLF
- (mime-buffer-entity-header-start-internal entity)
- (mime-buffer-entity-body-end-internal entity)
- filename)
- ))
+ (let ((coding-system-for-write 'raw-text-dos))
+ (write-region (mime-buffer-entity-header-start-internal entity)
+ (mime-buffer-entity-body-end-internal entity)
+ filename))))
;;; @ entity header
filename)
(save-excursion
(set-buffer (mime-buffer-entity-buffer-internal entity))
- (write-region-as-binary (mime-buffer-entity-body-start-internal entity)
- (mime-buffer-entity-body-end-internal entity)
- filename)
- ))
+ (binary-write-region (mime-buffer-entity-body-start-internal entity)
+ (mime-buffer-entity-body-end-internal entity)
+ filename)))
;;; @ entity content
;;; @ children
;;;
-(defun mmbuffer-parse-multipart (entity)
+(defun mmbuffer-parse-multipart (entity &optional representation-type)
(with-current-buffer (mime-buffer-entity-buffer-internal entity)
- (let* ((representation-type
- (mime-entity-representation-type-internal entity))
- (content-type (mime-entity-content-type-internal entity))
+ (or representation-type
+ (setq representation-type
+ (mime-entity-representation-type-internal entity)))
+ (let* ((content-type (mime-entity-content-type-internal entity))
(dash-boundary
(concat "--"
(mime-content-type-parameter content-type "boundary")))
nil)
))))
-(defun mmbuffer-parse-encapsulated (entity &optional external)
+(defun mmbuffer-parse-encapsulated (entity &optional external
+ representation-type)
(mime-entity-set-children-internal
entity
(with-current-buffer (mime-buffer-entity-buffer-internal entity)
(progn
(require 'mmexternal)
'mime-external-entity)
- (mime-entity-representation-type-internal entity))
+ (or representation-type
+ (mime-entity-representation-type-internal entity)))
nil
entity (cons 0 (mime-entity-node-id-internal entity))))))))
+++ /dev/null
-;;; mmdual.el --- MIME entity module for dual buffers
-
-;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
-
-;; Author: MORIOKA Tomohiko <tomo@m17n.org>
-;; Keywords: MIME, multimedia, mail, news
-
-;; 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
-;; published by the Free Software Foundation; either version 2, or (at
-;; your option) any later version.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Code:
-
-(require 'mime)
-
-(eval-and-compile
- (luna-define-class mime-dual-entity (mime-entity)
- (header-buffer
- body-buffer))
-
- (luna-define-internal-accessors 'mime-dual-entity)
- )
-
-(luna-define-method initialize-instance :after ((entity mime-dual-entity)
- &rest init-args)
- (let ((buf (mime-dual-entity-header-buffer-internal entity)))
- (if buf
- (with-current-buffer buf
- (or (mime-entity-content-type-internal entity)
- (mime-entity-set-content-type-internal
- entity
- (let ((str (std11-fetch-field "Content-Type")))
- (if str
- (mime-parse-Content-Type str)
- )))))))
- entity)
-
-(luna-define-method mime-entity-name ((entity mime-dual-entity))
- (buffer-name (mime-dual-entity-header-buffer-internal entity))
- )
-
-
-(luna-define-method mime-insert-header ((entity mime-dual-entity)
- &optional invisible-fields
- visible-fields)
- (let* ((buf (mime-dual-entity-header-buffer-internal entity))
- header-start header-end)
- (with-current-buffer buf
- (setq header-start (point-min)
- header-end (point-max)))
- (mime-insert-header-from-buffer buf header-start header-end
- invisible-fields visible-fields)
- ))
-
-(luna-define-method mime-entity-content ((entity mime-dual-entity))
- (mime-decode-string
- (with-current-buffer (mime-dual-entity-body-buffer-internal entity)
- (buffer-string))
- (mime-entity-encoding entity)))
-
-(luna-define-method mime-entity-fetch-field :around
- ((entity mime-dual-entity) field-name)
- (or (luna-call-next-method)
- (with-current-buffer (mime-dual-entity-header-buffer-internal entity)
- (let ((ret (std11-fetch-field field-name)))
- (when ret
- (or (symbolp field-name)
- (setq field-name
- (intern (capitalize (capitalize field-name)))))
- (mime-entity-set-original-header-internal
- entity
- (put-alist field-name ret
- (mime-entity-original-header-internal entity)))
- ret)))))
-
-(luna-define-method mime-insert-entity-content ((entity mime-dual-entity))
- (insert
- (mime-decode-string
- (with-current-buffer (mime-dual-entity-body-buffer-internal entity)
- (buffer-substring (point-min)(point-max)))
- (mime-entity-encoding entity))))
-
-(luna-define-method mime-write-entity-content ((entity mime-dual-entity)
- filename)
- (with-current-buffer (mime-dual-entity-body-buffer-internal entity)
- (mime-write-decoded-region (point-min)
- (point-max)
- filename
- (or (mime-entity-encoding entity) "7bit"))))
-
-(luna-define-method mime-insert-entity ((entity mime-dual-entity))
- (let (buf)
- (setq buf (mime-dual-entity-header-buffer-internal entity))
- (when buf
- (insert-buffer (mime-dual-entity-header-buffer-internal entity))
- (setq buf (mime-dual-entity-body-buffer-internal entity))
- (when buf
- (insert "\n")
- (insert-buffer buf)))))
-
-(luna-define-method mime-write-entity ((entity mime-dual-entity) filename)
- (let (buf)
- (setq buf (mime-dual-entity-header-buffer-internal entity))
- (if (null buf)
- (error "No header buffer.")
- (with-current-buffer buf
- (write-region-as-raw-text-CRLF
- (point-min)(point-max) filename))
- (setq buf (mime-dual-entity-body-buffer-internal entity))
- (when buf
- (with-temp-buffer
- (insert "\n")
- (write-region-as-raw-text-CRLF
- (point-min)(point-max)
- filename 'append))
- (with-current-buffer buf
- (write-region-as-raw-text-CRLF
- (point-min)(point-max)
- filename 'append))))))
-
-(luna-define-method mime-write-entity-body ((entity mime-dual-entity) filename)
- (with-current-buffer (mime-dual-entity-body-buffer-internal entity)
- (write-region-as-binary (point-min)(point-max)
- filename)))
-
-
-;;; @ buffer
-;;;
-
-(luna-define-method mime-entity-header-buffer ((entity mime-dual-entity))
- (mime-dual-entity-header-buffer-internal entity))
-
-(luna-define-method mime-entity-body-buffer ((entity mime-dual-entity))
- (mime-dual-entity-body-buffer-internal entity))
-
-(luna-define-method mime-entity-buffer ((entity mime-dual-entity))
- (message "mime-dual-entity does not have mime-entity-buffer.")
- nil)
-
-(luna-define-method mime-entity-body-start-point ((entity mime-dual-entity))
- (with-current-buffer (mime-entity-body-buffer entity)
- (point-min)))
-
-(luna-define-method mime-entity-body-end-point ((entity mime-dual-entity))
- (with-current-buffer (mime-entity-body-buffer entity)
- (point-max)))
-
-(luna-define-method mime-entity-point-min ((entity mime-dual-entity))
- (message "mime-dual-entity does not have mime-entity-point-min.")
- nil)
-
-(luna-define-method mime-entity-point-max ((entity mime-dual-entity))
- (message "mime-dual-entity does not have mime-entity-point-max.")
- nil)
-
-(luna-define-method mime-goto-header-start-point ((entity mime-dual-entity))
- (set-buffer (mime-dual-entity-header-buffer-internal entity))
- (goto-char (point-min)))
-
-(luna-define-method mime-goto-body-start-point ((entity mime-dual-entity))
- (set-buffer (mime-dual-entity-body-buffer-internal entity))
- (goto-char (point-min)))
-
-(luna-define-method mime-goto-body-end-point ((entity mime-dual-entity))
- (set-buffer (mime-dual-entity-body-buffer-internal entity))
- (goto-char (point-max)))
-
-
-;;; @ end
-;;;
-
-(provide 'mmdual)
-
-;;; mmdual.el ends here
;;; Code:
+(require 'mmgeneric)
(require 'mime)
-(require 'pces)
(eval-and-compile
(luna-define-class mime-external-entity (mime-entity)
(concat " *Body of "
(mime-entity-name entity)
"*"))
- (insert-file-contents-as-binary
+ (binary-insert-file-contents
(mime-external-entity-body-file-internal entity))
(current-buffer))))
(error (message "Can't get external-body.")))))
(luna-define-method mime-write-entity ((entity mime-external-entity) filename)
(with-temp-buffer
(mime-insert-entity entity)
- (write-region-as-raw-text-CRLF (point-min) (point-max) filename)))
+ (let ((coding-system-for-write 'raw-text-dos))
+ (write-region (point-min) (point-max) filename))))
;;; @ entity header
filename)
(mmexternal-require-buffer entity)
(with-current-buffer (mime-external-entity-body-buffer-internal entity)
- (write-region-as-binary (point-min) (point-max) filename)))
+ (binary-write-region (point-min) (point-max) filename)))
;;; @ entity content
(require 'luna)
+(eval-when-compile
+ (require 'eword-decode) ; mime-find-field-presentation-method
+ )
+
;;; @ MIME entity
;;;
;; To send mail using QMTP instead of SMTP, do
-;; (fset 'smtp-via-smtp 'qmtp-via-qmtp)
+;; (fset 'smtp-send-buffer 'qmtp-send-buffer)
;;; Code:
-(require 'poem)
-(require 'pcustom)
+(require 'custom)
(defgroup qmtp nil
"QMTP protocol for sending mail."
:type 'integer
:group 'qmtp)
-(defvar qmtp-open-connection-function (function open-network-stream))
+(autoload 'binary-open-network-stream "raw-io")
+;;;###autoload
+(defvar qmtp-open-connection-function (function binary-open-network-stream))
(defvar qmtp-error-response-alist
'((?Z "Temporary failure")
(let (process)
(unwind-protect
(progn
- (as-binary-process
- (setq process
- (funcall qmtp-open-connection-function
- "QMTP" (current-buffer) qmtp-server qmtp-service)))
+ (setq process
+ (funcall qmtp-open-connection-function
+ "QMTP" (current-buffer) qmtp-server qmtp-service))
(qmtp-send-package process sender recipients buffer))
(when (and process
(memq (process-status process) '(open run)))
--- /dev/null
+;;; raw-io.el --- input/output without code-conversion
+
+;; Copyright (C) 1997,1998,1999,2000 Free Software Foundation, Inc.
+
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
+;; Keywords: definition, MIME, multimedia, mail, news
+
+;; This file is part of APEL (A Portable Emacs Library).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+(eval-when-compile (require 'static))
+
+(static-if (and (featurep 'xemacs)
+ (not (featurep 'utf-2000)))
+ (defun binary-insert-file-contents (filename
+ &optional visit beg end replace)
+ "Like `insert-file-contents', but only reads in the file literally.
+A buffer may be modified in several ways after reading into the buffer,
+to Emacs features such as format decoding, character code
+conversion, find-file-hooks, automatic uncompression, etc.
+
+This function ensures that none of these modifications will take place."
+ (let ((format-alist nil)
+ (after-insert-file-functions nil)
+ (coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ (jka-compr-compression-info-list nil)
+ (jam-zcat-filename-list nil)
+ (find-buffer-file-type-function
+ (if (fboundp 'find-buffer-file-type)
+ (symbol-function 'find-buffer-file-type)
+ nil)))
+ (unwind-protect
+ (progn
+ (fset 'find-buffer-file-type (lambda (filename) t))
+ (insert-file-contents filename visit beg end replace))
+ (if find-buffer-file-type-function
+ (fset 'find-buffer-file-type find-buffer-file-type-function)
+ (fmakunbound 'find-buffer-file-type)))))
+ (defalias 'binary-insert-file-contents 'insert-file-contents-literally))
+
+(defun binary-write-region (start end filename
+ &optional append visit lockname)
+ "Like `write-region', q.v., but don't encode."
+ (let ((coding-system-for-write 'binary)
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end filename append visit lockname)))
+
+(defun binary-find-file-noselect (filename &optional nowarn rawfile)
+ "Like `find-file-noselect', q.v., but don't code and format conversion."
+ (let ((coding-system-for-read 'binary)
+ format-alist)
+ (find-file-noselect filename nowarn rawfile)))
+
+(defun binary-open-network-stream (name buffer host service &rest options)
+ "Like `open-network-stream', q.v., but don't code and format conversion."
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply #'open-network-stream name buffer host service options)))
+
+(defun binary-start-process (name buffer program &rest program-args)
+ "Like `start-process', q.v., but don't code conversion."
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply #'start-process name buffer program program-args)))
+
+(defun binary-start-process-shell-command (name buffer &rest args)
+ "Like `start-process-shell-command', q.v., but don't code conversion."
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply #'start-process-shell-command name buffer args)))
+
+
+(defun raw-text-insert-file-contents (filename
+ &optional visit beg end replace)
+ "Like `insert-file-contents', q.v., but don't code and format conversion.
+Like `insert-file-contents-literary', but it allows find-file-hooks,
+automatic uncompression, etc.
+Like `binary-insert-file-contents', but it converts line-break
+code."
+ (let ((coding-system-for-read 'raw-text)
+ format-alist)
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents filename visit beg end replace)))
+
+
+(defun raw-message-write-region (start end filename
+ &optional append visit lockname)
+ "Like `write-region', q.v., but write as network representation."
+ (let ((coding-system-for-write 'raw-text-dos)
+ format-alist)
+ (write-region start end filename append visit lockname)))
+
+
+;;; @ end
+;;;
+
+(provide 'raw-io)
+
+;;; raw-io.el ends here
(require 'hex-util)
(eval-when-compile
- (defun-maybe sha1-string (a)))
+ (or (fboundp 'sha1-string)
+ (defun sha1-string (a))))
(defvar sha1-dl-module
(if (and (fboundp 'sha1-string)
;;; Code:
-(require 'pces)
-(require 'pcustom)
+(require 'custom)
(require 'mail-utils) ; mail-strip-quoted-names
(require 'sasl)
+(require 'luna)
(defgroup smtp nil
"SMTP protocol for sending mail."
:group 'smtp-extensions)
(defvar sasl-mechanisms)
-
-(defvar smtp-open-connection-function #'open-network-stream)
+
+(autoload 'binary-open-network-stream "raw-io")
+;;;###autoload
+(defvar smtp-open-connection-function #'binary-open-network-stream)
(defvar smtp-read-point nil)
(defvar smtp-submit-package-function #'smtp-submit-package)
-;;; @ SMTP package structure
+;;; @ SMTP package
;;; A package contains a mail message, an envelope sender address,
;;; and one or more envelope recipient addresses. In ESMTP model
;;; the current sending package should be guaranteed to be accessible
;;; anywhere from the hook methods (or SMTP commands).
-(defmacro smtp-package-sender (package)
- "Return the sender of PACKAGE, a string."
- `(aref ,package 0))
-
-(defmacro smtp-package-recipients (package)
- "Return the recipients of PACKAGE, a list of strings."
- `(aref ,package 1))
+(eval-and-compile
+ (luna-define-class smtp-package ()
+ (sender
+ recipients
+ buffer))
-(defmacro smtp-package-buffer (package)
- "Return the data of PACKAGE, a buffer."
- `(aref ,package 2))
+ (luna-define-internal-accessors 'smtp-package))
-(defmacro smtp-make-package (sender recipients buffer)
+(defun smtp-make-package (sender recipients buffer)
"Create a new package structure.
A package is a unit of SMTP message
SENDER specifies the package sender, a string.
RECIPIENTS is a list of recipients.
BUFFER may be a buffer or a buffer name which contains mail message."
- `(vector ,sender ,recipients ,buffer))
+ (luna-make-entity 'smtp-package :sender sender :recipients recipients :buffer buffer))
-(defun smtp-package-buffer-size (package)
+(defun smtp-package-buffer-internal-size (package)
"Return the size of PACKAGE, an integer."
(save-excursion
- (set-buffer (smtp-package-buffer package))
+ (set-buffer (smtp-package-buffer-internal package))
(let ((size
(+ (buffer-size)
;; Add one byte for each change-of-line
(setq size (1+ size)))
size)))
-;;; @ SMTP connection structure
+;;; @ SMTP connection
;;; We should consider the function `open-network-stream' is a emulation
;;; for another network stream. They are likely to be implemented with an
;;; external program and the function `process-contact' returns the
;;; process id instead of `(HOST SERVICE)' pair.
-(defmacro smtp-connection-process (connection)
- "Return the subprocess-object of CONNECTION."
- `(aref ,connection 0))
-
-(defmacro smtp-connection-server (connection)
- "Return the server of CONNECTION, a string."
- `(aref ,connection 1))
-
-(defmacro smtp-connection-service (connection)
- "Return the service of CONNECTION, a string or an integer."
- `(aref ,connection 2))
-
-(defmacro smtp-connection-extensions (connection)
- "Return the SMTP extensions of CONNECTION, a list of strings."
- `(aref ,connection 3))
+(eval-and-compile
+ (luna-define-class smtp-connection ()
+ (process
+ server
+ service
+ extensions
+ encoder
+ decoder))
-(defmacro smtp-connection-set-extensions (connection extensions)
- "Set the SMTP extensions of CONNECTION.
-EXTENSIONS is a list of cons cells of the form \(EXTENSION . PARAMETERS).
-Where EXTENSION is a symbol and PARAMETERS is a list of strings."
- `(aset ,connection 3 ,extensions))
+ (luna-define-internal-accessors 'smtp-connection))
-(defmacro smtp-make-connection (process server service)
+(defun smtp-make-connection (process server service)
"Create a new connection structure.
PROCESS is an internal subprocess-object. SERVER is name of the host
to connect to. SERVICE is name of the service desired."
- `(vector ,process ,server ,service nil))
+ (luna-make-entity 'smtp-connection :process process :server server :service service))
+
+(luna-define-generic smtp-connection-opened (connection)
+ "Say whether the CONNECTION to server has been opened.")
-(defun smtp-connection-opened (connection)
- "Say whether the CONNECTION to server has been opened."
- (let ((process (smtp-connection-process connection)))
+(luna-define-generic smtp-close-connection (connection)
+ "Close the CONNECTION to server.")
+
+(luna-define-method smtp-connection-opened ((connection smtp-connection))
+ (let ((process (smtp-connection-process-internal connection)))
(if (memq (process-status process) '(open run))
t)))
-(defun smtp-close-connection (connection)
- "Close the CONNECTION to server."
- (let ((process (smtp-connection-process connection)))
+(luna-define-method smtp-close-connection ((connection smtp-connection))
+ (let ((process (smtp-connection-process-internal connection)))
(delete-process process)))
(defun smtp-make-fqdn ()
BUFFER is the buffer to associate with the connection. SERVER is name
of the host to connect to. SERVICE is name of the service desired."
(let ((process
- (as-binary-process
- (funcall smtp-open-connection-function
- "SMTP" buffer server service)))
+ (funcall smtp-open-connection-function
+ "SMTP" buffer server service))
connection)
(when process
(setq connection (smtp-make-connection process server service))
;;;###autoload
(defun smtp-via-smtp (sender recipients buffer)
+ "Like `smtp-send-buffer', but sucks in any errors."
(condition-case nil
(progn
(smtp-send-buffer sender recipients buffer)
;;;###autoload
(defun smtp-send-buffer (sender recipients buffer)
+ "Send a message.
+SENDER is an envelope sender address.
+RECIPIENTS is a list of envelope recipient addresses.
+BUFFER may be a buffer or a buffer name which contains mail message."
(let ((server
(if (functionp smtp-server)
(funcall smtp-server sender recipients)
(let* ((connection
(smtp-find-connection (current-buffer)))
(response
- (smtp-read-response
- (smtp-connection-process connection))))
+ (smtp-read-response connection)))
(if (/= (car response) 220)
(smtp-response-error response))))
(defun smtp-primitive-ehlo (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
response)
- (smtp-send-command process (format "EHLO %s" (smtp-make-fqdn)))
- (setq response (smtp-read-response process))
+ (smtp-send-command connection (format "EHLO %s" (smtp-make-fqdn)))
+ (setq response (smtp-read-response connection))
(if (/= (car response) 250)
(smtp-response-error response))
- (smtp-connection-set-extensions
+ (smtp-connection-set-extensions-internal
connection (mapcar
(lambda (extension)
(let ((extensions
(defun smtp-primitive-helo (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
response)
- (smtp-send-command process (format "HELO %s" (smtp-make-fqdn)))
- (setq response (smtp-read-response process))
+ (smtp-send-command connection (format "HELO %s" (smtp-make-fqdn)))
+ (setq response (smtp-read-response connection))
(if (/= (car response) 250)
(smtp-response-error response))))
(defun smtp-primitive-auth (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
(mechanisms
- (cdr (assq 'auth (smtp-connection-extensions connection))))
+ (cdr (assq 'auth (smtp-connection-extensions-internal connection))))
(sasl-mechanisms
(or smtp-sasl-mechanisms sasl-mechanisms))
(mechanism
(unless mechanism
(error "No authentication mechanism available"))
(setq client (sasl-make-client mechanism smtp-sasl-user-name "smtp"
- (smtp-connection-server connection)))
+ (smtp-connection-server-internal connection)))
(if smtp-sasl-properties
(sasl-client-set-properties client smtp-sasl-properties))
(setq name (sasl-mechanism-name mechanism)
;; Retrieve the initial response
step (sasl-next-step client nil))
(smtp-send-command
- process
+ connection
(if (sasl-step-data step)
(format "AUTH %s %s" name (base64-encode-string (sasl-step-data step) t))
(format "AUTH %s" name)))
(catch 'done
(while t
- (setq response (smtp-read-response process))
+ (setq response (smtp-read-response connection))
(when (= (car response) 235)
;; The authentication process is finished.
(setq step (sasl-next-step client step))
(sasl-step-set-data step (base64-decode-string (nth 1 response)))
(setq step (sasl-next-step client step))
(smtp-send-command
- process (if (sasl-step-data step)
- (base64-encode-string (sasl-step-data step) t)
- ""))))))
+ connection
+ (if (sasl-step-data step)
+ (base64-encode-string (sasl-step-data step) t)
+ ""))))
+;;; (smtp-connection-set-encoder-internal
+;;; connection (sasl-client-encoder client))
+;;; (smtp-connection-set-decoder-internal
+;;; connection (sasl-client-decoder client))
+ ))
(defun smtp-primitive-starttls (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
response)
;; STARTTLS --- begin a TLS negotiation (RFC 2595)
- (smtp-send-command process "STARTTLS")
- (setq response (smtp-read-response process))
+ (smtp-send-command connection "STARTTLS")
+ (setq response (smtp-read-response connection))
(if (/= (car response) 220)
(smtp-response-error response))
- (starttls-negotiate process)
+ (starttls-negotiate (smtp-connection-process-internal connection))
;; for sendmail warning XXX
(smtp-primitive-helo package)))
(defun smtp-primitive-mailfrom (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
(extensions
- (smtp-connection-extensions
+ (smtp-connection-extensions-internal
connection))
(sender
- (smtp-package-sender package))
+ (smtp-package-sender-internal package))
extension
response)
;; SIZE --- Message Size Declaration (RFC1870)
(if (and smtp-use-size
(assq 'size extensions))
- (setq extension (format "SIZE=%d" (smtp-package-buffer-size package))))
+ (setq extension (format "SIZE=%d" (smtp-package-buffer-internal-size package))))
;; 8BITMIME --- 8bit-MIMEtransport (RFC1652)
(if (and smtp-use-8bitmime
(assq '8bitmime extensions))
(setq extension (concat extension " BODY=8BITMIME")))
(smtp-send-command
- process
+ connection
(if extension
(format "MAIL FROM:<%s> %s" sender extension)
(format "MAIL FROM:<%s>" sender)))
- (setq response (smtp-read-response process))
+ (setq response (smtp-read-response connection))
(if (/= (car response) 250)
(smtp-response-error response))))
(defun smtp-primitive-rcptto (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
(recipients
- (smtp-package-recipients package))
+ (smtp-package-recipients-internal package))
response)
(while recipients
(smtp-send-command
- process (format "RCPT TO:<%s>" (pop recipients)))
- (setq response (smtp-read-response process))
+ connection (format "RCPT TO:<%s>" (pop recipients)))
+ (setq response (smtp-read-response connection))
(unless (memq (car response) '(250 251))
(smtp-response-error response)))))
(defun smtp-primitive-data (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
response)
- (smtp-send-command process "DATA")
- (setq response (smtp-read-response process))
+ (smtp-send-command connection "DATA")
+ (setq response (smtp-read-response connection))
(if (/= (car response) 354)
(smtp-response-error response))
(save-excursion
- (set-buffer (smtp-package-buffer package))
+ (set-buffer (smtp-package-buffer-internal package))
(goto-char (point-min))
(while (not (eobp))
(smtp-send-data
- process (buffer-substring (point) (progn (end-of-line)(point))))
+ connection (buffer-substring (point) (progn (end-of-line)(point))))
(beginning-of-line 2)))
- (smtp-send-command process ".")
- (setq response (smtp-read-response process))
+ (smtp-send-command connection ".")
+ (setq response (smtp-read-response connection))
(if (/= (car response) 250)
(smtp-response-error response))))
(defun smtp-primitive-quit (package)
(let* ((connection
(smtp-find-connection (current-buffer)))
- (process
- (smtp-connection-process connection))
response)
- (smtp-send-command process "QUIT")
- (setq response (smtp-read-response process))
+ (smtp-send-command connection "QUIT")
+ (setq response (smtp-read-response connection))
(if (/= (car response) 221)
(smtp-response-error response))))
(defun smtp-response-error (response)
(signal 'smtp-response-error response))
-(defun smtp-read-response (process)
- (let ((response-continue t)
+(defun smtp-read-response (connection)
+ (let ((decoder
+ (smtp-connection-decoder-internal connection))
+ (response-continue t)
response)
(while response-continue
(goto-char smtp-read-point)
(while (not (search-forward "\r\n" nil t))
- (accept-process-output process)
+ (accept-process-output (smtp-connection-process-internal connection))
(goto-char smtp-read-point))
+ (if decoder
+ (let ((string (buffer-substring smtp-read-point (- (point) 2))))
+ (delete-region smtp-read-point (point))
+ (insert (funcall decoder string) "\r\n")))
(setq response
(nconc response
(list (buffer-substring
response-continue nil)))
response))
-(defun smtp-send-command (process command)
+(defun smtp-send-command (connection command)
(save-excursion
- (set-buffer (process-buffer process))
- (goto-char (point-max))
- (insert command "\r\n")
- (setq smtp-read-point (point))
- (process-send-string process command)
- (process-send-string process "\r\n")))
-
-(defun smtp-send-data (process data)
- ;; Escape "." at start of a line.
- (if (eq (string-to-char data) ?.)
- (process-send-string process "."))
- (process-send-string process data)
- (process-send-string process "\r\n"))
+ (let ((process
+ (smtp-connection-process-internal connection))
+ (encoder
+ (smtp-connection-encoder-internal connection)))
+ (set-buffer (process-buffer process))
+ (goto-char (point-max))
+ (setq command (concat command "\r\n"))
+ (insert command)
+ (setq smtp-read-point (point))
+ (if encoder
+ (setq command (funcall encoder command)))
+ (process-send-string process command))))
+
+(defun smtp-send-data (connection data)
+ (let ((process
+ (smtp-connection-process-internal connection))
+ (encoder
+ (smtp-connection-encoder-internal connection)))
+ ;; Escape "." at start of a line.
+ (if (eq (string-to-char data) ?.)
+ (setq data (concat "." data "\r\n"))
+ (setq data (concat data "\r\n")))
+ (if encoder
+ (setq data (funcall encoder data)))
+ (process-send-string process data)))
(defun smtp-deduce-address-list (smtp-text-buffer header-start header-end)
"Get address list suitable for smtp RCPT TO:<address>."
;;; Code:
-(require 'poe)
-(require 'pcustom)
+(require 'custom)
(require 'smtp)
(require 'sendmail)
(require 'time-stamp)
+(require 'raw-io)
(eval-when-compile (require 'static))
(insert-buffer tembuf)
(or (file-directory-p smtpmail-queue-dir)
(make-directory smtpmail-queue-dir t))
- (write-region-as-binary (point-min) (point-max) file-data)
+ (binary-write-region (point-min) (point-max) file-data)
(set-buffer buffer-elisp)
(erase-buffer)
(insert (concat
(end-of-line)
(point))))
(load file-msg)
- (setq tembuf (find-file-noselect-as-binary file-msg))
+ (setq tembuf (binary-find-file-noselect file-msg))
(if smtpmail-recipient-address-list
(smtp-send-buffer user-mail-address
smtpmail-recipient-address-list tembuf)
;;; std11.el --- STD 11 functions for GNU Emacs
-;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: mail, news, RFC 822, STD 11
;; This file is part of FLIM (Faithful Library about Internet Message).
;;; Code:
-(require 'poe)
-(require 'poem) ; find-non-ascii-charset-string
-(require 'pcustom) ; std11-lexical-analyzer
+(require 'custom) ; std11-lexical-analyzer
;;; @ fetch
(setq token (car lal))
(or (std11-ignored-token-p token)
(if (and (setq token-value (cdr token))
- (find-non-ascii-charset-string token-value)
- )
+ (delq 'ascii (find-charset-string token-value)))
(setq token nil)
)))
(setq lal (cdr lal))