File semi-1.14.6+239+gb1c245b81715.obscpio of Package emacs-semi

07070100000000000081A4000003E80000006400000001627140E500041933000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/ChangeLog.12020-08-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Change non-ASCII text files's coding-system to UTF-8

	* ChangeLog: Likewise.

	* README.ja: Likewise.

	* VERSION: Likewise.

	* semi-def.el: Remove coding cookie.  This file is actually
	encoded in US-ASCII.

	* mime-edit.el: Likewise.

	* mime-ui-ja.texi: Assume LuaTeX for typesetting.

2020-08-10  Jan Seeger  <jan.seeger@thenybble.de>

	New variable `mime-edit-insert-file-confirm' is introduced

	When nil, don't confirm MIME parameters when inserting files.

	* mime-edit.el (mime-edit-insert-file-confirm): New variable.
	(mime-edit-insert-file, mime-edit-insert-file-as-text): Refer to
	it.

2020-08-05  Naoya Yamashita  <conao3@gmail.com>

	Fix closing parens position (cosmetic change only).
	Cf. https://github.com/wanderlust/semi/pull/21

2020-06-29  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-file-parameters): Fix typo.

2020-06-14  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Minor refactorings.

	* mime-edit.el (mime-edit-insert-file-parameters): Reduce use of
	concat functions.
	(mime-make-tag): Remove redundant codes.
	(replace-space-with-underline)
	(mime-edit-decode-single-part-in-buffer): Minor refactorings.

2020-06-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-text/plain): Revert the last
	change.  Fix the case content length is 0.

2020-06-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el: Require invisible.el explicitly.

2020-06-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* SEMI-MK: Assume Emacs 24 or later.

2020-06-03  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Use following-char and preceding-char instead of char-after and
	char-before for the current point.

	* mime-signature.el (mime-edit-signature-insert-plain)
	(mime-edit-insert-signature): Likewise.

	* mime-vcard.el (mime-display-text/vcard): Likewise.

	* mime-view.el (mime-display-text/plain-flowed)
	(mime-display-text/plain, mime-display-entity): Likewise.

2020-06-02  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Use invisibility feature directly.

	* mime-edit.el: Don't require invisible.el.
	(turn-on-mime-edit): Don't call enable-invisible function.

2020-06-02  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Strip use of function wrapping lambda.

	* mail-mime-setup.el (mime-edit-split-message-sender-alist): Likewise.

	* mime-edit.el (mime-edit-decode-single-part-in-buffer)
	(mime-edit-split-and-send, replace-space-with-underline)
	(mime-prompt-for-parameter): Likewise.

	* mime-play.el (mime-echo-window-height, mime-play-entity): Likewise.

2020-06-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-header-hook): Define explicitly.

2020-05-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-vcard.el: Suppress byte compiler warning.

2020-05-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-bbdb.el: Removed.

	* SEMI-ELS: Likewise.

	* signature.el: Likewise.

2020-05-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Use lexical binding.

	* mail-mime-setup.el: Likewise.

	* mime-bbdb.el: Likewise.

	* mime-edit.el: Likewise.

	* mime-image.el: Likewise.

	* mime-mac.el: Likewise.

	* mime-partial.el: Likewise.

	* mime-pgp.el: Likewise.

	* mime-play.el: Likewise.

	* mime-setup.el: Likewise.

	* mime-shr.el: Likewise.

	* mime-signature.el: Likewise.

	* mime-vcard.el: Likewise.

	* mime-view.el: Likewise.

	* mime-w3.el: Likewise.

	* semi-def.el: Likewise.

	* semi-setup.el: Likewise.

	* signature.el: Likewise.

2020-05-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el (mime-setup-enable-epg): Default value is always
	t.

2020-05-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Suppress byte-compiler's warnings.

	* semi-setup.el (insert-signature): Move autoload cookie to top
	level.

2020-05-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Drop old platforms support, dependency on cl.el.  Now supported
	Emacsen are version 24 and later.

	* SEMI-ELS (semi-modules-to-compile): Remove postpet.el.

	* mime-edit.el: Assuse Emacs 24 or later.
	(mime-edit-help): Use help-print-return-message instead of
	print-help-return-message
	(mime-edit-insert-file-as-text, mime-edit-insert-file): Use
	called-interactively-p instead of interactive-p.
	(mime-edit-encrypt-pgp-recipients-keys): Now arguments are CONTEXT
	and RECIPIENTS.
	(mime-edit-encrypt-pgp-mime): Caller adjusted.

	* mime-image.el: Assume Emacs 24 or later.  Don't require cl.el,
	static.el

	* mime-pgp.el (mime-edit-make-boundary): Add autoload cookie.

	* mime-view.el: Assume Emacs 24 or later.
	(mime-view-mode): Don't use mime-message-structure
	variable, which is obsolete.
	(richtext-decode): Add autoload cookie.

	* mime-w3.el: Assume Emacs 24 or later.

	* postpet.el: Removed.

	* semi-def.el: Remove dependency on cl.el.  Assume Emacs 24 or
	later.

	* semi-setup.el (mime-setup-enable-inline-html)
	(mime-html-previewer-alist): Add obsolete date.
	(mime-setup-enable-inline-image): Assume Emacs 24 or later.

2020-04-28  Tatsuya Kinoshita  <tats@debian.org>

	* mime-edit.el (mime-edit-user-agent-value): Check for
	emacs-build-number existence to handle emacs-version correctly.

2020-04-13  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el (mime-image-max-width, mime-image-max-height):
	Accept floating-point value which indicates ratio to frame pixel
	width and height, respectively.
	(mime-image-create): calculate max-width and max-height as above.

2020-04-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el (mime-image-create): Check native image scaling
	more strictly.  Fix typo.

2019-07-07  Tatsuya Kinoshita  <tats@debian.org>

	* mime-view.el (mime-display-multipart/multilingual-prefered-languages):
	Check for `get-language-info' existence.

2019-06-26  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el (mime-image-create): Update native image scaling
	checker.

2019-06-26  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Support previewing unencrypted pkcs7-mime part.

	* mime-pgp.el (mime-pgp-maybe-remove-cr): New funcion.
	(mime-pgp-decrypt-string): Use it.
	(mime-pgp-entity-string): New function.
	(mime-verify-application/*-signature-internal): Use it.
	(mime-pgp-verify-result-to-string)
	(mime-pgp-pkcs7-decrypt-enveloped-data)
	(mime-pgp-pkcs7-verify-signed-data)
	(mime-pgp-smime-type-from-situation)
	(mime-pgp-register-decrypted-buffer): New functions.
	(mime-preview-application/pgp-encrypted): Refactored.
	(mime-view-application/pkcs7-mime)
	(mime-preview-application/pkcs7-mime): Support unencrypted part.

2019-05-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-encrypt-to-self): Change default
	value to t.

2019-05-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-multipart/related-show-all-children)
	(mime-view-multipart/alternative-show-all-children): Change
	default value to t.

2019-05-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el (mime-image-normalize-xbm-buffer)
	(mime-image-read-xbm-buffer): Do not receive arguemnt nor change
	current buffer.  All callers call it with current buffer.
	(mime-image-create): Caller adjusted.

2019-05-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	New customizable variable mime-image-normalize-xbm is introduced.
	When it is nil, xbm image is not normalized but scalable.

	* mime-image.el (mime-image-normalize-xbm): New customizable
	variable.
	(mime-image-max-height, mime-image-max-width): Update docstring to
	refer to mime-image-normalize-xbm.
	(mime-image-create): Do not normalize xbm image when
	mime-image-normalize-xbm is nil.

2019-05-16  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Native image scaling support.

	* mime-image.el (mime-image-max-height, mime-image-max-width):
	Update docstring.
	(mime-image-create): Use image scaling if available.

2019-04-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-tnef.el (mime-tnef-parse): Fix the case input STRING is too
	short.

2019-03-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-tnef.el (mime-tnef-decode-string)
	(mime-tnef-decode-unicode-string): Minor refactoring.

2019-03-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Fix the case winmail.dat contains text file.
	mime-edit-insert-file-parameters requires a existing file to
	decide charset value.  By this fix, caller decides charset.

	* mime-tnef.el (mime-tnef-insert-file-parameters): New function.
	(mime-tnef-insert-file): Use it.

2018-08-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Displaying resized image is supported.  Emacs 24.4 or later with
	built-in imagemagick is required.
	* mime-image.el (mime-image-max-height, mime-image-max-width): New
	variables.
	(mime-image-create): Use them.

2018-02-11  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-multipart-descendant-button)
	(mime-display-multipart/alternative): pass situation as
	DEFAULT-SITUATION to mime-display-entity function.

2018-02-10  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Show entity's button after header when content type is message and
	child entity is not text nor multipart.

	* mime-view.el (mime-view-entity-title): prefer filename to
	Subject field.
	(mime-display-entity): If situation parameter `button-position' is
	`after', display button after header.
	(mime-display-message): Display child entitiy's button after
	header when needed.
	(mime-display-message/rfc822): New function.  Used for
	message/rfc822 and message/news entity.

2018-02-11  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Support for multipart/multilingual entity (RFC 8255).

	* mime-edit.el (mime-edit-decode-single-part-in-buffer): Keep
	Content-Language and Content-Translation-Type fields.

	* mime-view.el (mime-view-insert-entity-button): Show language
	information in button if Content-Language: header is available.
	(mime-display-multipart/multilingual-prefered-languages)
	(mime-display-multipart/multilingual-unknown-translation-type)
	(mime-display-multipart/multilingual-translation-type-score)
	(mime-display-multipart/multilingual-interactive): New varaibles.
	(mime-display-multipart/multilingual-select-interactively)
	(mime-display-multipart/multilingual-select-automatically)
	(mime-display-multipart/multilingual): New functions.

2018-02-11  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-multipart/related): Use
	mime-view-multipart-descendant-button for multipart children when
	mime-view-multipart/related-show-all-children is non-nil.

2018-02-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Workaround for Apple Mail, which may attach attachment as part of
	multipart/alternative entity.  It is hard to find the attachment
	for MIME-View mode user.  When
	mime-view-multipart/alternative-show-all-children is non-nil, such
	hidden attachment's button would appear.

	* mime-view.el
	(mime-view-multipart/alternative-show-all-children): New variable.
	(mime-view-multipart-descendant-button): New function.
	(mime-display-multipart/alternative): As above.

2016-08-14  Erik Hetzner  <egh@e6h.org>

	* mime-ui-en.texi: Add dir entry

	* mime-ui-ja.texi: Likewise

2016-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-tnef.el (mime-tnef-files): Fix corrupt result.

2016-03-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-file-charset): Use default
	parameter for completing-read.  Show default value into the
	prompt.
	(mime-prompt-for-type): Simplify result checking routine.
	(mime-prompt-for-subtype): Refactored.
	(mime-prompt-for-parameter): Use default parameter for
	completing-read.
	(mime-prompt-for-encoding): Show default value into the prompt.

2016-02-24  Erik Hetzner  <egh@e6h.org>

	* mime-edit.el (mime-prompt-for-type, mime-prompt-for-type)
	(mime-prompt-for-encoding): Use default parameter to set default
	answer.
	(mime-prompt-for-encoding): Make default optional.
	(mime-edit-insert-voice): Use `mime-prompt-for-encoding' to prompt
	user for encoding.

2016-02-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	User is now prompted whether proceed PGP/MIME encryption when
	recipient key is not available.
	* mime-edit.el (mime-edit-encrypt-pgp-ignore-missing-keys): New
	variable.
	(mime-edit-encrypt-pgp-recipients-keys): New function.
	(mime-edit-encrypt-pgp-mime): Use them.

2016-01-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-encrypt-pgp-mime): Do not let-bind
	variable for mime-edit-make-encrypt-recipient-header here.
	(mime-edit-make-encrypt-recipient-header): Let-bind internal
	variable here.

2015-05-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-shr.el (mime-shr-preview-text/html): Workaround for
	shr-insert-document.
	Cf. https://github.com/wanderlust/semi/issues/11

2015-05-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-tnef.el (mime-tnef-insert-file): Fix for non-ASCII filename.
	(mime-display-application/ms-tnef): Adjusted.

2015-05-16  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Experimental support of application/ms-tnef entity.
	* mime-edit.el (mime-content-types): Add entries for ms-tnef
	subtype.
	(mime-file-types): Add entry for winmail.dat.

	* mime-tnef.el: New file.

	* semi-setup.el: Define preview condition for application/ms-ntef
	entity.

	* SEMI-ELS (semi-modules-to-compile): Add mime-tnef.el.

2015-05-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-get-signers): Search epg-key from
	From: field's mail address with exact match.

2015-05-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-make-encrypt-recipient-header): Car of
	return vale is now expanded list of mail addresses and key-id.
	Enclose mail addresses with '<' and '>'.
	Cf. https://github.com/wanderlust/semi/issues/9
	(mime-edit-encrypt-pgp-mime): Adjusted.

2015-05-03  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-make-encrypt-recipient-header): Handle
	multiple same name fields.

2015-05-03  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Fix for CCL unusable environments.
	* mime-edit.el (mime-edit-normalize-eol-crlf): Define for only CCL
	usable environment.
	(mime-edit-sign-pgp-mime): Use elisp routine for CCL unusable
	environments.

2015-02-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-make-encrypt-recipient-header): Returns
	cons of recipients list and header string.  Pick recipients more
	strictly.
	(mime-edit-encrypt-pgp-mime, mime-edit-encrypt-smime): Adjusted.

2014-11-09  Erik Hetzner <egh@e6h.org>

	* semi-pkg.el: New file.

2014-11-09  Erik Hetzner <egh@e6h.org>

	* mime-ui-en.texi: Fix headers and missing cross-references.

	* mime-ui-ja.texi: Likewise.

	* mime-ui-en.sgml: Removed.

	* mime-ui-ja.sgml: Removed.

2014-10-26  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-verify-application/*-signature): Set
	epa-info-buffer's buffer to the current buffer when the buffer is
	displyed.
	(mime-decrypt-application/pgp-encrypted): Remove unused code.

2014-10-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-add-application/pgp-keys): Prompt before
	import.  Show result.

	* mime-edit.el (mime-edit-insert-key): Really insert keys.

2014-09-13  Erik Hetzner  <egh@e6h.org>

	* mime-play.el (mime-activate-mailcap-method): Bind
	process-connection-type to nil while starting external process.
	Cf. https://github.com/wanderlust/semi/pull/5

2014-09-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-decrypt-string)
	(mime-verify-application/*-signature-internal): Bind
	inhibit-eol-conversion to nil while eol conversion.

2014-09-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-parse): Require mime-parse.el.

2014-08-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-translate-single-part-tag): Fix the last
	change.

2014-08-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-split-and-send): Do not use
	`insert-buffer' and `goto-line'.

2014-08-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-get-signers): Fix `mapcar' called
	for effect.

2014-08-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el (mime-image-normalize-xbm-buffer): Add comment for
	using save-excursion+set-buffer.

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Likewise.

	* mime-view.el (mime-view-buffer)
	(mime-preview-follow-current-entity): Likewise.

	* semi-def.el (mime-button-dispatcher): Likewise.

2014-08-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-split-and-send): Use
	`with-current-buffer' rather than save-excursion+set-buffer.

	* mime-play.el (mime-store-message/partial-piece): Likewise.

	* mime-view.el (mime-preview-original-major-mode)
	(mime-maybe-hide-echo-buffer)
	(mime-preview-follow-current-entity): Likewise.

2014-08-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-process-multipart-1)
	(mime-edit-translate-single-part-tag)
	(mime-edit-decode-single-part-in-buffer): Remove concat from
	insert and concat combination.

	* mime-view.el (mime-preview-follow-current-entity): Likewise.

	* semi-def.el (mime-insert-button): Likewise.

2014-08-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-convert-lbt-string): Refactored.

2014-08-29  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-get-signers): Prefer
	mime-edit-pgp-signers's key to the first found key for the same
	user ID.
	(mime-edit-pgp-signers): Update docstring.

2014-05-30  Juliusz Chroboczek  <jch@pps.univ-paris-diderot.fr>

	* mime-view.el (mime-display-multipart/alternative): Pick and
	display the latter part when there are multiple parts which have
	the highest score.
	Cf. https://github.com/wanderlust/wanderlust/issues/60

2014-04-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-text/plain): Check parameter's value
	case insensitively.

2014-04-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-preview-fill-flowed-text)
	(mime-preview-fill-flowed-text-delsp): Abolished.  Internal
	decoder is always available.
	(mime-display-text/plain-flowed-fill-column): New variable.
	(mime-display-text/plain-flowed-parse-line)
	(mime-display-text/plain-flowed): New functions.
	(mime-display-text/plain): Use them.

2014-04-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* SEMI-MK (compile-semi): Set mime-situation-examples-file to nil.

	* mime-view.el: Do not modify mime-situation-examples-file's value.

2014-04-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-define-keymap): Use mapc instead of
	mapcar for side effect.

2014-03-15  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Set up for previewing
	application/x-pkcs7-signature part.

2014-02-21  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-normalize-eol-crlf): New CCL program.
	(mime-edit-sign-pgp-mime): Use it to improve speed.

	* mime-pgp.el (mime-pgp-decrypt-string)
	(mime-verify-application/*-signature-internal): Refactored.

2014-02-15  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-entity): Add comment.

2014-02-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Remove preview setting for multipart/signed part.
	Use mime-pgp-verify-when-preview and mime-pgp-decrypt-when-preview
	to define visibility conditions.

	* mime-view.el (mime-display-entity): insert LF when inserted
	content does not end with LF.

	* mime-pgp.el (mime-display-multipart/signed): Removed.
	(mime-display-multipart/pgp-encrypted): Adapt to recent change.

2014-02-11  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Set up for previewing application/pkcs7-mime
	part.

	* mime-view.el (mime-pgp-verify-when-preview)
	(mime-pgp-decrypt-when-preview): Moved from mime-pgp.el.
	(mime-display-entity-visible-p): New function.
	(mime-display-entity): function, variable, t, and nil are
	acceptable for situation of entity-button, header and body.
	Function will receive one argument SITUATION and return visible,
	invisible, t or nil.

	* mime-pgp.el (mime-pgp-verify-when-preview)
	(mime-pgp-decrypt-when-preview): Moved to mime-view.el.
	(mime-preview-application/pkcs7-mime): New function.

2014-02-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-preview-application/pgp-encrypted): Handle
	errors in decryption.

2014-02-06  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-decrypt-string): New function.
	(mime-decrypt-application/pgp-encrypted)
	(mime-preview-application/pgp-encrypted)
	(mime-view-application/pkcs7-mime): Use it.  Remove CRs at EOL
	from result when there is CR at the first EOL.

2014-01-31  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: S/MIME signed entity respects
	mime-pgp-verify-when-preview's value.

	* mime-pgp.el (mime-display-multipart/signed): Renamed from
	mime-display-multipart/pgp-signed.  Support S/MIME signed entity.

2014-01-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-verify-when-preview): Set default to t.

2014-01-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-verify-when-preview): New customizable
	variable.
	(mime-display-multipart/pgp-signed): New function.

	* semi-setup.el: Add setting for pgp-signed entity.

2014-01-27  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Add setting for previewing
	application/pkcs7-signature entity.

	* mime-pgp.el (mime-preview-application/*-signature): Handle errors.

2014-01-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-preview-message): Switch to the original
	buffer when translation fails.  Moreover, kill temporary buffer
	if mime-edit-debug is nil.

2014-01-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-debug): New variable.
	(mime-edit-translate-buffer): Do not undo if above variable is
	non-nil.

2014-01-17  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-translate-buffer): Undo buffer when
	translation fails and buffer is modified.  Do not catch
	mime-edit-error tag, because no one throws in SEMI-EPG.
	(mime-edit-sign-pgp-mime, mime-edit-encrypt-pgp-mime)
	(mime-edit-sign-smime, mime-edit-encrypt-smime): Remove
	condition-case.

2014-01-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Prevent mime-w3m-insinuate function from
	modifying mime-preview-condition and
	mime-view-type-subtype-score-alist.  Make mime-w3m-insinuate
	function to mofidy mime-view-text/html-previewer's value.

2014-01-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	More customizable text/html entity handling.  Now you can switch
	text/html entity previewer and score by modifying
	mime-view-text/html-previewer and mime-view-text/html-score
	real-time.

	* mime-view.el (mime-view-text/html-score)
	(mime-view-text/html-previewer-alist)
	(mime-view-text/html-previewer): New variables.
	(mime-preview-condition): Set up for text/html entity.
	(mime-display-text/html-previewer-params)
	(mime-display-text/html): New functions.
	(mime-view-text/html-entity-score): New function.
	(mime-view-type-subtype-score-alist): Update for text/html entity.

	* semi-setup.el (mime-html-previewer-alist)
	(mime-setup-enable-inline-html): Obsolete.  Use
	mime-view-text/html-previewer-alist and
	mime-view-text/html-previewer respectively.

2014-01-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-type-subtype-score-alist): Accept
	variable as an alternate of score and function.  Remove
	entry for default score.
	(mime-view-entity-score): Likewise.

2014-01-12  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-entity-lowest-score): New variable.
	(mime-view-entity-score): Use it.

2014-01-10  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-image.el: Check image feature's availability statically.

2013-12-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-play.el: Use NOERROR option of require funciton instead of
	condition-case.

	* mime-shr.el: Likewise.

	* mime-w3.el: Likewise.

2013-12-20  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-display-multipart/pgp-encrypted): Adapt for
	the last change of mime-view.el.

	* mime-signature.el (mime-edit-default-signature): Check
	mail-signature contains separator.

2013-10-06  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-multipart/related-show-all-children):
	Renamed from mime-view-multipart-show-all-children.
	(mime-display-multipart/related): Likewise.

2013-10-06  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-content-types): Add entry for text/vcard.
	(mime-file-types): Add entry for .vcf file.

	* semi-setup.el: Define previewer for text/vcard part as well as
	text/x-vcard.

	* mime-vcard.el (mime-display-text/vcard-hook): Renamed from
	mime-display-text/x-vcard-hook.  Define explicitly.
	(mime-display-text/vcard): Renamed from mime-display-text/x-vcard.

2013-07-20  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-verify-application/*-signature)
	(mime-decrypt-application/pgp-encrypted): pass string to
	epa-display-info function.  This is the fix for the change of
	2012-10-06.

2013-06-09  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-verify-application/*-signature-internal)
	(mime-verify-application/*-signature)
	(mime-preview-application/*-signature): Avoid signaling error when
	protocol parameter of Contetn-Type header is incorrect or missing.

2013-02-11  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* SEMI-ELS (semi-modules-to-compile): Add mime-signature.el.

	* mime-edit.el: Do not require signature.el
	(mime-edit-insert-signature): Moved to mime-signature.el and
	define atuload for it.

	* mime-signature.el: New file.

	* semi-setup.el (mime-setup-use-signature): Now nil is default.

2012-12-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-decrypted-buffers): New variable.
	(mime-pgp-kill-decrypted-buffers): New function.
	(mime-preview-application/pgp-encrypted): Keep decrypted content
	until the preview buffer is killed.

	* mime-view.el (mime-display-entity): Do not propertize with
	mime-view-* properties on already propertized region.

2012-12-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-def.el (mime-add-condition): Define autoload for method and
	body-presentation-method's parameter.

	* semi-setup.el: Use mime-add-condtion for preview functions that
	require autoload.

2012-12-22  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Remove settings for mime-view-application/pgp
	function.  SEMI-EPG does not have this funciton.

2012-12-22  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el: Require mmgeneric.el in compiling.
	(mime-preview-application/pgp-encrypted): New function. Imported
	and modified from Wanderlust.

	* semi-setup.el: Add setting for
	mime-preview-application/pgp-encrypted.

2012-12-21  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-shr.el (mime-shr-blocked-images): Change its customization
	gorup to mime-view.

2012-12-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-multipart-show-all-children): New
	customizable variable.
	(mime-display-multipart/related): Refer to it.

	* mime-pgp.el (mime-display-multipart/pgp-encrypted): Likewise.

2012-12-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-pgp-decrypt-when-preview): New customizable
	variable.
	(mime-display-multipart/pgp-encrypted): New function.

	* semi-setup.el: Define autoload and mime-preview-codition's
	settings for mime-display-multipart/pgp-encrypted.

2012-12-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-encrypt-pgp-nonmime): New function.

2012-10-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el: Use mapc instead of mapcar for side effect.
	Assume emacs-major-version is greater than 18.

2012-10-06  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-pgp.el (mime-verify-application/*-signature)
	(mime-decrypt-application/pgp-encrypted): Use epa-display-info
	instead of epa-display-verify-result

	* mime-image.el (mime-image-normalize-xbm-buffer): Use
	string-to-number instead of string-to-int.

	* mime-shr.el: Load shr.el at compile time.

2012-10-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-epg.el: Renamed to mime-pgp.el.

	* mime-pgp.el: Renamed from mime-epg.el.

	* SEMI-ELS: Likewise.

	* semi-setup.el: Likewise.

2012-10-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-entity-score): New function.  The
	default score (-1) is hard-coded.
	(mime-display-multipart/alternative): Use it.
	(mime-view-multipart-entity-score): New function.
	(mime-view-type-subtype-score-alist): Add entry for multipart
	entity.

2012-09-09  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-file)
	(mime-edit-insert-file-as-text): Minor refactoring.

2012-09-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-text-file)
	(mime-edit-insert-file-as-text): New functions.
	(mime-edit-mode-entity-map, mime-edit-menu-list, mime-edit-mode):
	Add entry for mime-edit-insert-file-as-text.

2012-09-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-file-filename)
	(mime-edit-insert-file-charset)
	(mime-edit-insert-file-parameters): New functions.
	(mime-edit-insert-file): Use them.  Capable to define charset
	while inserting.
	(mime-file-types): Define charset parameter for text files.

2012-09-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-normalize-body): Define charset more
	exactly for encoded text entity.

2012-08-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-text/plain): Minor refactoring.
	(mime-display-text/richtext, mime-display-text/enriched): Do not
	use `let'.

2012-08-25  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-insert-text-content): New function.
	(mime-display-text/plain, mime-display-text/richtext)
	(mime-display-text/enriched): Use it.

2012-04-30  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Fix the case of that
	mime-setup-enable-inline-html is nil.

	* mime-shr.el (mime-shr-preview-text/html): Delete garbage
	overlay.

2012-04-28  MORIOKA Tomohiko  <tomo.git@chise.org>

	* README.en: Add coding cookie to specify UTF-8.

2012-04-28  MORIOKA Tomohiko  <tomo@zinbun.kyoto-u.ac.jp>

	* README.ja, README.en: Remove descriptions about CVS and add
	description about the new Git repository.

2012-04-28  MORIOKA Tomohiko  <tomo@zinbun.kyoto-u.ac.jp>

	* README.ja, README.en (Required environment): Modify for the new
	URLs of APEL and FLIM.
	(Mailing lists): Modify for the new Emacs-MIME mailing lists.

2010-11-12  MORIOKA Tomohiko  <tomo@zinbun.kyoto-u.ac.jp>

	* semi-setup.el: Add setting for mime-mac.el if running with Mac
	OS X.

2010-11-11  MORIOKA Tomohiko  <tomo@zinbun.kyoto-u.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Add `mime-mac' if running
	with Mac OS X.

	* mime-mac.el: New file.

	* mime-play.el (mime-save-content): Return filename.

2005-12-25  MORIOKA Tomohiko  <tomo@zinbun.kyoto-u.ac.jp>

	* semi-def.el (mime-user-interface-product): Update to 1.14.7.

2012-04-27  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	Experimental support of shr (Simple HTML Renderer) for html
	entity.
	* mime-shr.el: New file.

	* semi-setup.el (mime-html-previewer-alist): Likewise.

	* SEMI-ELS (top): Likewise.

2012-04-21  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-mailcap-files): Reverse the order of
	files.  Do not care of mime-mailcap-file's value.
	(mime-view-read-mailcap-files): The file indicated by
	mime-mailcap-file has the most priority.

2012-03-07  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-filtered-validities): New variable.
	(mime-edit-pgp-keys-valid-key): New function.
	(mime-edit-pgp-get-signers, mime-edit-encrypt-pgp-mime): Use them.
	Do not return invalid keys.
	Cf. https://github.com/ikazuhiro/semi-epg/pull/1

2011-07-16  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-make-encrypt-recipient-header): When
	mime-edit-pgp-encrypt-to-self is non-nil, add From field value to
	recipients.
	(mime-edit-encrypt-recipient-fields-list): Add "From".

	* mime-epg.el (mime-preview-application/*-signature): Result
	string always terminates with LF.

2011-06-24  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-sign-pgp-nonmime): Renamed from
	`mime-edit-sign-pgp-nomime'.

2011-06-23  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-epg.el (mime-verify-application/*-signature-internal): New
	function.
	(mime-verify-application/*-signature): Use it.
	(mime-preview-application/*-signature): New function.

	* semi-setup.el (Top): Setup mime-preview-application/*-signature
	for previewing signature entity.

2011-06-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el: Specify file mode and coding.

2011-06-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-transfer-level): Fix wrong docstring.
	(mime-file-types): Set 'name' parameter of Content-Type field and
	'filename' parameter of Content-Disposition field.

2011-06-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-insert-file): Encode a filename when
	FLIM does not support non-ASCII filename.
	(mime-edit-decode-single-part-in-buffer): Keep 'name' parameter of
	Content-Type field.  Unfold and decode it and 'filename' parameter
	of Content-Disposition field.

2010-12-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-display-message): Do not hide button when
	first entity is neither text nor multipart.

2010-12-10  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-decode-single-part-in-buffer): Keep
	Content-Id field.

2010-12-09  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-preview-fill-flowed-text-delsp): New
	variable.
	(mime-display-text/plain): Handle "delsp=yes" if
	mime-preview-fill-flowed-text-delsp's value is non-nil.

2010-12-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-get-signers): Widen before calling
	std11-field-body().  Check return value from std11-field-body().

2010-12-04  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-pgp-get-signers): New function.
	(mime-edit-sign-pgp-mime, mime-edit-sign-pgp-nomime): Use it.

2010-12-02  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el (mime-edit-sign-pgp-mime): Fix "From:" header
	string is ignored when non-verbose mode and
	mime-edit-pgp-signers's value is nil.  Refined.
	(mime-edit-sign-pgp-nomime): Respect "From:" header string.
	Respect mime-edit-pgp-verbose's value.  Require epa.el.

2010-12-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-def.el (mime-user-interface-product): Rename product name
	from SEMI to SEMI-EPG.

	* mime-edit.el (mime-edit-pgp-user-id): Removed.
	(mime-edit-text-coding, mime-edit-sign-pgp-nomime): New functions.

2010-11-29  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* SEMI-MK (install-execs): Removed.

	* SEMI-CFG (METHOD_SRC_DIR, METHODS): Removed.

2010-11-28  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-edit.el: EasyPG support is merged from
	emiko-1.14.1-for-epg-0.0.13.  All PGG supports are abolished.
	(smime-output-buffer, smime-errors-buffer): Abolished.
	(mime-edit-pgp-verbose, mime-edit-pgp-signers)
	(mime-edit-pgp-encrypt-to-self): New variables.
	(mime-edit-user-agent-value): Include EasyPG version.
	(mime-edit-mode-enclosure-map): Map keys for
	mime-edit-mode-enclosure-map and
	mime-edit-enclose-smime-encrypted-region.
	(mime-edit-sign-pgp-mime, mime-edit-encrypt-pgp-mime)
	(mime-edit-convert-lbt-string, mime-edit-sign-smime)
	(mime-edit-encrypt-smime, mime-edit-insert-key)
	(mime-edit-decode-multipart-in-buffer): Merged or ported from
	emiko-emiko-1.14.1-for-epg-0.0.13.
	(mime-edit-sign-pgp-kazu, mime-edit-encrypt-pgp-kazu)
	(mime-edit-enclose-kazu-signed-region)
	(mime-edit-enclose-kazu-encrypted-region): Abolished.

2010-11-28  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-vcard.el (mime-vcard-standard-filters): Abolished.
	(mime-vcard-filter-quoted-printable): Abolished.
	(mime-display-text/x-vcard): Likewise.  Use vcard-pretty-print().

2010-11-27  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-epg.el: New module.  Merged and renamed from mime-pgp.el of
	emiko-1.14.1-for-epg-0.0.13.

	* SEMI-ELS (semi-modules-to-compile): Add mime-epg.  Remove
	mime-pgp.  PGG supports for verifing and decrypting are abolished.

	* mime-pgp.el: Removed.

	* semi-setup.el: Set up to use it.
	(mime-setup-enable-pgp): Abolished.
	(mime-setup-enable-epg): New variable.


2000-08-22   Daiki Ueno  <ueno@unixuser.org>

	* SEMI-ELS: Compile `mime-vcard' only when vcard.el is available.

2000-08-21   Daiki Ueno  <ueno@unixuser.org>

	* mime-vcard.el: New module.

	* semi-setup.el: Set up for "text/x-vcard".
	(mime-setup-enable-vcard): New variable.

	* mime-view.el: Add setting for 'vcard-parse-string',
	`vcard-format-string' and `vcard-filter-html' to autoload "vcard".
	Set up for "text/x-vcard".
	Add setting for	`fill-flowed' to autoload "flow-fill".
	(mime-display-text/plain): Handle "format=flowed".
	(mime-preview-fill-flowed-text): New variable.


2010-11-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* semi-setup.el: Support emacs-w3m.
	(mime-html-previewer-alist): New variable.
	(mime-setup-enable-inline-html): Refer to it.  Support other html
	renderers.

2010-11-10  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>

	* mime-view.el (mime-view-type-subtype-score-alist): Accept
	function as an alternate of score.
	(mime-view-type-subtype-score-alist): Likewise.

2010-10-24  Vitaly Mayatskikh  <v.mayatskih@gmail.com>

	* mime-view.el (mime-save-situation-examples): Don't fail when
	mime-situation-examples-file is nil.

2010-06-21  Katsumi Yamaoka  <yamaoka@jpl.org>

	* SEMI-CFG: Add emu subdirectory to load-path when LISPDIR is
	specified.  Suggested by Kazuhiro NISHIYAMA <zn@mbf.nifty.com>.

2010-06-04  David Maus  <dmaus@ictsoc.de>

	* pgg-parse.el: Add reference to RFC4880.
	(pgg-parse-symmetric-key-algorithm-alist)
	(pgg-parse-hash-algorithm-alist)
	(pgg-parse-compression-algorithm-alist)
	(pgg-parse-signature-type-alist): Update lists to RFC4880.

2010-02-19  Heinz Diehl <htd@fancy-poultry.org>

	* mime-edit.el (mime-edit-set-encrypt): Fix typo.

2010-02-07  David Maus <maus.david@gmail.com>

	* mime-edit.el (mime-edit-encrypt-pgp-mime): Added Version tag for
	pgp-encrypted messages to comply with RFC3156.
	* mime-edit.el (mime-edit-pgp-enclose-buffer): Sign and encrypt
	pgp message in conformance to RFC3156.

2010-01-25  Harald Judt  <h.judt@gmx.at>

	* mime-edit.el (mime-content-types): Added more MIME types.

2010-01-25  Vitaly Mayatskikh  <v.mayatskih@gmail.com>

	* mime-edit.el (mime-edit-insert-file): Ask user for MIME type and
	subtype during interactive file insertion, not only encoding.
	* mime-pgp.el (toplevel): New function:
	`mime-display-multipart/pgp-encrypted'.
	* pgg-def.el (toplevel): New custom: `pgg-decrypt-automatically'.
	* semi-setup.el (toplevel): New mime-preview condtion for MIME
	type "application/pgp-encrypted".

2010-01-19  Vitaly Mayatskikh  <v.mayatskih@gmail.com>

	* mime-view.el (toplevel): New defcustom: mime-view-buttons-visible
	* mime-view.el (mime-display-entity): Use mime-view-buttons-visible
	to control visibility of MIME buttons.

2007-06-18  Daiki Ueno  <ueno@unixuser.org>

	* mime-edit.el (turn-on-mime-edit): Remove redundant comments and
	newlines to make the amount of diff-lines minimal to the original.

2007-06-08  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-edit.el (turn-on-mime-edit): Don't use the default values
	of paragraph-start and paragraph-separate.  Suggested by Ron
	Isaacson <Ron.Isaacson@morganstanley.com>.  cf.
	http://article.gmane.org/gmane.mail.wanderlust.general.japanese/5721

2007-04-24  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-edit.el (turn-on-mime-edit): Make paragraph-start and
	paragraph-separate buffer-local.

2006-12-20  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* README.ja, README.en (Required environment): Update required
	version of APEL to 10.7 or later.

	* SEMI-CFG (PACKAGEDIR): Use
	`install-get-default-package-directory'.

2006-12-13  Katsumi Yamaoka  <yamaoka@jpl.org>

	* SEMI-CFG (PACKAGEDIR): Avoid an error with Emacs.

2006-12-12  Katsumi Yamaoka  <yamaoka@jpl.org>

	* SEMI-MK (compile-semi-package): Use
	batch-update-directory-autoloads if it is available instead of
	batch-update-directory.

2006-12-11  Katsumi Yamaoka  <yamaoka@jpl.org>

	* SEMI-CFG (PACKAGEDIR): Check for
	(early|late|last)-package-hierarchies and configure-package-path
	as well as (early|late|last)-packages.

2006-12-02  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>

	* mime-edit.el (mime-edit-process-multipart-1): Don't insert a
	text tag if a multipart end tag is followed.

2006-06-23  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>

	* mime-view.el (mime-calist::field-match-method-ignore-case):
	New function; set up for `field-match-method' of calist.

2006-03-28  Daiki Ueno  <ueno@unixuser.org>

	* mime-edit.el (mime-edit-sign-pgp-mime): Set pgg-text-mode.
	(mime-edit-encrypt-pgp-mime): Ditto.

2006-02-18  TAKAHASHI Kaoru  <kaoru@kaisei.org>

	* mime-edit.el (mime-edit-delete-trailing-whitespace): New
	Function for RFC3156.
	(mime-edit-sign-pgp-mime): Use it.

2005-06-14  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-view.el (mime-display-text/richtext): Withdraw the last
	change.
	(mime-display-text/enriched): Ditto.

2005-06-09  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-view.el (mime-display-text/richtext): Turn off
	adaptive-fill-mode while executing richtext-decode.
	(mime-display-text/enriched): Turn off adaptive-fill-mode while
	executing enriched-decode.

2005-03-29  Nakagawa, Makoto  <Makoto.Nakagawa@hp.com>

	* pgg-pgp.el (pgg-scheme-sign-region): Manually convert line
	endings to CRLF before signing.

2001-09-24   Daiki Ueno  <ueno@unixuser.org>

	* mime-view.el (mime-preview-toggle-display): When both "type" and
	"*type" conditions are not specified, the entity should be regarded
	as invisible.

2004-09-27  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-edit.el (mime-edit-temp-message-buffer): Define.
	* mime-play.el (mime-view-temp-message-buffer): Ditto.
	(mime-preview-quitting-method-for-mime-show-message-mode): Change
	accordingly.

2004-09-27  Katsumi Yamaoka  <yamaoka@jpl.org>

	* README.en, README.ja (CVS based development): Mention anonymous
	CVS access; remove the description about developers' pserver access.

2003-11-15  Simon Josefsson  <jas@extundo.com>

	* pgg-gpg.el (pgg-scheme-lookup-key): Use regexp match instead of
	split-string (split-string is different between emacs 21.2 and
	21.4).  Reported by ultrasoul@ultrasoul.com (David D. Smith).

2004-09-15  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-view.el (mime-preview-follow-current-entity): Avoid error
	on null entity.
	(mime-preview-find-boundary-info): Ditto.
	Avoid error at the beginning of buffer.

2004-08-28  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* pgg-pgp5.el (pgg-scheme-verify-region): `let*' -> `let'.
	* pgg-pgp.el (pgg-scheme-verify-region): Ditto.
	* mime-edit.el (mime-edit-split-and-send): Ditto.
	* mime-play.el (mime-store-message/partial-piece): Ditto.

2004-08-03  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-edit.el (mime-edit-mime-version-field-for-message/partial):
	Fix usage of mime-encode-field-body.

2004-07-24  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-view.el (mime-display-multipart/related): Do nothing when
	the part is not found.

2004-04-18  TAKAHASHI Kaoru  <kaoru@kaisei.org>

	* mime-edit.el (mime-file-types): Add application/pdf. Use base64
	for application/postscript.
	(mime-content-types): Add application/pdf.

2004-04-04  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-edit.el (mime-file-types): Add application/vnd.ms-excel.
	(mime-content-types): Add application/vnd.ms-excel and
	application/msword.

2004-02-12  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-image.el (mime-display-image): Ignore errors about image
	decoding.

2004-02-06  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-image.el (mime-image-normalize-xbm-buffer): Add missing
	format specifiers.

	* mime-view.el (mime-view-insert-entity-button): Fix misplaced let
	form.

2004-01-15  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-normalize-body): Fix a comment that the
	problem related to `replace-match' has been fixed at 2004-01-15,
	thanks to Handa-san.


2003-12-24  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.6 (Maruoka) released.

2003-12-18  Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el (pgg-gpg-process-region): Set environment variable
	LANGUAGE as well.  GNU gettext gives precedence to LANGUAGE over
	LC_ALL, when different language code is specified.  Thanks to
	Tatsuya Kinoshita <tats@vega.ocn.ne.jp>.
	[cf. <emacs-mime-ja:1599>]

2003-12-17  Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el (pgg-gpg-messages-locale): New user option.
	(pgg-gpg-process-region): Set environment variable LC_ALL when
	pgg-gpg-messages-locale is specified.

	* pgg-def.el (pgg-messages-locale): New user option.

	* mime-pgp.el (mime-verify-application/pgp-signature): Copy
	messages from pgg-errors-buffer.
	(mime-add-application/pgp-keys): Ditto.

2003-12-16  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-normalize-body): Don't use the
	`(replace-match "\\1\r\n")' form since it may convert the unibyte
	string into multibyte in Emacs 21.4.

2003-12-14  Yoichi NAKAYAMA <yoichi@geiin.org>

	* mime-play.el (mime-mailcap-method-sentinel): Restore deleting
	directory routine and protection of 1st arg of `message' dropped
	in the last change.
	(mime-mailcap-delete-played-files): Ditto.

2003-12-12  ARISAWA Akihiro  <ari@mbf.sphere.ne.jp>

	* mime-play.el (mime-play-delete-file-immediately): New user option.
	(mime-mailcap-method-sentinel): Use it.
	(mime-mailcap-delete-played-files): New function; set up for
	`kill-emacs-hook'.

2002-05-18  ARISAWA Akihiro  <ari@mbf.sphere.ne.jp>

	* mime-play.el (mime-activate-mailcap-method): Don't use
	`binary-to-text-funcall'. (Thanks to TANAKA Shingo)

2003-12-14  Tatsuya Kinoshita  <tats@vega.ocn.ne.jp>

	* mime-edit.el (mime-charset-type-list): Add entry for iso-8859-1[45].

2003-12-12  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-edit-user-agent-value): Add a setting for
	XEmacs CHISE.

2003-12-07  Yuuichi Teranishi  <teranisi@gohome.org>

	* mime-play.el (mime-require-safe-directory): Check the owner of the
	directory if it already exists.

2003-12-06  Yuuichi Teranishi  <teranisi@gohome.org>

	* mime-play.el (mime-require-safe-directory): New function.
	(mime-store-message/partial-piece): Use it.

2003-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>

	* mime-play.el (mime-store-message/partial-piece): Fix
	mis-designed parenthesis in the `let' form.

2001-11-27  Daiki Ueno  <ueno@unixuser.org>

	* mime-w3.el: Don't use `url-register-protocol' if it is not
	fboundp; announce `url-cid' feature instead.
	[cf. <Wanderlust:8566>]

	(url-cid): Change return value for the current URL package.

2003-06-09  Yuuichi Teranishi  <teranisi@gohome.org>

	* pgg-gpg.el (pgg-gpg-process-region): Undo the last change;
	Add --yes option to overwrite existing output file;
	Remove needless set-default-file-modes.

2003-05-29  Yuuichi Teranishi  <teranisi@gohome.org>

	* pgg-gpg.el (pgg-gpg-process-region): Undo the last change.

2003-05-15  Yuuichi Teranishi  <teranisi@gohome.org>

	* pgg-gpg.el (pgg-gpg-process-region): Use `make-temp-file' instead of
	`make-temp-name'.

	* pgg-pgp5.el (pgg-pgp5-process-region): Ditto.
	(pgg-scheme-verify-region): Ditto.
	(pgg-scheme-snarf-keys-region): Ditto.

	* pgg-pgp.el (pgg-pgp-process-region): Ditto.
	(pgg-scheme-verify-region): Ditto.
	(pgg-scheme-snarf-keys-region): Ditto.

	* smime.el (smime-process-region): Ditto.
	(smime-verify-region): Ditto.

	* mime-pgp.el (mime-verify-application/pgp-signature): Ditto.
	(mime-verify-application/pkcs7-signature): Ditto.

	* mime-play.el (mime-activate-mailcap-method): Make a temporary
	directory of a temporary file for the mailcap application.
	(mime-mailcap-method-sentinel): Follow the change above.
	(mime-store-message/partial-piece): Set `default-file-modes' for
	`make-directory'.

	* mime-edit.el (mime-edit-split-and-send): Remove local variable
	`mime-edit-draft-file-name'.

2003-05-12  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-edit.el (turn-on-mime-edit): Protect 1st arg of `message'.
	* mime-view.el (mime-preview-follow-current-entity): Ditto.

2003-05-11  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-w3.el (mime-preview-text/html): Protect 1st arg of `message'.
	* mime-play.el (mime-mailcap-method-sentinel): Ditto.
	(mime-view-message/external-anon-ftp): Ditto.
	(mime-view-message/external-url): Ditto.

2003-04-05  Yoichi NAKAYAMA  <yoichi@geiin.org>

	* mime-view.el (mime-preview-toggle-display): Use boundary with
	children.

2003-02-08  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>

	* semi-def.el (mime-should-use-popup-menu): New function.
	(mime-select-menu-alist): Renamed from select-menu-alist, change
	its behavior according to mime-should-use-popup-menu.
	* mime-play.el (mime-play-entity): Change accordingly.

2003-02-08  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>

	* mime-view.el (mime-save-situation-examples): Bind print-length
	and print-level.

2003-01-10  NAKAJI Hiroyuki  <nakaji@tutrp.tut.ac.jp>

	* README.ja: new file, Japanese translation of README.en.
	Spaces between ascii and Japanese characters are added.


2002-11-15  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.5 (Awara-Onsen) released.

2002-11-05  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>

	* mime-view.el (mime-preview-find-boundary-info): Change the name of
	the argument from get-mother to with-children along its effect.

2002-11-03  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>

	* mime-edit.el (mime-edit-decode-single-part-in-buffer): Decode text
	part only.

2002-04-16   Daiki Ueno  <ueno@unixuser.org>

	* mime-edit.el (mime-file-types): Add setting of *.jpeg for image/jpeg.

2002-10-26  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>

	* mime-view.el (mime-preview-find-boundary-info): Fix logic. Do not
	refer next to next part before examining the next part.

2002-08-28  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-user-agent-value): Add
	`xemacs-extra-name'.


2002-07-08  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.4 (Hosorogi) released.

	* Makefile (ARC_DIR_PREFIX): New variable.
	(ARC_DIR): Use `ARC_DIR_PREFIX'.

2001-08-10  Kenichi OKADA <okada@opaopa.org>

	* semi-def.el (mime-browse-url-regexp): Allow nntps and ftps.

2001-06-12  Yuuichi Teranishi <teranisi@gohome.org>

	* mime-view.el (mime-display-multipart/related): When "start"
	parameter specifies part, treat the part as root.

2001-06-12  Akihiro Arisawa  <ari@mbf.sphere.ne.jp>

	* mime-view.el (mime-display-multipart/related): New function; set up
	for `mime-preview-condition'.

2001-04-19  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-bbdb.el: Load "bbdb-hooks" when the symbol function
	`bbdb-extract-field-value' is not bound or it is set up as an
	autoloaded function. [cf. <emacs-mime-ja:799,842,843,844,845,846>]

2001-04-17  YAMASHITA Junji   <ysjj@unixuser.org>

	* semi-def.el (mime-browse-url-regexp): Allow https.

2001-03-06  Hiroya Murata     <lapis-lazuli@pop06.odn.ne.jp>

	* mime-edit.el (mime-edit-set-parameter): Get rid of the duplicated
	optional fields.

2000-12-28  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el: Revert to use `static'.


2000-12-28  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.3 (Ushinoya) released.

	* mime-view.el (mime-view-read-situation-examples-file): Don't try
	to read situation-examples-file is it is nil.
	(mime-situation-examples-file): Avoid to read
	situation-examples-file at compile time.

2000-12-28  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el (mime-view-read-situation-examples-file): Display
	warning. [cf. <emacs-mime-ja:680>]

2000-12-27  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el (mime-view-mailcap-files): New user option.
	(mime-view-read-mailcap-files): Renamed from
	`mime-view-read-mailcap'; read `mime-view-mailcap-files'.

	* mime-view.el (mime-view-read-situation-examples-file): New
	function; don't occur error.
	(mime-view-read-mailcap): New function.

2000-12-27  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-play.el (mime-play-messages-coding-system): Renamed from
	`mime-mailcap-method-messages-coding-system'.

	* pgg-def.el (pgg-messages-coding-system): Change default value to
	nil.

2000-12-27  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Fix typo.

2000-12-26   Daiki Ueno  <ueno@unixuser.org>

	* mime-play.el (mime-mailcap-method-messages-coding-system): New
	variable.
	(mime-activate-mailcap-method): Use it.

2000-12-26   Daiki Ueno  <ueno@unixuser.org>

	* pgg-def.el (pgg-messages-coding-system): Use `defvar' to define.

	* pgg-pgp.el (pgg-pgp-messages-coding-system): Abolish.
	(pgg-pgp-process-region): Use `binary-funcall' instead of
	`binary-to-text-funcall'.

	* pgg-pgp5.el (pgg-pgp5-messages-coding-system): Abolish.
	(pgg-pgp5-process-region): Use `binary-funcall' instead of
	`binary-to-text-funcall'.


2000-12-25  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.2 (Daishōji) released.

	* README.en (Required environment): Update to FLIM 1.14.2.

	* mail-mime-setup.el (mail-setup-hook): Don't add
	`eword-decode-header'.

2000-12-23  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el (mime-view-define-keymap): Return
	`mime-view-mode-map' instead of set up as local keymap; don't call
	`mime-view-define-keymap-hook'.
	(mime-display-message): Add new optional argument `keymap'.

	* mime-play.el (mime-store-message/partial-piece): Use
	`binary-insert-encoded-file' and `binary-write-decoded-region'
	instead of `binary-insert-file-contents' and
	`binary-write-region'.

2000-12-23  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* smime.el (smime-process-region): Use `binary-funcall' instead of
	`binary-start-process-shell-command'.
	(smime-verify-region): Use `binary-write-decoded-region' and
	`binary-insert-encoded-file' instead of `binary-write-region' and
	`binary-insert-file-contents'.

	* pgg-pgp5.el (pgg-pgp5-messages-coding-system): New variable.
	(pgg-pgp5-process-region): Use `binary-to-text-funcall' instead of
	`binary-start-process-shell-command'.
	(pgg-scheme-verify-region): Use `binary-write-decoded-region'
	instead of `binary-write-region'.

	* pgg-pgp.el (pgg-pgp-messages-coding-system): New variable.
	(pgg-pgp-process-region): Use `binary-to-text-funcall' instead of
	`binary-start-process-shell-command'.
	(pgg-scheme-verify-region): Use `binary-write-decoded-region'
	instead of `binary-write-region'.

	* pgg-gpg.el (pgg-gpg-process-region): Use
	`binary-to-text-funcall' instead of `binary-start-process'.


2000-12-22  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.1 (Kaga-Onsen) released.

	* README.en (Required environment): Require FLIM 1.14.1 or later;
	update required emacsen.

2000-12-22  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* pgg-gpg.el (pgg-gpg-process-region): Use
	`pgg-gpg-messages-coding-system'.

2000-12-21  Tadashi Watanabe  <watanabe@sigmaitec.co.jp>

	* pgg-gpg.el (pgg-scheme-verify-region): Use a "-" as the name for
	the file with the signed material.

2000-12-21   Daiki Ueno       <ueno@unixuser.org>

	* pgg-def.el (pgg-messages-coding-system): New user option.

2000-12-20  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el: Don't use `static-cond'.


2000-12-20  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* SEMI: Version 1.14.0 (Iburihashi) released.

2000-12-19  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-edit-mime-version-field-for-message/partial):
	Use `mime-encode-field-body' instead of `eword-encode-field-body'.

2000-12-19  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-edit-translate-header): Use
	`mime-encode-header-in-buffer' instead of `eword-encode-header'.
	(mime-edit-encrypt-pgp-mime): Likewise.
	(mime-edit-translate-single-part-tag): Likewise.

2000-12-17  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* postpet.el: Require `mime'.

	* pgg-parse.el (pgg-format-key-identifier): Don't use
	`string-to-int-list'.
	(pgg-read-bytes): Likewise.
	(pgg-read-body): Likewise.

2000-12-16  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* smime.el: Require `raw-io'.
	(smime-process-region): Use `binary-start-process-shell-command'.

	* pgg-pgp5.el (pgg-pgp5-process-region): Use
	`binary-start-process-shell-command'.

	* pgg-pgp.el (pgg-pgp-process-region): Use
	`binary-start-process-shell-command'.

	* pgg-gpg.el (pgg-gpg-process-region): Use `binary-start-process'.

2000-12-15  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* pgg-def.el: Require `custom' instead of `pcustom'.

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>

	* smime.el (smime-process-region): Don't use `as-binary-process'.
	(smime-verify-region): Use `binary-write-region' instead of
	`write-region-as-binary'; use `binary-insert-file-contents'
	instead of `insert-file-contents-as-binary'.

	* semi-def.el: Don't require `poe'.

	* pgg-pgp5.el (pgg-pgp5-process-region): Don't use
	`as-binary-process'.
	(pgg-scheme-verify-region): Use `binary-write-region' instead of
	`write-region-as-binary'.
	(pgg-scheme-snarf-keys-region): Don't use
	`write-region-as-raw-text-CRLF'.

	* pgg-pgp.el (pgg-pgp-process-region): Don't use
	`as-binary-process'.
	(pgg-scheme-verify-region): Use `binary-write-region' instead of
	`write-region-as-binary'.
	(pgg-scheme-snarf-keys-region): Don't use
	`write-region-as-raw-text-CRLF'.

	* pgg-parse.el: Don't require `poem'; require `custom' instead of
	`pcustom'.

	* pgg-gpg.el (pgg-gpg-process-region): Don't use
	`as-binary-output-file' and
	`insert-file-contents-as-raw-text-CRLF'.

	* mime-view.el: Don't require `emu'.
	(mouse-button-3): New variable.

	* mime-play.el (mime-store-message/partial-piece): Use
	`binary-insert-file-contents' instead of
	`insert-file-contents-as-binary'; don't use
	`as-binary-input-file'; use `binary-write-region' instead of
	`write-region-as-binary'.

2000-12-07  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-w3.el: Avoid error even if `w3' is not found.

2000-11-26  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el: Use `mime-conf' instead of `mailcap'.

	* mime-play.el (mime-activate-mailcap-method): Use
	`mime-format-mailcap-command' instead of `mailcap-format-command'.

2000-10-19  Takanori Saneto  <sanewo@ba2.so-net.ne.jp>

	* pgg-pgp.el (pgg-pgp-process-region): bind process-environment
	locally so that setenv's effect won't last forever.
	pgg-pgp5.el (pgg-pgp5-process-region): Ditto.

2000-09-29  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-file-types): Fix to use application/msword
	instead of application/winword.

2000-08-11  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-text/plain): Display warning message
	when `mime-insert-text-content' fails.

2000-08-04   Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el (pgg-gpg-process-region): Don't bind
	coding-system-for-read.

2000-07-04  Yuuichi Teranishi  <teranisi@gohome.org>

	* mime-image.el (mime-image-insert) [XEmacs]:
	Insert `string' only if it is non-nil.

2000-06-27   Daiki Ueno  <ueno@unixuser.org>

	* mime-image.el (mime-image-insert): Synch with the latest image.el.
	(mime-display-image): Don't pass underlying string "x".

2000-06-09   Daiki Ueno  <ueno@unixuser.org>

	* mime-edit.el (mime-edit-insert-key): Insert a text tag when
	the buffer has any trailing text.

2000-06-05  Shugo Maeda <shugo@ruby-lang.org>

	* pgg-gpg.el (pgg-scheme-insert-key): Don't quote user id.

2000-05-21   Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el (pgg-gpg-process-region): Abolish redundant nconc.

2000-05-16   Daiki Ueno  <ueno@unixuser.org>

	* mime-image.el (mime-image-create) [XEmacs]: Don't call
	`make-image-instance' directly.

2000-05-02   Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el (pgg-scheme-encrypt-region): Don't quote recipient;
	concatenate all arguments destructively.

2000-04-13   Daiki Ueno  <ueno@unixuser.org>

	* pgg-gpg.el: Fix author's mailing address.
	(pgg-gpg-process-region): Add --output option; set status fd to 2.
	(pgg-gpg-possibly-cache-passphrase): New function.
	(pgg-gpg-shell-file-name): Abolish.
	(pgg-gpg-shell-command-switch): Abolish.
	(pgg-scheme-lookup-key): Work on temp buffer.

2000-03-01  Yoshiki Hayashi <yoshiki@xemacs.org>

	* mime-image.el (mime-display-image): Don't wait for redisplay.


2000-07-12  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* REMI: Version 1.14.2 (Hokuhoku-Ōshima) released.

	* README.en (Required environment): Modify for FLIM-Chao 1.14.1.

2000-07-11  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-pgp.el (mime-view-application/pgp): Setup local variable
	`mime-view-temp-message-buffer' of preview-buffer.
	(mime-view-application/pkcs7-mime): Likewise.

	* mime-play.el
	(mime-preview-quitting-method-for-mime-show-message-mode): Don't
	use `mime-entity-buffer'; refer `mime-view-temp-message-buffer'.
	(mime-store-message/partial-piece): Use
	`insert-file-contents-as-binary' instead of
	`(as-binary-input-file (insert-file-contents ...))'; use
	`write-region-as-binary' instead of
	`(as-binary-output-file (write-region ...)); setup local variable
	`mime-view-temp-message-buffer' of preview-buffer.

2000-06-23  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-edit-preview-message): Set up local variable
	`mime-edit-temp-message-buffer'.
	(mime-edit-quitting-method): Refer `mime-edit-temp-message-buffer'
	to avoid to use `mime-entity-buffer'.

2000-06-21  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-view.el (mime-view-mode): Use
	`mime-entity-set-content-type' and `mime-entity-set-encoding'
	instead of `mime-entity-set-content-type-internal' and
	`mime-entity-set-encoding-internal'.

	* mime-w3.el (mime-preview-text/html): Use
	`mime-find-root-entity'.

2000-05-25  Tanaka Akira      <akr@m17n.org>

        * README.en: Update for CVS via SSH.

2000-04-28  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>

	* mime-edit.el (mime-charset-type-list): Add `iso-2022-jp-3'.


2000-03-01  MORIOKA Tomohiko  <tomo@m17n.org>

	* REMI: Version 1.14.1 (Mushigawaōsugi) released.

2000-03-01  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-define-keymap): Add new binding
	`mime-preview-show-header' for C-c C-v C-f and C-c C-v h; add new
	binding `mime-preview-show-content' for C-c C-v C-c; add new
	binding `mime-preview-hide-header' for C-c C-d C-f and C-c C-d h;
	add new binding `mime-preview-hide-content' for C-c C-d C-c.
	(mime-preview-toggle-display): New function.
	(mime-preview-toggle-header): Add new optional argument
	`force-visible'; use `mime-preview-toggle-display'.
	(mime-preview-toggle-content): Likewise.
	(mime-preview-show-header): New function.
	(mime-preview-show-content): New function.
	(mime-preview-hide-header): New function.
	(mime-preview-hide-content): New function.

2000-02-25  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-situation-examples-file-coding-system): New
	variable.
	(mime-save-situation-examples): Use `with-temp-buffer'; try to
	save as `mime-situation-examples-file-coding-system'.
	- Use with-temp-buffer to load `mime-situation-examples-file';
	setup `mime-situation-examples-file-coding-system' when
	mime-situation-examples-file is loaded;

2000-02-25  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-define-keymap): Change keybind for
	`mime-preview-toggle-header' to C-c C-t h and C-c C-t C-f.

2000-02-24  Mito              <mit@nines.nec.co.jp>

	* mime-edit.el (mime-edit-normalize-body): Fix number of arguments
	against enriched-encode.

2000-02-23  Daiki Ueno        <ueno@ueda.info.waseda.ac.jp>

	* mime-image.el (mime-image-normalize-xbm-buffer): New inline
	function.
	(mime-image-create) [XEmacs || Emacs21]: Use it for XBM data.
	(mime-display-image): Don't create temporary file.

2000-02-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-delq-null-situation): Accept multiple ignored
	values.
	(mime-unify-situations): t is also regarded as an ignored-value.
	(mime-preview-follow-current-entity): Eliminate unused local
	variable `str'.

2000-02-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-find-every-situations): Renamed from
	`mime-view-find-every-situations'.

	* mime-view.el (mime-view-find-every-situations): Moved to
	mime-play.el.

2000-02-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-entity): Specify
	`mime-view-find-every-situations' as an optional argument
	`every-situations'.

	* mime-view.el (mime-unify-situations): Add new optional argument
	`every-situations'; use it instead of
	`mime-view-find-every-situations'.
	(mime-display-multipart/alternative): Modify `body' property
	instead of `body-presentation-method' property of
	preview-situation.

	* semi-setup.el: Use `eval-after-load' for text/html related
	setting.

2000-02-21   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* semi-def.el (mime-user-interface-product): Bump up to
	EMIKO 1.13.12.

	* pgg.el (pgg-temp-buffer-show-function): Use
	`shrink-window-if-larger-than-buffer'.

	* pgg-gpg.el (pgg-gpg-process-region): Fix cleanup form.

	* pgg-pgp.el (pgg-pgp-process-region): Ditto.

	* pgg-pgp5.el (pgg-pgp5-process-region): Ditto.

	* semi-setup.el (mime-setup-enable-inline-image): Remove checking
	of bitmap-mule; use `eval-after-load' instead of
	`call-after-loaded' to require `mime-image'.

	* mime-image.el (mime-display-image): Set default umask to 077.
	(mime-image-create): Use `nothing-image-instance-p'.

	* mime-pgp.el: When it is compiled, define `smime-output-buffer'
	and `smime-errors-buffer' to avoid compiler warning.

	* mime-edit.el: Ditto.

	* mime-pgp.el
	(mime-view-application/pkcs7-mime): Regard smime-type as
	"enveloped-data" unless it is specified.

	* smime.el (smime-directory-files): Abolish.
	(smime-verify-region): Abolish local variable `args'.

2000-02-20   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-image.el: Remove X-Face setting; require cl when compiling.
	(mime-image-format-alist): Remove image/x-mag and image/x-pic.
	(mime-image-type-available-p): New function.
	(mime-image-create): New function.
	(mime-image-insert): New function.
	(mime-display-image): Rewrite.

	* mime-edit.el
	(mime-edit-define-charset): Handle 'mime-charset-comment.

2000-02-18  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-define-keymap): Change binding of
	`mime-preview-toggle-content' from C-c C-t C-b to C-c C-t C-c.
	(mime-preview-toggle-content): Renamed from
	`mime-preview-toggle-body'.


2000-02-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* REMI: Version 1.14.0 (Uragawara) released.

2000-02-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-define-keymap): Add new binding
	`mime-preview-toggle-body' for C-c C-t C-b.
	(mime-preview-toggle-body): New command.

	* semi-def.el (mime-add-button): Don't use overlay.

2000-02-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-preview-condition): Add default setting of
	multipart; declare body of message/partial, message/rfc822 and
	message/news are visible.
	(mime-display-entity): Check `*body' or `body' property of
	situation.

2000-02-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-entity): Find
	`header-presentation-method' only if `header-is-visible'.

2000-02-10  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-entity): Don't use
	`mime-goto-header-start-point'.

2000-02-10  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-message): Use `major-mode' of
	current-buffer as default value of `original-major-mode'; don't
	use `mime-entity-header-buffer'.
	(mime-preview-follow-current-entity): Use `mime-insert-header' to
	insert header; don't use `mime-entity-header-buffer',
	`mime-entity-header-start-point' and
	`mime-entity-header-end-point'.

2000-02-10  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-preview-follow-current-entity): Use
	`mime-view-entity-body' to find body.

2000-02-10  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-preview-find-boundary-info): Fix problem when
	entity is in boundary of mother entity.
	(mime-preview-follow-current-entity): Check header information of
	`mime-view-situation' property.

2000-02-09  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-preview-find-boundary-info): Use <last point>
	- 1 instead of <last point> to get `mime-view-entity' property.

	* mime-view.el (mime-preview-follow-current-entity): Fix problem
	in multipart entity.

2000-02-07  Yoshiki Hayashi  <yoshiki@xemacs.org>

	* mime-pgp.el: Fix doc string.
	* pgg-def.el: Ditto.
	* pgg-gpg.el: Ditto.
	* pgg-parse.el: Ditto.
	* pgg-pgp.el: Ditto.
	* pgg-pgp5.el: Ditto.
	* pgg.el: Ditto.

2000-02-02  Nakagawa, Makoto  <Makoto.Nakagawa@jp.compaq.com>

	* pgg-pgp5.el (pgg-scheme-verify-region): Copy the contents of
	`pgg-errors-buffer' to `pgg-output-buffer'.

2000-02-02   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-temp-buffer-show-function): Don't check if the
	selected window is the only window.

2000-02-01  MORIOKA Tomohiko  <tomo@m17n.org>

	* semi-setup.el (mime-setup-enable-inline-image): Use "(fboundp
	'create-image)" to detect Emacs 21.
	Use `eval-after-load' instead of `call-after-loaded' to require
	`mime-image'.

2000-02-01  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-define-keymap): Change keybind for
	`mime-preview-toggle-header' to "\C-c\C-t\C-h".

2000-02-01   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-image.el: Add checking for `x-face-mule'.

	* pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el
	(pgg-scheme-lookup-key): Rename from
	`pgg-scheme-lookup-key-string'.
	(pgg-scheme-decrypt-region): Use `pgg-scheme-lookup-key'.
	(pgg-scheme-sign-region): Ditto.

	* pgg-gpg.el (pgg-scheme-lookup-key): Generate *PGG-output* buffer
	if it does not exist.

2000-01-24   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* semi-def.el (mime-user-interface-product): Bump up to
	EMIKO 1.13.10.

	* mime-image.el	[Emacs21]: Require `image' when compiling.
	(image-normalize): Use `create-image' with 3rd arg `data-p'.
	 (create-image): Advice it to accept 3rd arg `data-p'.

	* pgg-pgp.el. pgg-pgp5.el
	(pgg-scheme-verify-region): Don't send buffer contents.

	* mime-pgp.el (mime-view-application/pkcs7-mime): Rename from
	`mime-decrypt-application/pkcs7-mime'; handle `smime-type'
	parameter; abolish local variable `representation-type'.

	* semi-setup.el: Rename `mime-decrypt-application/pkcs7-mime' to
	`mime-view-application/pkcs7-mime'.

2000-01-18   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el,pgp-gpg.el,pgg-pgp.el,pgg-pgp5.el
	(pgg-scheme-lookup-key-string,pgg-scheme-encrypt-region,
	pgg-scheme-decrypt-region,pgg-scheme-sign-region,
	pgg-scheme-verify-region,pgg-scheme-insert-key,
	pgg-scheme-snarf-keys-region): Prepend `pgg-scheme' to each symbol.

	* pgg.el
	(pgg-encrypt-region,pgg-decrypt-region,pgg-sign-region,
	pgg-verify-region,pgg-insert-key,pgg-snarf-keys-region,
	pgg-lookup-key-string): Don't use `luna-send'.

2000-01-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-entity-button-visible-p): Comment out.
	(mime-display-entity): Don't use
	`mime-view-entity-button-visible-p'.

2000-01-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-find-entity-preview-situation): New function.
	(mime-display-multipart/alternative): Use
	`mime-find-entity-preview-situation'.
	(mime-display-entity): Likewise; prefer`*entity-button' and
	`*header'.
	(mime-preview-toggle-header): Modify `*header' instead of
	`header'; update `mime-preview-situation-example-list'.

2000-01-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-unify-situations): Fixed.
	(mime-view-define-keymap): Add new binding
	`mime-preview-toggle-header' for C-c h.
	(mime-preview-find-boundary-info): New function.
	(mime-preview-follow-current-entity): Use
	`mime-preview-find-boundary-info'.
	(mime-preview-toggle-header): New command.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-entity): Modify for
	`mime-unify-situations'.

	* mime-view.el (mime-unify-situations): Add new optional argument
	`required-name'; use it instead of `method'.
	(mime-display-multipart/alternative): Use `mime-unify-situations'.
	(mime-display-entity): Likewise.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-reduce-situation-examples): New function;
	delete `mime-reduce-acting-situation-examples'.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-find-every-situations): Renamed from
	`mime-view-find-every-acting-situation'; changed to variable.
	(mime-situation-examples-file): Renamed from
	`mime-acting-situation-examples-file'.
	(mime-preview-situation-example-list-max-size): New variable.
	(mime-save-situation-examples): Renamed from
	`mime-save-acting-situation-examples'; save
	`mime-preview-situation-example-list' if it is not null.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-acting-situation-example-list): Moved to
	mime-view.el.
	(mime-acting-situation-example-list-max-size): Likewise.
	(mime-save-acting-situation-examples): Likewise.
	(mime-reduce-acting-situation-examples): Likewise.

	* mime-view.el (mime-preview-situation-example-list): New
	variable.
	(mime-acting-situation-example-list): Moved from mime-play.el.
	(mime-acting-situation-example-list-max-size): Likewise.
	(mime-save-acting-situation-examples): Likewise.
	(mime-reduce-acting-situation-examples): Likewise.
	(mime-view-load-hook): Abolished.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-entity): Use `mime-unify-situations'.

	* mime-view.el (mime-unify-situations): New function.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-compare-situation-with-example): Moved to
	mime-view.el.
	(mime-sort-situation): Likewise.

	* mime-view.el (mime-compare-situation-with-example): Moved from
	mime-play.el.
	(mime-sort-situation): Likewise.

2000-01-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* postpet.el: New module.

	* SEMI-ELS (semi-modules-to-compile): Add `postpet'.

	* mime-play.el (mime-delq-null-situation): Moved to mime-view.el.

	* mime-view.el: Add setting for
	`mime-display-application/x-postpet' to autoload "postpet".
	(mime-delq-null-situation): Moved from mime-play.el.
	(unpack): Moved to postpet.el.
	(unpack-skip): Likewise.
	(unpack-fixed): Likewise.
	(unpack-byte): Likewise.
	(unpack-short): Likewise.
	(unpack-long): Likewise.
	(unpack-string): Likewise.
	(unpack-string-sjis): Likewise.
	(postpet-decode): Likewise.
	(mime-display-application/x-postpet): Likewise.

2000-01-11  Nakagawa, Makoto  <Makoto.Nakagawa@jp.compaq.com>

	* pgg-pgp.el, pgg-pgp5.el
	(pgg-scheme-lookup-key-string): Fix number of arguments against
	call-process.

	* pgg-pgp5.el (pgg-scheme-verify-region): Analize process output
	to see whether verify successed or not.

2000-01-05  Katsumi Yamaoka   <yamaoka@jpl.org>

	* Makefile, README.en: Update for the new CVS server.

1999-12-28   Daiki Ueno       <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-user-agent-value): Don't require
	`apel-ver' directly.

1999-12-28  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-user-agent-value): Use `error' instead of
	`file-error' for the handler of `condition-case' because XEmacs
	does not signal an error named `file-error' if the required feature
	is not provided.

1999-12-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* semi-setup.el (mime-setup-decode-message-header): Comment out.
	(mime-edit-mode-hook): Don't use
	`mime-setup-decode-message-header'.
	(mu-cite/pre-cite-hook): Don't use `eword-decode-header'.

1999-12-14  Akihiro Arisawa   <ari@atesoft.advantest.co.jp>

	* mime-view.el (mime-preview-follow-current-entity): Fetch field of
	`mime-view-following-required-fields-list' from parent entity if it
	is not exist in current entity.

1999-12-13  Katsumi Yamaoka   <yamaoka@jpl.org>

	* README.en: Update for the recent ML address and ftp site.

1999-12-11  Daiki Ueno        <ueno@ueda.info.waseda.ac.jp>

	* smime.el (smime-encrypt-region): Delete entity header.
	(smime-sign-region): Ditto.

	* mime-edit.el: Fix autoload settings for `smime-sign-region' and
	`smime-encrypt-region.
	(mime-edit-sign-smime): Set Content-Type
	`application/pkcs7-signature' instead of
	`application/x-pkcs7-signature'; add Content-Description.
	(mime-edit-encrypt-smime): Set content-type
	`application/pkcs7-mime' instead of `x-application/pkcs7-mime'.

	* mime-pgp.el: Fix autoload settings for `smime-verify-region' and
	`smime-decrypt-region.
	(mime-decrypt-application/pkcs7-mime):
	Bind `inhibit-read-only' to t.

1999-12-09  Daiki Ueno        <ueno@ueda.info.waseda.ac.jp>

	* semi-def.el (mime-user-interface-product): Bump up to
	EMIKO 1.13.9.

	* smime.el: Require `static' when compiling.
	(smime-directory-files): New macro.
	(smime-find-certificate): Use it.

1999-12-08  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* smime.el (smime-verify-region): Abolish local variable `cert-file'.
	(smime-find-certificate): Rename from `smime-search-certificate'.

	* mime-edit.el: Add autoload settings for `smime-encrypt-region' and
	`smime-sign-region'.
	(mime-edit-process-multipart-1): Handle type "smime-signed" and
	"smime-encrypted".
	(mime-edit-sign-smime): New function.
	(mime-edit-encrypt-smime): New function.
	(mime-edit-enclose-smime-signed-region): New function.
	(mime-edit-enclose-smime-encrypted-region): New function.

	* mime-pgp.el: Add autoload settings for `smime-decrypt-region' and
	`smime-verify-region'.
	(mime-verify-application/pkcs7-signature): New function.
	(mime-decrypt-application/pkcs7-mime): New function.

	* semi-setup.el: Set up for `mime-verify-application/pkcs7-signature'
	and `mime-decrypt-application/pkcs7-mime'.

1999-12-08  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* smime.el (smime-x509-hash): Use `call-process' instead of
	`call-process-region'.
	(smime-x509-subject): Ditto.

1999-12-08  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Add smime.el.

	* smime.el: New file.

1999-11-30  Tsukamoto Tetsuo  <czkmt@remus.dti.ne.jp>

	* mime-edit.el (mime-edit-decode-message-in-buffer): Don't decode
	the message header twice.

1999-11-30  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-remove-passphrase-cache): Add checking whether
	the passphrase has already been expired.

1999-11-26  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-pgp-user-id): New variable.
	(mime-edit-sign-pgp-mime): Undo last change; refer
	`mime-edit-pgp-user-id'.
	(mime-edit-encrypt-pgp-mime): Ditto.

	* pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el
	(encrypt-region): Refer `pgg-<impl>-user-id' if specified.
	(sign-region): Ditto.
	(decrypt-region): Ditto.
	(insert-key): Ditto.

1999-11-26  Nakagawa, Makoto  <Makoto.Nakagawa@jp.compaq.com>

	* mime-edit.el (mime-edit-sign-pgp-mime): Regard
	`pgg-default-user-id' as more preferrable if it's specified.
	(mime-edit-encrypt-pgp-mime): Ditto.

1999-11-22  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* semi-def.el (mime-user-interface-product): Bump up to
	EMIKO 1.13.8.

	* pgg.el (pgg-remove-passphrase-cache): Don't unbind passphrase.

1999-11-20  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-sign-pgp-mime): Bind
	`pgg-default-user-id' to the canonical address of From field.

	* pgg-def.el (pgg-cache-passphrase): New user option.

	* pgg.el (pgg-read-passphrase): Refer `pgg-cache-passphrase'.
	(pgg-remove-passphrase-cache): Fill cached passphrase with `_'.

	* pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (sign-region): Refer
	`pgg-cache-passphrase'.

1999-11-17  Katsumi Yamaoka <yamaoka@jpl.org>

	* mime-image.el (mime-display-image): Use
	`mime-image-normalize-xbm' if the feature `xemacs' is provided or
	the variable `image-types' is bound.

1999-11-17  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-image.el (mime-image-normalize-xbm): Work for the future
	FSF Emacsen as well.
	(mime-display-image): Always use `mime-image-normalize-xbm'.

1999-11-17  Katsumi Yamaoka <yamaoka@jpl.org>

	* mime-image.el (mime-image-normalize-xbm): New macro.
	(mime-display-image): Use it.

1999-11-13  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-temp-buffer-show-function): New function.
	(pgg-display-output-buffer): Use it.
	(pgg-save-coding-system): Use buffer narrowing.
	(pgg-encrypt-region, pgg-decrypt-region, pgg-sign-region,
	pgg-verify-region): Assume that the current region has already
	been narrowed.

1999-11-13  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-def.el (pgg-default-keyserver-address): Default to
	`wwwkeys.pgp.net'.

	* pgg.el (pgg-save-coding-system): New macro.
	(pgg-display-output-buffer): New function.
	(pgg-encrypt-region, pgg-decrypt-region, pgg-sign-region,
	pgg-verify-region, pgg-insert-key, pgg-snarf-keys-region):
	Add documentation string; use `pgg-save-coding-system'.
	(pgg-fetch-key): Fix documentation.

1999-11-11  Akihiro Arisawa   <ari@atesoft.advantest.co.jp>

	* mime-image.el (image-normalize): Use `write-region-as-binary'.

1999-11-11  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-pgp.el, pgg-pgp5.el (verify-region): Set default umask to 077.

1999-11-10  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-gpg.el (pgg-gpg-process-region): Enclose `start-process'
	with `as-binary-process'.

	* pgg-pgp.el (pgg-pgp-process-region): Enclose `start-process'
	with `as-binary-process'.

	* pgg-pgp5.el (pgg-pgp5-process-region): Enclose `start-process'
	with `as-binary-process'.

	* mime-edit.el (mime-edit-set-sign): Remove duplication.
	(mime-edit-set-encrypt): Ditto.
	(mime-edit-encrypt-pgp-mime): Encode header before encrypting.

	* mime-image.el (image-insert-at-point): Check the number of the
	arguments of `insert-image'.
	(mime-display-image): Rewrite.

1999-11-10  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>

	* mime-play.el: (mime-save-directory): New variable.
	(mime-save-content): Don't force filename parameter to be used.

1999-11-09  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-pgp.el, pgg-pgp5.el
	(sign-region): Don't convert line break	code.

1999-11-07  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-pgp.el (mime-verify-application/pgp-signature): Don't
	scroll MIME-echo buffer, just set window starting point.
	(mime-add-application/pgp-keys): Ditto.

1999-11-06  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-sign-region): Add optional argument `cleartext'.

	* mime-ui-en.sgml, mime-ui-ja.sgml: Remove description about
	`pgp-functions-alist' and `pgp-function'; add description about
	`pgg-default-scheme' and `pgg-scheme'.

	* NEWS (PGP 5.0i and GnuPG are now supported for PGP/MIME):
	New section.

	* pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (encrypt-region): Add
	sender's user id to the recipients list if `pgg-encrypt-for-me' is
	specified.

	* pgg-def.el (pgg-encrypt-for-me): New user option.

	* mime-edit.el:
	(mime-edit-decode-multipart-in-buffer): Sync up with semi-pgpgpg_20.
	(mime-edit-decode-message-in-buffer): Ditto.
	(mime-edit-decode-single-part-in-buffer): Ditto.

1999-11-06   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-verify-region): Bind `pgg-scheme' in the predicate
	of whether to fetch signer's public key.
	(pgg-convert-lbt-region): New macro.
	(pgg-as-lbt): New macro.

	* mime-edit.el (mime-edit-encrypt-pgp-mime): Extract canonical
	address of From field to use it as default user id; tokenize
	bodies of the recipient fields.
	(mime-edit-make-encrypt-recipient-header): Undo last change.
	(mime-edit-translate-buffer): Do `undo-boundary'
	before translating.

	* pgg-gpg.el (sign-region): Use `pgg-as-lbt'.
	(pgg-gpg-process-region): Use `pgg-convert-lbt-region'.
	(encrypt-region): Don't ask passphrase.

	* pgg-pgp5.el (sign-region): Use `pgg-as-lbt'.
	(pgg-pgp5-process-region): Use `pgg-convert-lbt-region'.
	(encrypt-region): Don't ask passphrase.

	* pgg-pgp.el (verify-region): Fill errors buffer.
	(pgg-pgp-process-region): Use `pgg-convert-lbt-region'.
	(sign-region): Use `pgg-as-lbt'.
	(encrypt-region): Don't ask passphrase.

1999-11-06   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-parse.el (pgg-byte-after): Always pass the first argument
	of `char-after'.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-pgp.el (sign-region): Fix regexp for the beginning of armor.

	* pgg-gpg.el (encrypt-region): Don't use "--textmode" in GPG
	arguments, replace line break code with CRLF while signing
	instead.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-pgp.el (mime-verify-application/pgp-signature): Copy the
	messages in PGG buffers to MIME-echo buffer instead of binding
	`pgg-output-buffer'.
	(mime-add-application/pgp-keys): Likewise.

	* pgg-gpg.el (verify-region): Fill errors buffer whether
	verification has succeeded or not.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (snarf-keys-region):
	Use `pgg-process-when-success'.

	* pgg.el (pgg-encrypt-region): Add autoload cookie.
	(pgg-decrypt-region): Ditto.
	(pgg-sign-region): Ditto.
	(pgg-verify-region): Don't modify the buffer; add autload cookie.
	(pgg-snarf-keys-region): Add interactive spec; add autload cookie.
	(pgg-insert-key): Add interactive spec; add autload cookie.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-gpg.el (pgg-gpg-shell-command-switch): New user option.
	(pgg-gpg-process-region): Bind `shell-command-switch' to the value
	of `pgg-gpg-shell-command-switch'.

	* pgg-pgp.el (pgg-pgp-shell-command-switch): New user option.
	(pgg-pgp-process-region): Bind `shell-command-switch' to the value
	of `pgg-pgp-shell-command-switch'.

	* pgg-pgp5.el (pgg-pgp5-shell-command-switch): New user option.
	(pgg-pgp5-process-region): Bind `shell-command-switch' to the value
	of `pgg-pgp5-shell-command-switch'.

	* pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (sign-region): Use fixed end
	position of the signature.

	* mime-pgp.el: Add autoload for `pgg-decrypt-region',
	`pgg-verify-region', `pgg-snarf-keys-region'.
	(mime-view-application/pgp): Don't use `pgp-function'.
	(mime-verify-application/pgp-signature): Ditto.
	(mime-add-application/pgp-keys): Ditto.
	(mime-pgp-command): Abolish.
	(mime-pgp-default-language): Abolish.
	(mime-pgp-good-signature-regexp-alist): Abolish.
	(mime-pgp-key-expected-regexp-alist): Abolish
	(mime-pgp-check-signature): Abolish.

	* semi-def.el (pgp-function-alist): Abolish.
	(pgp-function): Abolish.

	* mime-edit.el: Add autoload for `pgg-encrypt-region',
	`pgg-sign-region', `pgg-insert-key'.
	(mime-edit-sign-pgp-mime): Throw an error when
	`pgg-sign-region' returns nil; don't use `pgp-function'.
	(mime-edit-encrypt-pgp-mime): Throw an error when
	`pgg-encrypt-region' returns nil; don't use `pgp-function'.
	(mime-edit-sign-pgp-kazu): Don't use `pgp-function'.
	(mime-edit-encrypt-pgp-mime): Ditto.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-pgp.el (mime-add-application/pgp-keys): Don't display
	public key block; snarf keys immediately.

	* pgg.el (pgg-insert-url-with-program): Call program asynchronously.

1999-11-05   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-def.el (pgg-echo-buffer): New variable.

	* pgg.el (pgg-process-when-success): New macro.
	(pgg-insert-url-with-w3): New function.
	(pgg-insert-url-program): New variable.
	(pgg-insert-url-extra-arguments): New variable.
	(pgg-insert-url-function): New variable.
	(pgg-fetch-key): Use it.
	(pgg-encrypt-region): If called interactively, popup
	`pgg-echo-buffer' to display encryption status.
	(pgg-decrypt-region): Likewise.
	(pgg-sign-region): Likewise.
	(pgg-verify-region): Likewise.

	* pgg-gpg.el (lookup-key-string): Use `call-process' instead of
	`pgg-gpg-process-region'.
	(encrypt-region): Use `pgg-process-when-success'; if the output
	buffer is empty, don't copy errors, just return nil.
	(decrypt-region): Likewise.
	(verify-region): Check the contents of status buffer to looking
	for `GOODSIG' response.
	(sign-region): Accept optional argument `clearsign'.

	* pgg-pgp.el (lookup-key-string): Use `call-process' instead of
	`pgg-pgp-process-region'.
	(encrypt-region): Use `pgg-process-when-success'; if the output
	buffer is empty, don't copy errors, just return nil.
	(decrypt-region): Likewise.
	(verify-region): Likewise.
	(sign-region): Accept optional argument `clearsign'.

	* pgg-pgp5.el (lookup-key-string): Use `call-process' instead of
	`pgg-pgp5-process-region'.
	(encrypt-region): Use `pgg-process-when-success'; if the output
	buffer is empty, don't copy errors, just return nil.
	(decrypt-region): Likewise.
	(verify-region): Likewise.
	(sign-region): Accept optional argument `clearsign'.

1999-11-04   Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-verify-region): Ignore all errors encountered on
	calling `pgg-fetch-key'.

1999-11-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-pgp.el (mime-verify-application/pgp-signature): Enclose
	with `unwind-protect' to be sure of deleting *.asc files.

	* pgg-pgp.el (pgg-pgp-process-region): Set `PGPPASSFD' before
	starting PGP process.

	* pgg-pgp5.el (pgg-pgp5-process-region): Ditto.

1999-11-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-parse.el (pgg-parse-crc24): Don't use any `write' ops.
	(pgg-parse-crc24-string): Use `ccl-execute-on-string'.

1999-11-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-set-sign): Preserve last status of
	`mime-edit-pgp-processing'.
	(mime-edit-set-encrypt): Ditto.
	(mime-edit-pgp-enclose-buffer): Process
	`mime-edit-pgp-enclose-buffer' consequently.

	* pgg-parse.el (pgg-decode-packets): Don't use
	`mime-encode-string'.
	(pgg-ignore-packet-checksum): Default to t.

1999-11-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el: Rename the field name `cipher-algorithm' to
	`symmetric-key-algorithm'.
	(pgg-verify-condition): Fix documentation.
	(pgg-decrypt-condition): Ditto.

1999-11-04  Katsumi Yamaoka <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-preview-message): Inherit the value of
	`mime-edit-pgp-processing'.

1999-11-04  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-encrypt-region): Add interactive spec.
	(pgg-decrypt-region): Ditto.
	(pgg-sign-region): Ditto.
	(pgg-verify-region): Add optional argument `fetch' to fetch
	signer's public key.

	* pgg-def.el (pgg-default-keyserver-address): New variable.

	* semi-def.el (pgp-function-alist): Remove `lookup-key'.

	* mime-pgp.el (mime-display-application/pgp-signature): Abolish.
	(mime-display-application/pgp-encrypted): Abolish.
	(mime-display-application/pgp-keys): Abolish.
	(mime-pgp-keyserver-url-template): Abolish.
	(mime-pgp-keyserver-address): Abolish.
	(mime-pgp-keyserver-port): Abolish.
	(mime-pgp-keyserver-protocol): Abolish.
	(mime-pgp-fetch-key): Abolish.

	* semi-setup.el: Delete default setting of
	`mime-display-application/pgp-signature', 
	`mime-display-application/pgp-encrypted',
	`mime-display-application/pgp-keys'

1999-11-03  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-fetch-key): Protect `buffer-file-name'.

	* pgg-gpg.el (snarf-keys-region): Add `-' as extra argument of
	gpg --import; convert status code into an integer.

1999-11-03  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* semi-def.el (pgp-function-alist): Add `lookup-key'.

	* pgg.el, pgg-gpg.el, pgg-pgp5.el, pgg-pgp.el:
	Rename generic function `lookup-key' to `lookup-key-string';
	add optional argument `type'.

	* pgg-def.el (pgg-truncate-key-identifier): New macro.

	* pgg.el: Rename generic function `lookup-key' to
	`lookup-key-string'; add optional argument `type'.
	(pgg-fetch-key): New function.
	(pgg-snarf-keys-region): Fix typo.
	(pgg-lookup-key-string): New function.
	(pgg-read-passphrase): Use `pgg-truncate-key-identifier'.
	(pgg-add-passphrase-cache): Ditto.

	* mime-pgp.el (mime-pgp-keyserver-url-template): New variable
	imported from semi-pgpgpg.
	(mime-pgp-keyserver-address): Ditto.
	(mime-pgp-keyserver-port): Ditto.
	(mime-pgp-keyserver-protocol): New variable.
	(mime-pgp-fetch-key): New function.
	(mime-verify-application/pgp-signature): Prompt user to fetch
	signer's public key.

1999-11-03  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-fetch-public-key): New function.

	* pgg-pgp.el (lookup-key): New generic function.
	(encrypt-region): Use `lookup-key'; cache passphrase if the
	encryption has done successfully.
	(sign-region): Likewise.
	(decrypt-region): Use `lookup-key'.

	* pgg.el (pgg-scheme): Remove all slots.
	(pgg-decrypt-codition): Rename tag `cipher-algorithm' to
	`symmetric-key-algorithm'.
	(lookup-key): Add documentation about the new generic function.

	* pgg-parse.el (pgg-decode-armor-region): Remove autoload cookie.
	(pgg-armor-header-lines): New variable.

1999-11-02  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg.el (pgg-add-passphrase-cache): Use only four octets of the key.
	(pgg-read-passphrase): Ditto.
	
	* pgg-pgp5.el (lookup-key): New generic function. 
	(encrypt-region): Use `lookup-key'; cache passphrase if the
	encryption has done successfully.
	(sign-region): Likewise.
	(decrypt-region): Use `lookup-key'.

1999-11-02  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-parse.el
	(pgg-parse-public-key-encrypted-session-key-packet):
	Rename tag `public-key-identifier' to `key-identifier'.

	* mime-pgp.el
	(mime-display-application/pgp-encrypted): Refer it.

	* pgg.el (pgg-passphrase-cache-expiry): New variable.
	(pgg-passphrase-cache): New variable.
	(pgg-read-passphrase): Add optional argument `key'.
	(pgg-add-passphrase-cache): New function.
	(pgg-remove-passphrase-cache): New function.

	* pgg-gpg.el (lookup-key): New generic function.
	(encrypt-region): Use `lookup-key'; cache passphrase if the
	encryption has done successfully.
	(sign-region): Likewise.
	(decrypt-region): Use `lookup-key'.

1999-11-02  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* pgg-parse.el (pgg-parse-length-type): Fix typo.
	(pgg-parse-public-key-encrypted-session-key-packet): Use
	`pgg-read-bytes-string' instead of `pgg-read-bytes'.

1999-11-02  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-sign-pgp-mime): Rewrite with PGG functions.
	(mime-edit-encrypt-pgp-mime): Likewise.
	(mime-edit-encrypt-recipient-fields-list): Return recipients as list.

	* mime-pgp.el: Add comment that this module is based on
	draft-yamamoto-openpgp-mime-00.txt (OpenPGP/MIME) and RFC 2440
	(OpenPGP Message Format) as well. 
	(mime-verify-application/pgp-signature): Use
	`pgg-verify-region' instead of `mime-pgp-check-signature'.
	(mime-display-application/pgp-signature): New function.
	(mime-display-application/pgp-encrypted): New function.
	(mime-display-application/pgp-keys): New function.

	* semi-setup.el: Set up for
	`mime-display-application/pgp-signature', 
	`mime-display-application/pgp-encrypted',
	`mime-display-application/pgp-keys'.
	(mime-setup-enable-pgp): Default to t.

	* SEMI-ELS (semi-modules-to-compile): Add `pgg', `pgg-parse',
	`pgg-gpg', `pgg-pgp' and `pgg-pgp5' instead of `mime-mc'.

	* EMIKO-VERSION, pgg-def.el, pgg.el, pgg-gpg.el, 
	pgg-pgp5.el, pgg-pgp.el, pgg-parse.el: New file.

	* mime-image.el (mime-display-image): Rewrite.

	* semi-def.el (mime-user-interface-product): Modify for EMIKO.
	(pgp-function-alist): Replace each method with PGG function.

	* mime-view.el (mime-view-popup-menu): New variable.
	(mime-view-popup-menu): New function.
	(mime-view-define-keymap): Bind `mime-view-popup-menu' to
	`mouse-button-3'.

1999-11-01  Tanaka Akira  <akr@jaist.ac.jp>

	* mime-view.el (mime-display-application/x-postpet): New function.
	(mime-preview-condition): Set up for
	'mime-preview-application/x-postpet.
	(unpack): New macro.
	(unpack-skip): New function.
	(unpack-fixed): New function.
	(unpack-byte): New function.
	(unpack-short): New function.
	(unpack-long): New function.
	(unpack-string): New function.
	(unpack-string-sjis): New function.
	(postpet-decode): New function.

1999-10-17  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>

	* SEMI-MK (install-semi-package): Delte auto-autoloads.el
	and custom-load.el


1999-10-16  MORIOKA Tomohiko  <tomo@m17n.org>

	* SEMI: Version 1.13.7 (Awazu) released.

1999-10-06  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>

	* mime-view.el (mime-preview-move-to-upper): Scroll
	according to mime-preview-move-scroll.

1999-10-05  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>

	* mime-view.el (mime-preview-scroll-down-entity,
	mime-preview-scroll-up-entity): Recenter when moving to
	a next entity.
	(mime-preview-move-scroll): New variable.
	(mime-preview-move-to-previous, mime-preview-move-to-next):
	Recenter according to the variable mime-preview-move-scroll.

1999-10-04  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-view.el (mime-preview-move-to-next): Attempt to go to the
	next page if the return value of `next-single-property-change' is
	greater than `point-max'.
	(mime-preview-move-to-previous): Don't move backward at the
	beginning of the buffer; attempt to go to the previous page if the
	return value of `previous-single-property-change' is less than
	`point-min'.

1999-09-29  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-multipart/mixed): Share cell of
	`major-mode'.
	(mime-display-multipart/alternative): Likewise.
	(mime-display-entity): Refer `major-mode' value of a situation
	instead of buffer-local-variable `major-mode'.

1999-09-29  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-preview-play-current-entity): Use
	text-property `mime-view-situation' as the initial value of
	acting-situation to add major-mode.

1999-09-29  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-edit.el (mime-content-types): Delete text/x-rot13-47-48 in
	default definition. [cf. <tm-ja:4904>, <tm-ja:4907>]

1999-09-27  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-user-agent-value): Include
	`emacs-patch-level'.  It exists in XEmacs 21.1.1 or later.

1999-09-20  Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp>

	* mime-view.el (mime-preview-scroll-up-entitiy,
	mime-preview-scroll-down-entity): Use scroll-up and scroll-down
	instead of forward-line.
	(mime-preview-next-line-entity,
	mime-preview-previous-line-entity): Add optional argument LINES
	and scroll LINES lines if specified. Add doc-string.


1999-09-13  MORIOKA Tomohiko  <tomo@m17n.org>

	* SEMI: Version 1.13.6 (Komatsu) released.

1999-08-30  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-edit.el (mime-edit-mime-version-field-for-message/partial):
	Encode `mime-edit-version'.

1999-08-28  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-store-message/partial-piece): Use
	`directory-files' to check number of pieces.

1999-08-26  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-store-message/partial-piece): Don't refer
	`mime-preview-buffer'.

1999-08-25  Katsumi Yamaoka   <yamaoka@jpl.org>

	* SEMI-CFG: Use `if' instead of `when'.


1999-08-18  MORIOKA Tomohiko  <tomo@m17n.org>

	* REMI: Version 1.13.2 (Ōike-Ikoinomori) released.

1999-08-17  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-view.el (mime-preview-original-major-mode): Modify the way
	of checking for the end of the buffer.

1999-08-17  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-view.el (mime-preview-original-major-mode): Don't use
	`get-text-property' at the end of the buffer.

1999-08-02  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-preview-follow-current-entity): Don't use
	`mime-entity-buffer'.

1999-05-17  KOSEKI Yoshinori  <kose@yk.NetLaputa.ne.jp>

	* mime-pgp.el (mime-verify-application/pgp-signature): Specify the
	name of `sig-file' explicitly for `mime-pgp-check-signature'.
	(mime-pgp-check-signature): Accept new arg `sig-file' and feed its
	value to the verify command.

1999-07-29  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-entity): Get media-type from situation
	instead of entity; display prompt and call `mime-save-content' if
	method is not found.
	(mime-detect-content): Call `mime-play-entity' even if media-type
	specification is not found in `mime-magic-type-alist'.

1999-07-28  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-view-entity-title): Use
	`mime-entity-read-field' instead of `mime-read-field'.
	(mime-display-message): Use `major-mode' of
	mime-entity-header-buffer as the default value of
	original-major-mode.

	* mime-play.el (mime-entity-safe-filename): Use
	`mime-entity-read-field' instead of `mime-read-field'.
	(mime-view-message/rfc822): New implementation.

	* mime-pgp.el (mime-add-application/pgp-keys): Use
	`mime-entity-number' instead of `mime-raw-point-to-entity-number'.

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Use
	`mime-entity-read-field' instead of `mime-read-field'.

	* mime-bbdb.el (mime-bbdb/update-record): Use
	`mime-entity-read-field' instead of `mime-read-field'; use
	`mime-entity-fetch-field' instead of `mime-fetch-field'.

1999-07-28  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-raw-find-entity-from-point): Deleted.
	(mime-raw-buffer): Deleted.
	(mime-preview-original-major-mode): Add new optional argument
	`point'; refer text-property `mime-view-situation' instead of
	using `mime-entity-buffer'.
	(mime-raw-point-to-entity-node-id): Deleted.
	(mime-raw-point-to-entity-number): Deleted.
	(mime-raw-flatten-message-info): Deleted.
	(mime-display-entity): Add text-property `mime-view-situation' to
	each entity.


1999-07-27  MORIOKA Tomohiko  <tomo@m17n.org>

	* SEMI: Version 1.13.5 (Meihō) released.

1999-07-27  MORIOKA Tomohiko  <tomo@m17n.org>

	* NEWS (Don't expect raw-buffer): New subsection.
	(Now acting-method must not expect to run in raw-buffer): Changed
	as a subsubsection of subsection `Don't expect raw-buffer'.
	(Don't refer variable `mime-raw-buffer'): New subsubsection.
	(Don't refer variable `mime-preview-buffer'): New subsubsection.

	* NEWS (Requires FLIM 1.13 API): New subsection.

1999-07-23  MORIOKA Tomohiko  <tomo@m17n.org>

	* README.en (Required environment): Change required FLIM to
	1.13.1; change location of APEL and FLIM.


1999-07-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* REMI: Version 1.13.1 (Kubiki) released.

1999-07-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el
	(mime-preview-quitting-method-for-mime-show-message-mode): Don't
	refer `mime-raw-buffer'.

1999-07-21  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-store-message/partial-piece): Don't refer
	`mime-preview-buffer'.


1999-07-21  MORIOKA Tomohiko  <tomo@m17n.org>

	* REMI: Version 1.13.0 (Saigata) released.

1999-07-21  MORIOKA Tomohiko  <tomo@m17n.org>

	* Makefile (EXEC_PREFIX): Deleted.
	(elc): Change command-line interface to delete `EXEC_PREFIX'.
	(install-elc): Likewise.

	* SEMI-MK (config-semi): Change command-line interface to delete
	`EXEC_PREFIX'.

	* SEMI-CFG (EXEC_PREFIX): Deleted.

1999-07-07  Daiki Ueno  <ueno@ueda.info.waseda.ac.jp>

	* mime-edit.el (mime-edit-quitting-method): Don't refer
	`mime-raw-buffer'.

	* mime-view.el (mime-preview-follow-current-entity): Don't refer
	`mime-raw-buffer'.

1999-06-17  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-edit.el (mime-edit-user-agent-value): Modify for XEmacs
	UTF-2000-MULE.

1999-06-04  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-edit.el (mime-edit-user-agent-value): Modify code to get
	version number of XEmacs. [cf. <tm-ja:4561>]

1999-05-22  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-entity-situation): Don't refer `major-mode'
	of a mime-entity-buffer.
	(mime-display-multipart/mixed): Add `major-mode' of SITUATION to
	default-situation of children.
	(mime-display-multipart/alternative): Likewise.
	(mime-display-entity): Don't refer `raw-buffer'; use
	`mime-goto-header-start-point'.
	(mime-display-message): Add new optional argument
	`original-major-mode'; don't refer `raw-buffer'; use
	`mime-entity-name' to make name of `preview-buffer'; don't set up
	`mime-raw-buffer' of `preview-buffer'; use `original-major-mode'
	as value of `major-mode' field of default-situation; don't pop up
	`preview-buffer' in suitable window; return `preview-buffer'.
	(mime-view-buffer): Pop up `preview-buffer' in suitable window.

1999-05-31  Keiichi Suzuki  <keiichi@nanap.org>

	* mime-play.el (mime-show-echo-buffer): Bind `buffer-read-only' to
	nil, while insert messages.

1999-05-28  MORIOKA Tomohiko  <tomo@m17n.org>

	* README.en (Required environment): Require APEL 9.20.

1999-05-27  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-play.el (mime-play-entity): Enter to the calist-package
	`mime-view' before call `ctree-find-calist'.

	* mime-view.el (mime-view): New calist-package.
	(mime-display-entity): Enter to the calist-package `mime-view'
	before call `ctree-match-calist'.

1999-05-23  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-edit.el (mime-edit-mime-version-value): Don't use
	`eval-when-compile' to avoid problem with XEmacs-MULE.
	(mime-edit-mime-version-field-for-message/partial): Likewise.

1999-05-20  MORIOKA Tomohiko  <tomo@m17n.org>

	* NEWS (Text property `mime-view-entity-{header|body}'): New
	subsection.
	(Behavior change about `mime-display-header-hook'): Likewise.

	* mime-view.el (mime-display-entity): Don't move to (point-max)
	before run `mime-display-header-hook)'.

1999-05-19  MORIOKA Tomohiko  <tomo@m17n.org>

	* mime-view.el (mime-display-entity): Put text-property
	`mime-view-entity-header' and `mime-view-entity-body' to header
	and body; run `mime-display-header-hook' before insert "\n".
	(mime-preview-follow-current-entity): Use text-property
	`mime-view-entity-header'.


1999-05-12  MORIOKA Tomohiko  <tomo@m17n.org>

	* SEMI: Version 1.13.4 (Terai) released.

1999-04-06  Shuhei KOBAYASHI  <shuhei@aqua.ocn.ne.jp>

	* mime-edit.el (mime-delete-field): Use `std11-field-end'.

1999-03-30  Keiichi Suzuki  <kei-suzu@mail.wbs.ne.jp>

	* mime-edit.el (mime-edit-decode-single-part-in-buffer): Normalize
	EOL code in MIME encoded text part.

1999-03-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-follow-current-entity): Don't copy
	header if current entity is root.

1999-03-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-charset-type-list): Add `tis-620'.


1999-02-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.13.3 (Komaiko) released.

1999-02-26  Katsumi Yamaoka   <yamaoka@jpl.org>

	* SEMI-MK (install-semi-package): Install mime-setup.el(c).
	(compile-semi-package): Compile mime-setup.el as well.

1999-02-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-content-types): Add definition of
	application/vnd.ms-powerpoint for myself :-P
	(mime-file-types): Add setting of *.ppt for
	application/vnd.ms-powerpoint.

1999-02-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Call
	`mime-store-message/partial-piece' in the buffer when it is
	called.

	* mime-play.el (mime-store-message/partial-piece): Don't move to
	point-min.

	* mime-play.el (mime-store-message/partial-piece): Don't expect
	called in raw-buffer.


1999-01-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.13.2 (Mikawa) released.

1999-01-26  Katsumi Yamaoka   <yamaoka@jpl.org>

	* README.en: Notice that 1.12.5 or later of FLIM is required.

1999-01-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-preview-play-current-entity): Add autoload
	cookie.
	(mime-play-entity): Likewise.

	* mime-view.el (mime-display-message): Add autoload cookie; add
	DOC-string.
	(mime-view-buffer): Add autoload cookie.

1999-01-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-reduce-acting-situation-examples): New
	implementation.

1999-01-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-caesar): Select window which displays
	current-buffer if it is not selected <to fix problem with mouse
	operations>.

1999-01-26  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-decode-single-part-in-buffer): Limit the
	search bound for the end of "Content-Transfer-Encoding" field.

1999-01-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-caesar): New implementation.

1999-01-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-caesar): Don't expect called in
	raw-buffer; use `mime-insert-entity'.

1999-01-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-w3.el (mime-preview-text/html): Display err if error occurs
	in `w3-region'.

	* mime-w3.el (mime-preview-text/html): Guard from error of
	`w3-region'.


1999-01-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.13.1 (Kaga-Kasama) released.

1999-01-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* TODO (Don't expect raw-buffer): New item.
	(lazy generating of situations from mime-entity information): New
	item.

	* TODO (Don't use filter-model): finished.

	* TODO (multipart/related support): virtually finished.

1999-01-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* Delete README.ja until it is fixed.

	* mime-w3.el (url-cid): Use `mime-insert-entity-content'.

	* README.ja, README.en (Required environment): Require FLIM
	1.12.4.

	* mime-w3.el (mime-w3-message-structure): New variable.
	(mime-preview-text/html): Set up `mime-w3-message-structure'.
	(url-cid): New function; set up as registered-protocol of url.

1999-01-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.ja: Modify title.

	* README.ja: Add notice about translation.

	* README.ja, README.en (Required environment): Require FLIM
	1.12.3; delete description about enriched.el because anything
	older than Emacs 19.28 are not supported.

	* mime-pgp.el (mime-view-application/pgp): Don't expect called in
	raw-buffer; use `mime-insert-entity'.

	* mime-play.el (mime-view-message/rfc822): Use
	`mime-insert-entity'.

1999-01-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Function `mime-play-entity'): Sync with latest
	specification.

	* mime-pgp.el (mime-verify-multipart/signed): Modify for interface
	change of `mime-play-entity'.

	* mime-play.el (mime-preview-play-current-entity): Modify for
	interface change of `mime-play-entity'.
	(mime-play-entity): Change interface; abolish optional arguments
	`mode' and `ignore-example'.
	(mime-detect-content): Modify for interface change of
	`mime-play-entity'.

	* mime-view.el (mime-entity-situation): Add new optional argument
	`situation'; it is preferred to attributes of entity.

1999-01-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-version): Don't use `eval-when-compile'
	to avoid to break product-code-name.

	* mime-edit.el (mime-edit-version): Don't use `eval-when-compile'
	to avoid to break product-code-name.


1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.13.0 (Mattō) released.

1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-message/rfc822): Don't expect called in
	raw-buffer.

1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Function `mime-play-entity'): Add description about
	interface change of `mime-play-entity'.

	* mime-play.el (mime-play-entity): Change interface.

1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Changes in SEMI 1.13): New section.

	* NEWS (Changes in SEMI 1.12): New section.

1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-view-application/pgp): Don't expect called in
	raw-buffer.
	(mime-verify-application/pgp-signature): Likewise.

	* mime-play.el: Abolish variable
	`mime-preview-after-decoded-position'.
	(mime-preview-play-current-entity): Use `mime-play-entity' simply;
	don't switch to raw-buffer.
	(mime-play-entity): renamed from `mime-raw-play-entity'; don't
	expect called in raw-buffer.
	(mime-activate-mailcap-method): Don't expect called in raw-buffer.
	(mime-show-echo-buffer): Permit to run in preview-buffer.


1999-01-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.12.1 ([JR] Nonoichi) released.

	* mime-play.el (mime-detect-content): Use `mime-entity-content'
	not to refer to buffer directly.

1999-01-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Must require `emu'.

1999-01-04  OKUNISHI Fujikazu <fuji0924@mbox.kyoto-inet.or.jp>

	* mime-view.el (mime-view-insert-entity-button): Use URL if it
	exists in Content-Type field.

	* mime-play.el (mime-raw-browse-url-function): Default to
	`mime-browse-url-function' instead of `mime-browse-url'.

1998-12-24  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-view.el (mime-preview-move-to-next): Don't move forward at
	the end of buffer.

1998-12-03  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-user-agent-value): Include
	`xemacs-betaname'.


1998-12-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.12.0 (Nishi-Kanazawa) released.

1998-11-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (eliminate-top-spaces): New function (moved from
	mime-def.el of FLIM).

1998-11-17  Kazuhiro Ohta     <ohta@ele.cst.nihon-u.ac.jp>

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Fix
	DOC-string.

	* mime-view.el (mime-view-buffer): Fix DOC-string.

1998-11-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Changes in SEMI 1.11): New section.

1998-11-18  Katsumi Yamaoka   <yamaoka@jpl.org>

	* semi-setup.el (mime-setup-decode-message-header): Use
	`mime-decode-header-in-buffer' instead of `eword-decode-header'.

	* mime-view.el (mime-preview-follow-current-entity): Likewise.

1998-11-18  Keiichi Suzuki    <kei-suzu@mail.wbs.ne.jp>

	* mime-edit.el (mime-content-transfer-encoding-priority-list): New
	variable.
	(mime-edit-translate-single-part-tag): Change return value to
	`nil' or a cons which include content-type and encoding.
	(mime-edit-translate-region): Generate `encodeing' from
	return value of `mime-edit-translate-single-part-tag'.


1998-11-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.11.0 (Kanazawa) released.

	* README.ja, README.en (Required environment): Modify for APEL
	9.11 and FLIM 1.12.0.

1998-11-12  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-split-ignored-field-regexp): Add "^".

1998-11-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-bbdb.el (mime-bbdb/update-record): Use
	`mime-decode-field-body' instead of
	`eword-decode-structured-field-body'.

1998-10-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-message-in-buffer): Delete fields
	match with `mime-edit-again-ignored-field-regexp' then call
	`mime-decode-header-in-buffer'.
	(mime-edit-again): Delete header filter.

1998-10-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-multipart-in-buffer): Change
	interface.
	(mime-edit-decode-single-part-in-buffer): New function.
	(mime-edit-decode-message-in-buffer): Swap arguments; use function
	`mime-edit-decode-single-part-in-buffer'.
	(mime-edit-again): Modify for
	`mime-edit-decode-message-in-buffer'.

1998-10-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-multipart-in-buffer): New
	function.
	(mime-edit-decode-message-in-buffer): Add new optional argument
	`default-content-type'; use function
	`mime-edit-decode-multipart-in-buffer'; add autoload cookie.
	(mime-edit-again): Add autoload cookie.

	* mime-edit.el (mime-edit-decode-message-in-buffer): Renamed from
	`mime-edit-decode-buffer'; change `not-decode-text' to optional
	argument.


1998-10-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.10.2 (Higashi-Kanazawa) released.

1998-10-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Abolish variable `mime-temp-directory'): New subsection.

1998-10-27  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-edit.el (mime-edit-decode-buffer): Limit search bound for
	"Content-Transfer-Encoding:".


1998-10-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.10.1 (Morimoto) released.

	* README.ja, README.en (Required environment): Modify for APEL 9.6
	and FLIM 1.11.2.

1998-10-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-pgp.el, mime-partial.el, mime-image.el,
	mime-edit.el: Use `temporary-file-directory' instead of
	`mime-temp-directory'.


1998-10-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.10.0 (Tsubata) released.

1998-10-22  Yoshiki Hayashi   <g740685@komaba.ecc.u-tokyo.ac.jp>

	* README.ja: New file.

1998-10-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el, mime-view.el: Use `(featurep 'xemacs)' instead of
	`running-xemacs'.

1998-10-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, SEMI-ELS: Move function `mime-display-text/plain',
	`mime-display-text/enriched' and `mime-display-text/richtext' from
	mime-text to mime-view.el; abolish mime-text.el.

	* mime-play.el: Don't Require `mime-text' when compiling.

	* mime-w3.el: Require `mime' instead of `mime-text'.

1998-10-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el (mime-setup-enable-inline-image): Use `(featurep
	'xemacs)' instead of `running-xemacs'.

1998-10-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Required environment): Modify to require APEL 9.5 and
	FLIM 1.11.1.

	* mime-edit.el: - Don't require emu.
	                - Require invisible.

	* semi-def.el: Require poe instead of emu.

1998-10-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-buffer): Convert encoding to
	lower case.

1998-10-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-ignored-field-list): Modify each element
	of initial value to include `:'.
	(mime-view-visible-field-list): Likewise.
	(mime-display-entity): Use `mime-insert-header' instead of
	`mime-insert-decoded-header'.

1998-10-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-buffer): Call
	`mule-caesar-region' for text/x-rot13-47-48 entity.

1998-09-22  Shozo UEHARA      <uehara@eken.phys.nagoya-u.ac.jp>

	* mime-play.el (mime-raw-play-entity): Initialize `max-escore' by
	0. <cf. [tm-ja:3432]>

1998-10-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Changes in SEMI 1.10): New section.

	* NEWS (Changes in SEMI 1.9): New section.

	* NEWS (User-Agent field): New subsection.

1998-10-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-caesar): Use `mime-insert-text-content'
	instead of `mime-text-insert-decoded-body'.

	* mime-w3.el (mime-preview-text/html): Use
	`mime-insert-text-content' instead of
	`mime-text-insert-decoded-body'.

	* mime-text.el: Abolish function `mime-text-insert-decoded-body'.
	(mime-display-text/plain): Use `mime-insert-text-content' instead
	of `mime-text-insert-decoded-body'.
	(mime-display-text/richtext): Likewise.
	(mime-display-text/enriched): Likewise.


1998-10-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.9.1 (Kurikara) released.

1998-10-14  Jari Aalto        <jari.aalto@poboxes.com>

	* mime-edit.el (mime-file-types): Add some new mime types, and
	rearrange the types to logical sections: text; octext text and
	binary. <cf. [tm-en:1856]>

1998-10-12  Katsumi Yamaoka   <yamaoka@jpl.org>

	* README.en: Add explanation about `VERSION_SPECIFIC_LISPDIR'.

	* Makefile (install): Add new arg `VERSION_SPECIFIC_LISPDIR'.
	(install-elc): Likewise.

	* SEMI-MK (config-semi): Refer to `VERSION_SPECIFIC_LISPDIR'.

	* SEMI-CFG (VERSION_SPECIFIC_LISPDIR): New variable.

1998-10-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Abolish variable `SHELL' and `SHELLOPTION'.

1998-10-08  Katsumi Yamaoka   <yamaoka@jpl.org>

	* SEMI-CFG: Use `add-latest-path' for adding "custom" to
	load-path.

1998-10-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Don't use `when' before install is required; don't
	require cl.

1998-10-08  Katsumi Yamaoka   <yamaoka@jpl.org>

	* SEMI-CFG: Add "custom" to load-path.


1998-10-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.9.0 (Isurugi) released.

1998-10-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Required environment): Modify for APEL 9.1 and FLIM
	1.10.1.

1998-10-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-version): Enclose with
	`eval-and-compile'.

	* mime-edit.el (mime-edit-version): Renamed from
	`mime-edit-version-string'; use `mime-user-interface-product',
	`mime-product-name', `mime-product-version' and
	`mime-product-code-name'.
	(mime-edit-user-agent-value): Use `mime-user-interface-product',
	`mime-library-product', `mime-product-name',
	`mime-product-version' and `mime-product-code-name'.
	(mime-edit-mime-version-value): Rename `mime-edit-version-string'
	-> `mime-edit-version'.
	(mime-edit-mime-version-field-for-message/partial): Likewise.

	* mime-play.el (mime-save-acting-situation-examples): Rename
	`mime-view-version-string' -> `mime-view-version'.

	* mime-view.el (mime-view-version): Renamed from
	`mime-view-version-string'; use `mime-user-interface-product',
	`mime-product-name', `mime-product-version' and
	`mime-product-code-name'.

	* semi-def.el (mime-user-interface-product): New constant; abolish
	`mime-user-interface-version'.

1998-10-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-echo-window-is-shared-with-bbdb): Check bbdb
	is install or not to define default value.
	(mime-show-echo-buffer): New implementation about
	`mime-echo-window-is-shared-with-bbdb'.

1998-10-01  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-charset-type-list): Use `cn-gb' instead of
	`cn-gb2312' because `cn-gb2312' is typo.

1998-09-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-file-types): Use function
	`mime-encoding-list' instead of variable
	`mime-file-encoding-method-alist' to define default value.
	(mime-edit-insert-voice): Use function `mime-encoding-alist'
	instead of variable `mime-file-encoding-method-alist' for
	completion.
	(mime-prompt-for-encoding): Likewise.

1998-09-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-user-agent-value): Add
	system-configuration for Emacs and XEmacs.

1998-09-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-normalize-body): Use "7bit" for nil
	encoding as an argument of `mime-encode-region'.


1998-09-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.6 (Fukuoka) released.

1998-09-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Installation): Add description for `run in expanded
	place' and `install as a XEmacs package'.

	* README.en (Required environment): Require FLIM 1.9.2 or later.

1998-09-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-file-types): Abolish setting for
	text/richtext.
	(mime-edit-insert-text): Likewise.

	* mime-edit.el (mime-content-types): Modify comment style.

1998-09-13  Shin'ichiro Tanaka <tanaka@ifos.se.fujitsu.co.jp>

	* mime-edit.el (mime-content-types): Delete text/richtext and add
	text/css and text/xml (cf. [tm-ja:3387]).

1998-09-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-insert-user-agent-field): New variable
	(abolish `mime-edit-insert-x-emacs-field').
	(mime-edit-user-agent-value): New variable (abolish
	`mime-edit-x-emacs-value').
	(mime-edit-translate-body): Insert User-Agent field instead of
	`X-Emacs' field.
	(mime-edit-again-ignored-field-regexp): Add `User-Agent' instead
	of `X-Emacs' field conditionally.

1998-09-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-MK (config-semi-package): New function.
	(compile-semi-package): New function.
	(install-semi-package): New function.

	* SEMI-CFG (PACKAGEDIR): New variable.

	* Makefile: Abolish variable `SHELL', `MAKE', `CC' and `CFLAGS'.
	(XEMACS): New variable.
	(FLAGS): Add `-l SEMI-MK'.
	(PACKAGEDIR): New variable.
	(elc): Delete `-l SEMI-MK'.
	(install-elc): Delete `-l SEMI-MK'.  Abolish target `all', `tex',
	`dvi' and `ps'.
	(package): New target.
	(install-package): New target.
	(clean): Delete historical setting.


1998-08-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.5 (Nishi-Takaoka) released.

	* README.en (Required environment): Modify APEL and FLIM version.

	* mime-ui-en.sgml (Introduction): Translate.

1998-08-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-type-subtype-score-alist): Fix
	mismatched.

1998-08-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-text-insert-decoded-body): Specify line break
	code type as CRLF.

1998-08-10  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* mime-edit.el (mime-edit-normalize-body): Failed to canonicalize
	empty lines.

1998-08-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-w3.el (mime-preview-text/html): Insert dummy "\n" into end
	of entity to avoid keymap text-property problem.

1998-07-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Don't use "file" command to detect content of entity): New
	section.

	* mime-play.el (mime-magic-type-alist): New variable; abolish
	`mime-file-content-type-alist'.
	(mime-detect-content): New implementation (don't use "file"
	command).


1998-07-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.4 (Takaoka) released.

1998-07-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-ui-en.sgml, mime-ui-ja.sgml (message/partial sending): New
	section.

	* mime-edit.el (mime-edit-split-blind-field-regexp): Add
	DOC-string; change to user option.


1998-07-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* REMI: Version 1.8.4 (Takaoka) released.

1998-07-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Reduce `mime-acting-situation-example-list' while
	it is bigger than `mime-acting-situation-example-list-max-size'.

1998-07-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-preview-message): Use `mime-view-buffer'
	instead of `mime-view-mode'.


1998-07-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* REMI: Version 1.8.3 (Ecchū-Nakagawa) released.

	* mime-play.el (mime-delq-null-situation): Add new optional
	argument `ignored-value'.
	(mime-raw-play-entity): Add new optional argument
	`ignored-method'; add `ignore-examples' to acting-situation.
	(mime-detect-content): Specify `ignore-examples' of
	acting-situation as `ignore-examples' of `mime-raw-play-entity';
	specify `mime-detect-content' as `ignored-method' of
	`mime-raw-play-entity'.

1998-07-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-extract-current-entity): Change
	interface to add `ignore-examples'.
	(mime-preview-print-current-entity): Likewise.

	* mime-play.el (mime-acting-situation-example-list-max-size): New
	variable.
	(mime-reduce-acting-situation-examples): New function.
	(mime-preview-play-current-entity): Change interface to add
	`ignore-examples'.
	(mime-raw-play-entity): Add new optional argument
	`ignore-examples'.  Reduce `mime-acting-situation-example-list'
	when loading example file.


1998-07-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* REMI: Version 1.8.2 (Nōmachi) released.

1998-07-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-acting-situation-example-list): New variable;
	abolish `mime-acting-situation-examples'.
	(mime-save-acting-situation-examples): Modify for
	`mime-acting-situation-example-list'.
	(mime-compare-situation-with-example): New function.
	(mime-raw-play-entity): Change algorithm to compare with
	acting-situation-examples.
	(mime-store-message/partial-piece): Use `mime-view-buffer' instead
	of `mime-view-mode'.

1998-07-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-preview-play-current-entity): Fix problem
	when `mode' is omitted with non-interactive mode (maybe for button
	dispatcher).


1998-07-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* REMI: Version 1.8.1 (Fushiki) released.

1998-07-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-ui-en.texi, mime-ui-en.sgml: New files.

	* mime-ui-ja.sgml: Modify node names about MIME-Edit.
	(file-type specification): Fix typo.

1998-07-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-file-content-type-alist): Add "Standard
	MIDI".

	* mime-play.el (mime-detect-content): Fixed.

1998-07-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Check filename is
	null string.

1998-07-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-ui-ja.sgml, mime-ui-ja.texi: New files; delete
	mime-view-ja.sgml and mime-view-ja.texi.


1998-07-01  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.2 (Kosugi) released.

	* README.en (Required environment): Modify for FLIM 1.8.0.

	* mime-view.el (mime-display-entity): Modify for
	`mime-insert-decoded-header'.

1998-06-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Use
	`mime-write-entity-content'.


1998-06-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.1 (Kureha) released.

1998-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-save-content): Use
	`mime-write-entity-content'.

1998-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el:
	  - Abolish local variable `mime-raw-representation-type'.
	  - Abolish function `mime-entity-representation-type'.

	* mime-pgp.el (mime-view-application/pgp): Use
	`mime-entity-cooked-p'.

	* mime-play.el (mime-view-message/rfc822): Use
	`mime-entity-cooked-p'.

1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Abolish function `mime-raw-write-region'.

	* mime-play.el (mime-store-message/partial-piece): Use
	`mime-write-entity-body'.

	* mime-pgp.el (mime-verify-application/pgp-signature): Use
	`mime-write-entity'.

1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-view-application/pgp): Specify
	representation-type by argument of `mime-view-buffer'.

1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-view-message/rfc822): New implementation.

	* mime-view.el (mime-display-message): Try use window of mother
	buffer to display mime-preview-buffer.

1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Abolish `mime-entity-cooked-p'; use
	`mime-entity-cooked-p' of FLIM.
	(mime-view-buffer): New optional argument `representation-type';
	use `mime-open-entity'.
	(mime-view-mode): New implementation.


1998-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* REMI: Version 1.8.0 (Ecchū-Kokubu) released.

1998-06-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Required environment): Modify for FLIM 1.7.0.

	* mime-view.el (mime-view-mode): New implementation.

1998-06-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-display-text/plain): Must rename
	`mime-browse-add-url-button' to `mime-add-url-buttons'.

1998-06-25  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* semi-def.el: Don't require 'browse-url.
	Abolish `mime-browse-add-url-buttons-maybe' and `mime-browse-url'.
	(mime-browse-url-function): New variable.
	(mime-add-url-buttons): Renamed from `mime-browse-add-url-button'.
	Use `mime-browse-url-function'.

1998-06-24  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* mime-view.el: (mime-preview-condition): Renamed method for
	"anon-ftp" access-type to `mime-view-message/external-anon-ftp'
	and added new method `mime-view-message/external-url' for "url"
	access-type.

1998-06-24  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* mime-play.el (mime-preview-play-current-entity): Use
	optional arg of `interactive'.
	(mime-view-message/external-anon-ftp): Renamed from
	`mime-view-message/external-ftp'.
	(mime-raw-browse-url-function): New variable.
	(mime-view-message/external-url): New function.

1998-06-24  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* semi-def.el (mime-browse-url-regexp): Renamed from
	`mime-text-url-regexp'.
	(mime-browse-url): Renamed from `mime-text-browse-url'.
	(mime-browse-add-url-buttons): Renamed from
	`mime-text-add-url-buttons'.
	(mime-browse-add-url-buttons-maybe): Renamed from
	`mime-text-add-url-buttons-maybe'.

	* mime-text.el: Moved URL stuff to semi-def.el.


1998-06-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.8.0 (Toyama) released.

	* SEMI-CFG: Modify for FLIM 1.6.0.

	* README.en (Required environment): Modify for FLIM 1.6.0.

1998-06-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el:
	  - Abolish function `mime-raw-find-entity-from-node-id',
	    `mime-raw-find-entity-from-number'.
	  - Move function `mime-entity-parent' to mime.el of FLIM.
	  - Abolish variable `mime-view-uuencode-encoding-name-list'.
	  - Move function `mime-entity-uu-filename' and
	    `mime-entity-filename' to mime.el of FLIM.
	(mime-preview-follow-current-entity): Use function
	`mime-find-entity-from-node-id' instead of
	`mime-raw-find-entity-from-node-id'.
	(mime-preview-move-to-upper): Don't use
	`mime-raw-find-entity-from-node-id'.

	* mime-pgp.el (mime-verify-application/pgp-signature): Don't use
	`mime-raw-find-entity-from-node-id'.
	(mime-decrypt-application/pgp-encrypted): Likewise.

	* mime-view.el, mime-play.el (mime-entity-safe-filename): Use
	`mime-read-field' instead of `mime-entity-read-field'.

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Use
	`mime-read-field' instead of `mime-entity-read-field'.

	* mime-bbdb.el (mime-bbdb/update-record): Use `mime-fetch-field'
	and `mime-read-field' instead of `mime-entity-fetch-field' and
	`mime-entity-read-field'.

1998-06-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-display-message): Use window of
	preview-buffer or preview-buffer to display preview-buffer.
	(mime-view-buffer): fixed.
	(mime-view-mode): fixed.

	* MIME-View-API-ja.ol: Delete MIME-View-API-ja.ol.

1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Changes in SEMI 1.8): New chapter.

1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Abolish external x-face viewer.

1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-def.el: Abolish function `tm:set-fields', `tm:add-fields'
	and `tm:delete-fields'.

	* mime-partial.el: Abolish variable
	`mime-view-partial-message-method-alist' and function
	`mime-view-partial-message'.
	(mime-combine-message/partial-pieces-automatically): Use
	`request-partial-message-method' in acting-situation.

1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-display-message): Delete unnecessary
	`mime-parse-buffer'.


1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.7.1 (Higashi-Toyama) released.

	* README.en (Required environment): Delete description about
	`enable-multibyte-characters'; modify for FLIM 1.5.0.

1998-06-22  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* mime-edit.el (mime-content-types): Add "url" access-type and
	"subject" parameter of "mail-server" access-type to
	message/external-body media-type.
	(mime-edit-define-menu-for-xemacs): Doc-string fix.

1998-06-22  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* SEMI-CFG: Support run-in-place installation of BBDB and
	Emacs/W3.

1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Don't require `std11'.

	* mime-view.el: Require `mime' instead of `mime-lib'.
	(mime-entity-filename): Don't use `std11-strip-quoted-string'.

	* mime-edit.el: Don't require `eword-encode'.

1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el
	(mime-combine-message/partial-pieces-automatically): Fixed.

	* mime-pgp.el (mime-view-application/pgp): Use function
	`mime-entity-representation-type'.

	* mime-play.el (mime-view-message/rfc822): Use function
	`mime-entity-representation-type'.
	(mime-store-message/partial-piece): `mime-entity-body-start' and
	`mime-entity-body-end'.

	* mime-text.el (mime-text-insert-decoded-body): Use function
	`mime-entity-cooked-p'.

	* mime-view.el (mime-entity-representation-type): New function.
	(mime-entity-cooked-p): New function.
	(mime-display-entity): Use function `mime-entity-cooked-p'.

1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-text-insert-decoded-body): Use
	`mime-entity-content'.

	* mime-image.el (mime-display-image): Use `mime-entity-content'.

1998-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-entity-safe-filename): New implementation.

1998-06-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-text-insert-decoded-body): Delete unnecessary
	`save-restriction'.

1998-06-20  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* semi-def.el: Require 'custom.

1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Don't require `mime-parse'.

1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: - Modify for FLIM 1.5.0.
		    - Don't signal error if tm is found in load-path.

1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-save-content): Use `mime-entity-body-start'
	and `mime-entity-body-end'.

1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-view-application/pgp): fixed.
	(mime-verify-application/pgp-signature): Use
	`mime-message-structure' instead of `mime-raw-message-info'.
	(mime-decrypt-application/pgp-encrypted): Use
	`mime-message-structure' instead of `mime-raw-message-info'.

	* mime-view.el (mime-display-message): Use `mime-parse-buffer';
	abolish variable `mime-raw-message-info'; use
	`mime-message-structure' instead of `mime-raw-message-info'.

1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-bbdb.el (mime-bbdb/update-record): Use
	`mime-entity-fetch-field' and `mime-entity-read-field'.

1998-06-19  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* SEMI-CFG: Require 'cl first.


1998-06-18  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.7.0 (Mizuhashi) released.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el, mime-view.el, semi-def.el: Rename
	`mime-module-version' to `mime-user-interface-version'.

	* mime-parse.el, SEMI-ELS: Move mime-parse.el to FLIM layer.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el (call-after-loaded): Moved from semi-def.el.

	* semi-def.el: Move `call-after-loaded' to semi-setup.el.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-insert-entity-button): Change interface.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-entity-filename): Moved from mime-play.el.
	(mime-view-entity-title): Use `mime-entity-filename'.

	* mime-play.el: Move `mime-entity-filename' to mime-view.el.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-entity-filename): New function; abolish
	`mime-raw-get-original-filename'.
	(mime-entity-safe-filename): New function; abolish
	`mime-raw-get-filename'.
	(mime-activate-mailcap-method): Use `mime-entity-safe-filename'.
	(mime-save-content): Use `mime-entity-safe-filename'.
	(mime-detect-content): Use `mime-entity-safe-filename'.

	* mime-view.el (mime-entity-uu-filename): New function; abolish
	`mime-raw-get-uu-filename'.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-entity-title): Renamed from
	`mime-raw-get-subject'; use `mime-entity-read-field'.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS (Changes in SEMI 1.7): New chapter.
	(Changes in SEMI 1.6): Add description of entity-detection.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Rename `mime-view-following-method-alist' to
	`mime-preview-following-method-alist'.

1998-06-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el, mime-pgp.el: Rename
	`mime-method-to-add-application/pgp-keys' to
	`mime-add-application/pgp-keys'.

	* semi-setup.el, mime-pgp.el: Rename
	`mime-method-to-decrypt-application/pgp-encrypted' to
	`mime-decrypt-application/pgp-encrypted'.

	* semi-setup.el, mime-pgp.el: Rename
	`mime-method-to-verify-application/pgp-signature' to
	`mime-verify-application/pgp-signature'.

	* semi-setup.el, mime-pgp.el: Rename
	`mime-method-to-verify-multipart/signed' to
	`mime-verify-multipart/signed'.

	* semi-setup.el, mime-pgp.el: Rename
	`mime-method-for-application/pgp' to `mime-view-application/pgp'.

	* SEMI-naming.ol: New file.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el: Rename
	`mime-method-to-combine-message/partial-pieces' to
	`mime-combine-message/partial-pieces-automatically'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el: Rename
	`mime-method-to-display-caesar' to `mime-view-caesar'.

	* mime-play.el, mime-view.el: Rename
	`mime-method-to-display-message/external-ftp' to
	`mime-view-message/external-ftp'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-partial.el, mime-play.el: Rename
	`mime-method-to-store-message/partial' to
	`mime-store-message/partial-piece'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el: Rename
	`mime-method-to-display-message/rfc822' to
	`mime-view-message/rfc822'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el: Rename `mime-method-to-detect' to
	`mime-detect-content'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-display-entity): Abolish body-filter support.

	* mime-play.el, mime-view.el: Rename `mime-method-to-save' to
	`mime-save-content'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Fixed.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el (mime-display-image): New function; abolish
	function `mime-preview-filter-for-image'.

	* mime-image.el: Rename `mime-view-content-header-filter-hook' to
	`mime-display-header-hook'.

	* mime-view.el (mime-display-entity): Run
	`mime-display-header-hook'.

	* mime-text.el, mime-view.el: Rename `mime-preview-text/enriched'
	to `mime-display-text/enriched'.

	* mime-text.el, mime-view.el: Rename `mime-preview-text/richtext'
	to `mime-display-text/richtext'.

	* mime-text.el, mime-view.el: Rename `mime-preview-text/plain' to
	`mime-display-text/plain'.

	* mime-view.el (mime-display-multipart/mixed): Renamed from
	`mime-preview-multipart/mixed'.

	* mime-view.el (mime-display-multipart/alternative): Renamed from
	`mime-preview-multipart/alternative'.

	* mime-view.el (mime-display-message/partial-button): Renamed from
	`mime-preview-message/partial-button'.

	* mime-view.el (mime-display-entity): Renamed from
	`mime-view-display-entity'; change interface.
	(mime-display-message): Renamed from `mime-view-display-message'.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Required environment): Modify for FLIM 1.4.0.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Move function `mime-entity-number' to FLIM layer.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-header-presentation-method-alist): New
	variable; abolish variable
	`mime-view-content-header-filter-alist'; abolish function
	`mime-view-cut-header'; abolish variable
	`mime-view-ignored-field-regexp'.
	(mime-view-display-entity): Use
	`mime-header-presentation-method-alist'.

	* mime-parse.el: Move definition of structure `mime-entity' to
	FLIM layer.

1998-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Change order of `mime-entity'.


1998-06-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.6.0 (Namerikawa) released.

1998-06-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view-ja.texi, mime-view-ja.sgml: New files.

	* mime-view.el (mime-view-mode): Fix DOC-string.

1998-06-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-file-content-type-alist): Renamed from
	`mime-file-type-regexp-type-subtype-alist'.

1998-06-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Add description about
	`mime-preview-over-to-{previous|next}-method-alist'.

	* mime-view.el (mime-preview-over-to-previous-method-alist):
	Add DOC-string.
	(mime-preview-over-to-next-method-alist): Add DOC-string.

	* mime-view.el (mime-preview-over-to-previous-method-alist):
	Renamed from `mime-view-over-to-previous-method-alist'.
	(mime-preview-over-to-next-method-alist): Renamed from
	`mime-view-over-to-next-method-alist'.

1998-06-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-w3.el (mime-save-background-color): Fixed.

	* mime-view.el (mime-acting-condition): Set up
	`mime-method-to-detect' for application/octet-stream in "play"
	mode.

	* mime-play.el (mime-file-type-regexp-type-subtype-alist): New
	variable.
	(mime-method-to-detect): New function.

1998-06-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-sort-situation): Modify for
	Content-Disposition information.

1998-06-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Abolish variable `mime-view-show-summary-method'
	and function `mime-preview-show-summary'.

1998-06-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-entity-situation): Add information of
	Content-Disposition.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol (mime-preview-buffer): Add description about
	`mime-preview-original-major-mode'.

	* mime-view.el (mime-preview-original-major-mode): Modify
	DOC-string.

	* NEWS: Add description about abolishment of tm-compatible
	external method support.

	* mime-play.el (mime-raw-play-entity): Abolish tm-compatible
	external method support; abolish function
	`mime-activate-external-method' and
	`mime-make-external-method-args'.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Use
	`mime-entity-body-start'.

	* mime-play.el (mime-activate-external-method): Change interface.

	* mime-play.el (mime-activate-mailcap-method): Change interface.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol (mime-preview-buffer): Delete description
	about text-property `mime-view-raw-buffer'.

	* mime-play.el (mime-preview-play-current-entity): Don't refer
	text-property `mime-view-raw-buffer'.

	* mime-view.el (mime-view-display-entity): Don't set up
	text-property `mime-view-raw-buffer'.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol: Abolish description about
	`mime-preview-original-major-mode'.

	* NEWS (Changes in SEMI 1.6): New chapter.

	* TODO (multipart/related support): New item.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Add description about mime-w3.el.

1998-06-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-w3.el (mime-save-background-color): New macro.
	(mime-preview-text/html): Use `mime-save-background-color'.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Abolish variable `mime-edit-signing-type' and
	`mime-edit-encrypting-type'.
	(mime-edit-process-multipart-1): Separate "signed" to "pgp-signed"
	and "kazu-signed"; separate "encrypted" to "pgp-encrypted" and
	"kazu-encrypted".
	(mime-edit-enclose-signed-region): Renamed from
	`mime-edit-enclose-pgp-signed-region'.
	(mime-edit-enclose-pgp-encrypted-region): Renamed from
	`mime-edit-enclose-encrypted-region'.
	(mime-edit-enclose-kazu-signed-region): New function.
	(mime-edit-enclose-kazu-encrypted-region): New function.
	(mime-edit-set-sign): Don't refer `mime-edit-signing-type'.
	(mime-edit-set-encrypt): Don't refer `mime-edit-encrypting-type'.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-sign-pgp-kazu): Abolish unused local
	variable.
	(mime-edit-encrypt-pgp-kazu): Abolish unused local variables.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-for-application/pgp): Change interface.
	(mime-method-to-verify-multipart/signed): Change interface.
	(mime-method-to-verify-application/pgp-signature): Change
	interface.
	(mime-method-to-decrypt-application/pgp-encrypted): Change
	interface.
	(mime-method-to-add-application/pgp-keys): Change interface.

	* mime-partial.el (mime-method-to-combine-message/partial-pieces):
	Change interface.

	* mime-play.el (mime-raw-play-entity): Change interface of
	internal-method.
	(mime-method-to-save): Change interface.
	(mime-method-to-display-message/rfc822): Change interface.
	(mime-method-to-store-message/partial): Change interface.
	(mime-method-to-display-message/external-ftp): Change interface.
	(mime-method-to-display-caesar): Change interface.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-normalize-body): Use
	`mime-charset-type-list' directly; abolish local variable
	`mime-edit-charset-default-encoding-alist' and function
	`mime-make-charset-default-encoding-alist'.
	(mime-edit-toggle-transfer-level): Don't set up
	`mime-edit-charset-default-encoding-alist'.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-message): Set up
	`mime-raw-message-info'.
	(mime-view-buffer): New function.
	(mime-view-mode): Don't set up `mime-raw-message-info'.

1998-06-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-charset-type-list): Use base64 for cn-gb2312
	and gb2312.
	(mime-edit-normalize-body): If encoding is not specified for
	charset, use quoted-printable or 8bit for mime-transfer-level is 7
	or 8.

	* mime-edit.el (mime-charset-type-list): Add `shift_jis'.

1998-06-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-message): Use
	`mime-maybe-hide-echo-buffer'.
	(mime-view-mode): Don't use `mime-maybe-hide-echo-buffer'.

	* mime-view.el (mime-view-display-message): Move point to top of
	body; run `mime-view-mode-hook'.
	(mime-view-mode): Don't move point; don't run
	`mime-view-mode-hook'.

	* mime-view.el (mime-view-display-message): Add new optional
	argument `default-keymap-or-function'.
	(mime-view-mode): Modify for `mime-view-display-message'.

	* mime-view.el (mime-view-display-message): Add new optional
	argument `mother'; set to `mime-mother-buffer'.
	(mime-view-mode): Modify for `mime-view-display-message'.

1998-06-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-mc.el: Use `eval-and-compile' to load "mc-pgp".

	* mime-view.el (mime-preview-multipart/mixed): Modify for
	`mime-view-display-entity'; don't refer `mime-raw-buffer'.
	(mime-preview-multipart/alternative): Modify for
	`mime-view-display-entity'; don't refer `mime-raw-buffer'.
	(mime-view-display-entity): Change interface to abolish argument
	for raw-buffer; don't refer `mime-raw-buffer'.
	(mime-view-display-message): Abolish variable
	`mime-preview-original-major-mode'; modify for
	`mime-view-display-entity'.
	(mime-preview-original-major-mode): New implementation; add
	optional argument `recursive'.
	(mime-preview-follow-current-entity): Modify for
	`mime-preview-original-major-mode'.
	(mime-preview-move-to-next): Use function
	`mime-preview-original-major-mode'.
	(mime-preview-scroll-up-entity): Use function
	`mime-preview-original-major-mode'.
	(mime-preview-scroll-down-entity): Use function
	`mime-preview-original-major-mode'.
	(mime-preview-quit): Use function
	`mime-preview-original-major-mode'.
	(mime-preview-show-summary): Use function
	`mime-preview-original-major-mode'.

	* mime-view.el (mime-view-display-message): New function; abolish
	function `mime-view-setup-buffers'.
	(mime-view-mode): Use `mime-view-display-message'.

1998-06-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Use
	`mime-entity-situation'.

	* mime-view.el (mime-entity-situation): New function.
	(mime-preview-multipart/alternative): Use `mime-entity-situation'.
	(mime-view-display-entity): Use `mime-entity-situation'.

1998-06-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-enclose-region-internal): Abolish unused
	local variable.

1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol (entity): Add description of
 	`mime-entity-number'.

	* mime-play.el (mime-method-to-display-caesar): Use
 	`mime-entity-number'.

	* mime-parse.el (mime-entity-number): New function.

1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol (entity-button): Modify description of
	`mime-view-insert-entity-button'.

	* mime-view.el (mime-view-insert-entity-button): Change interface.
	(mime-view-display-entity): Modify for
	`mime-view-insert-entity-button'.

1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol (entity-button): Modify description of
	`mime-view-entity-button-visible-p'.

	* mime-view.el (mime-view-entity-button-visible-p): Change
	interface.
	(mime-view-display-entity): Modify for
	`mime-view-entity-button-visible-p'.

1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MIME-View-API-ja.ol: Add description of `mime-entity-parent' and
	abolish description `mime-raw-entity-parent'.

	* mime-view.el (mime-entity-parent): New function; abolish
	`mime-raw-entity-parent'.
	(mime-view-entity-button-visible-p): Use `mime-entity-parent'
	instead of `mime-raw-entity-parent'.


1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.5.4 (Higashi-Namerikawa) released.

	* mime-edit.el (mime-edit-normalize-body): Abolish unused local
	variable.

1998-06-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-translate-single-part-tag): Add new
	argument `boundary'.
	(mime-edit-translate-region): Modify for
	`mime-edit-translate-single-part-tag'.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-w3.el (mime-put-keymap-region): New macro.
	(mime-preview-text/html): Use macro `mime-put-keymap-region'.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Add 'mime-w3 if w3 is found.

	* semi-setup.el (mime-setup-enable-inline-html): New variable; add
	setting for mime-w3.el conditionally.

	* mime-w3.el: New module.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-multipart/alternative): Fix typo.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-x-emacs-value): Check
 	`enable-multibyte-characters' is bound or not.


1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.5.3 (Uozu) released.

	* NEWS (`pgp-elkins' -> `pgp-mime'): New section.

	* mime-edit.el: Rename `pgp-elkins' -> `pgp-mime'.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-sign-pgp-elkins): Abolish unused local
	variable.
	(mime-edit-encrypt-pgp-elkins): Abolish unused local variable.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-parse-multipart): fixed.


1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.5.2 (Kurobe) released.

	* mime-play.el (mime-delq-null-situation): New function.
  	(mime-raw-play-entity): Use `mime-delq-null-situation'.

1998-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* TODO (Better implementation for multipart/alternative): done.

	* NEWS (type-subtype-score): New section.

1998-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-raw-message-info): Modify DOC-string.

	* MIME-View-API-ja.ol: Modify for SEMI 1.5.

1998-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-touched-flag): Define by `defvar'.
	(mime-edit-mode): Don't check `mime-edit-touched-flag' is bound or
	not.

	* mime-edit.el (mime-edit-find-inmost): Abolish unused local
	variables.

1998-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-text-insert-decoded-body): Don't refer
	`mime-raw-buffer'.

	* mime-parse.el: Change format of `mime-entity' to add `buffer'.

1998-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: When it is compiled, require 'bbdb or define
	`bbdb-buffer-name' to avoid compiler warning.

	(mime-method-to-display-caesar): Abolish unused local variable.

	Use `eval-buffer' to eval contents of
	`mime-acting-situation-examples-file'.

1998-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el: Move definition of variable
	`mime-raw-representation-type' to mime-view.el.

	* mime-view.el: Move definition of variable
	`mime-raw-representation-type' from mime-text.el.
	(mime-raw-message-info): Modify DOC-string.

	* MIME-View-API-ja.ol: New file.


1998-06-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.5.1 (Ikuji) released.

	* mime-view.el (mime-raw-message-info): Fix typo.
	(mime-view-type-subtype-score-alist): New variable.
	(mime-preview-multipart/alternative): New function; set up for
	`mime-preview-condition'.
	(mime-view-display-entity): Add optional argument `situation'.

1998-06-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): Call
	body-presentation-method to display multipart if it is function.

	* NEWS: Add news about SEMI 1.5.

1998-06-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-multipart/mixed): New function.
	(mime-view-display-entity): Use `mime-preview-multipart/mixed'.

1998-06-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): Display entity-button
	in body if button is invisible and body-presentation-method is not
	found.


1998-06-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.5.0 (Nishi-Nyūzen) released.

	* README.en (Required environment): Modify for FLIM 1.3.0.

1998-06-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-write-region): New implementation; refer
	`mime-raw-representation-type' or
	`mime-raw-representation-type-alist' instead of
	`mime-raw-buffer-coding-system-alist'.

	* mime-view.el: Abolish variable
	`mime-raw-buffer-coding-system-alist'.

1998-06-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-for-application/pgp): Use
	`mime-raw-representation-type-alist' instead of
	`mime-text-decoder-alist'; set up to
	`mime-raw-representation-type' instead of `mime-text-decoder'.

	* mime-play.el (mime-method-to-display-message/rfc822): Use
	`mime-raw-representation-type-alist' instead of
	`mime-text-decoder-alist'; set up to
	`mime-raw-representation-type' instead of `mime-text-decoder'.
	(mime-method-to-display-caesar): Use
	`mime-text-insert-decoded-body'.

	* mime-text.el (mime-raw-representation-type): New variable;
	abolish `mime-text-decoder'.
	(mime-text-insert-decoded-body): Change interface; refer
	`mime-raw-representation-type' or
	`mime-raw-representation-type-alist' instead of
	`mime-text-decoder' or `mime-text-decoder-alist'; abolish function
	`mime-text-decode-buffer' and `mime-text-decode-buffer-maybe'.
	(mime-preview-text/plain): Modify for new interface of
	`mime-text-insert-decoded-body'.
	(mime-preview-text/richtext): Modify for new interface of
	`mime-text-insert-decoded-body'.
	(mime-preview-text/enriched): Modify for new interface of
	`mime-text-insert-decoded-body'.

	* mime-view.el (mime-raw-representation-type-alist): New variable;
	abolish `mime-text-decoder-alist'.

1998-05-31  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-parse-multipart): fixed.


1998-06-01  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.6 (Nyūzen) released.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-text-insert-decoded-body): New function;
	abolish 'mime-text-decode-body.
	(mime-preview-text/plain): Use 'mime-text-insert-decoded-body.
	(mime-preview-text/richtext): Use 'mime-text-insert-decoded-body.
	(mime-preview-text/enriched): Use 'mime-text-insert-decoded-body.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-condition): Set up for
	'mime-preview-text/enriched instead of
	'mime-preview-filter-for-text/enriched.

	* mime-text.el (mime-preview-text/enriched): New function; abolish
	'mime-preview-filter-for-text/enriched.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-condition): Set up for
	'mime-preview-text/richtext instead of
	'mime-preview-filter-for-text/richtext.

	* mime-text.el (mime-preview-text/richtext): New function; abolish
	'mime-preview-filter-for-text/richtext.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Rename 'mime-view-insert-message/partial-button to
	'mime-preview-message/partial-button.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-condition): Set up for
	'mime-preview-text/plain instead of
	'mime-preview-filter-for-text/plain.
	(mime-view-insert-message/partial-button): Change interface for
	new spec of body-presentation-method.
	(mime-view-display-entity): Change interface of
	body-presentation-method.

	* mime-text.el (mime-preview-text/plain): New function; abolish
	'mime-preview-filter-for-text/plain.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (make-mime-entity): Change format.
	(mime-entity-header-start): New function.
	(mime-entity-header-end): New function.
	(mime-entity-body-start): New function.
	(mime-entity-body-end): New function.
	(mime-entity-content-type): Modify for new format.
	(mime-entity-content-disposition): Modify for new format.
	(mime-entity-encoding): Modify for new format.
	(mime-entity-children): Modify for new format.
	(mime-entity-point-min): Change to alias of
	'mime-entity-header-start.
	(mime-entity-point-max): Change to alias of 'mime-entity-body-end.
	(mime-parse-multipart): Modify for 'make-mime-entity.
	(mime-parse-message): Modify for 'make-mime-entity.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-parse-multipart): Change interface; abolish
	local variable 'beg and 'end.
	(mime-parse-message): Modify for 'mime-parse-multipart.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-parse-multipart): Use
	'mime-content-type-parameter.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-parse-Content-Transfer-Encoding): New
	function.
	(mime-read-Content-Transfer-Encoding): Use function
	'mime-parse-Content-Transfer-Encoding.
	(mime-parse-message): Use 'mime-parse-* instead of 'mime-read-*.

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Move 'regexp-* and 'regexp-or to mime-def.el of
	FLIM (Chao); move 'std11-quoted-pair-regexp, 'std11-qtext-regexp
	and 'std11-quoted-string-regexp to mime-def.el of FLIM (Chao).

1998-05-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Rename 'rfc822/quoted-string-regexp ->
	'std11-quoted-string-regexp.

	* mime-parse.el: Rename 'rfc822/qtext-regexp ->
	'std11-qtext-regexp.

	* mime-parse.el: Rename 'rfc822/quoted-pair-regexp ->
	'std11-quoted-pair-regexp.

1998-05-29  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-view.el (mime-preview-scroll-down-entity): Use (not (bobp))
	instead of (> (point) 1).

1998-05-25  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-play.el (mime-preview-play-current-entity): Don't widen.

1998-05-25  Katsumi Yamaoka   <yamaoka@jpl.org>

	* mime-play.el (mime-raw-play-entity): Abolish point correcting
	procedures for VM.

	* mime-play.el (mime-preview-play-current-entity): Do widen befor
	playing the entity.


1998-05-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.5 (Tomari) released.

	* README.en (Mailing lists): Add notice about direct-mail for
	authors.

1998-05-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-dired-function): Don't refer
	'mime/use-multi-frame.

	* semi-def.el: Abolish variable 'mime/use-multi-frame.

	* semi-def.el (mime-insert-button): Merge arguments of two
	'insert.

	* semi-def.el: Abolish function 'get-version-string because it is
	not used.

	* TODO (Don't use filter-model): New item.

	* TODO (Fix problem of dynamic configuration for
	'mime-acting-condition): Done.

	* TODO (Mother entity should modify preview-situation of
	children): Done.

1998-05-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-setup-buffers): Use
	'mime-view-display-entity; abolish 'mime-view-display-message.
	(mime-view-display-entity): fixed.

1998-05-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-message): fixed.

1998-05-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-raw-get-subject): Use
	'mime-content-disposition-filename.

	* mime-parse.el (mime-content-type-parameter): New function.

	* mime-parse.el (mime-content-disposition-parameter): New
	function.
	(mime-content-disposition-filename): New function.

1998-05-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-get-original-filename): Abolish optional
	argument 'encoding; modify for 'mime-raw-get-uu-filename.

	* mime-view.el (mime-raw-get-uu-filename): Change interface; don't
	check encoding.
	(mime-raw-get-subject): Change interface; new implementation.

1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): fixed.

	* mime-parse.el (mime-parse-multipart): Change interface.

1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (make-mime-entity): Add 'content-disposition.
	(mime-entity-content-disposition): New function.
	(mime-parse-multipart): Modify for 'make-mime-entity.
	(mime-parse-message): Modify for 'make-mime-entity.

1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Don't use
	'mime-entity-media-type, 'mime-entity-media-subtype and
	'mime-entity-parameters.

1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): Don't use
	'mime-entity-media-type, 'mime-entity-media-subtype and
	'mime-entity-parameters.

1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-message): Don't use
	'mime-entity-media-type, 'mime-entity-media-subtype and
	'mime-entity-parameters.

1998-05-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-setup.el: Avoid warning message of byte-compiler.


1998-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.4 (Ecchū-Miyazaki) released.

	* mime-play.el (mime-mailcap-method-filename-alist): New variable.
	(mime-mailcap-method-sentinel): New function.
	(mime-activate-mailcap-method): Use 'mime-mailcap-method-sentinel;
	don't use 'mime-show-echo-buffer.

1998-05-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Regard
	'mime-temp-directory.

1998-05-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (make-mime-entity): Change interface and
	data-format.
	(mime-entity-content-type): New access function.
	(mime-entity-media-type): New implementation.
	(mime-entity-subtype): New implementation.
	(mime-entity-parameters): New implementation.
	(mime-parse-multipart): Change interface; modify for
	'make-mime-entity.
	(mime-parse-message): Modify for 'make-mime-entity.


1998-05-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.3 (Ichiburi) released.

1998-05-12  Kazuhiro Ohta     <ohta@ele.cst.nihon-u.ac.jp>

	* mime-partial.el: start and end of the region fixed.

1998-05-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (make-mime-content-type): New function.
	(mime-parse-Content-Type): Use 'make-mime-content-type.
	(mime-parse-multipart): Use 'make-mime-content-type.

1998-05-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Change data format of mime-content-disposition.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Rename 'mime/Content-Transfer-Encoding ->
	'mime-read-Content-Transfer-Encoding.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-raw-get-subject): Use
	'mime-content-disposition-parameters.

	* mime-play.el (mime-raw-get-original-filename): Use
	'mime-content-disposition-parameters.

	* mime-parse.el (mime-content-disposition-type): New function.
	(mime-content-disposition-parameters): New function.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el, mime-play.el, mime-view.el: Rename
	'mime/Content-Disposition -> 'mime-read-Content-Disposition.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* Makefile (PACKAGE): New variable.
	(tar): Use $(PACKAGE).

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Change data format of mime-content-type.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-decode-buffer): Use
 	'mime-content-type-primary-type, 'mime-content-type-subtype and
 	'mime-content-type-parameters.

1998-05-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (mime-content-type-primary-type): New function.
  	(mime-content-type-subtype): New function.
  	(mime-content-type-parameters): New function.
  	(mime-parse-message): Use 'mime-content-type-primary-type,
 	'mime-content-type-subtype and 'mime-content-type-parameters.

1998-05-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Abolish function 'symbol-concat because it is not
 	used.


1998-05-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.2 (Oyashirazu) released.

1998-05-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Authors): New section.

	* README.en (CVS based development): New section.

1998-05-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-move-to-previous): Must regard
	previous entity separated by null property region.
	(mime-preview-move-to-next): Must regard next entity separated by
	null property region.

1998-05-03  Simon Josefsson  <jas@pdc.kth.se>

       * mime-view.el (mime-preview-move-to-previous): check that new
       prop is non-null

       * mime-view.el (mime-preview-move-to-next): skip leading null
       props, check that new prop is non-null

1998-05-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Use 'ctree-set-calist-with-default instead of
	'ctree-set-calist-strictly to set up mailcap entries.


1998-05-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.1 (Ōmi) released.

	* README.en (Required environment): Modify for FLIM 1.2.0.

1998-05-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Move 'mime-type/subtype-string to
	flim/mime-def.el.

1998-05-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-sort-situation): New function.
	(mime-raw-play-entity): Use 'mime-sort-situation.

1998-05-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): Use
	'mailcap-format-command.

1998-05-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (What's SEMI?): Add description about mailcap.
	(Documentation): Add RFC 1524; change location of RFC.


1998-05-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.4.0 (Itoigawa) released.

	* README.en (Required environment): Modify for FLIM 1.1.0.

	* SEMI-CFG: Modify error message for FLIM 1.1.0.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-def.el: Abolish 'mime/find-file-function because it is not
 	used.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* TODO (keymap-prefix): done.
	(mailcap support): done.
	(Change 'mime-acting-condition to condition-tree format): done.
	(Unify entity display specifications to 'mime-preview-condition):
 	done.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Add description for SEMI 1.4.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Abolish setting for tm-sh-scripts.

	* semi-setup.el: Abolish MUA depended signature setting.

	* mail-mime-setup.el: Move setting for 'mail-signature from
 	semi-setup.el.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el: Use 'mime-add-condition to set up for mime-pgp.

	* mime-pgp.el: Abolish setting for 'mime-preview-condition and
 	mime-acting-condition.

	* semi-def.el (mime-condition-type-alist): New variable.
	(mime-condition-mode-alist): New variable.
	(mime-add-condition): New function.

1998-05-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-acting-condition): Use
	'ctree-set-calist-with-default to set up 'mime-method-to-save.

1998-05-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-acting-condition): Delete setting for
	metamail.

1998-05-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-activate-mailcap-method): New function.
	(mime-raw-play-entity): Use 'mime-activate-mailcap-method for
 	mailcap method.

	* mime-view.el (mime-acting-condition): Read mailcap.

1998-05-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el: Move mailcap.el to FLIM.

1998-05-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Sort before registering to
 	'mime-acting-situation-examples.


1998-04-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.3.4 (Kajiyashiki) released.

1998-04-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Modify messages for APEL 8.7.

	* README.en (Required environment): Modify for APEL 8.7.

1998-04-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-find-every-acting-situation): Change
 	default value to 't.

1998-04-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-save-acting-situation-examples): New
 	function; set up for 'kill-emacs-hook.

	* mime-play.el (mime-acting-situation-examples): Renamed from
 	'mime-user-acting-condition.

	* mime-play.el: Load MIME acting-example file.

	* mime-view.el (mime-acting-situation-examples-file): New
 	variable.

1998-04-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Use
 	'ctree-match-calist-partially.


1998-04-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.3.3 (Uramoto) released.

1998-04-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Refer
	'mime-view-find-every-acting-situation.

	* mime-view.el (mime-view): New customize group.
	(mime-view-find-every-acting-situation): New variable.

1998-04-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-user-acting-condition): New variable.
	(mime-raw-play-entity): Refer it.

1998-04-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Get all available
 	acting-situations; display menu of methods to select
 	acting-situation to activate.

	* semi-def.el (select-menu-alist): New function.


1998-04-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.3.2 (Nō) was released.

	* mime-edit.el (mime-edit-mode-entity-prefix): New variable.
	(mime-edit-mode-entity-map): New variable.
	(mime-edit-mode-enclosure-prefix): New variable.
	(mime-edit-mode-enclosure-map): New variable.
	(mime-edit-mode-map): Use 'mime-edit-mode-entity-map and
 	'mime-edit-mode-enclosure-map.

	* mime-view.el (mime-acting-condition): Fix setting.

1998-04-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-raw-play-entity): Use 'ctree-match-calist
 	directly; abolish 'mime/get-content-decoding-alist.


1998-04-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.3.1 (Tsutsuishi) was released.

	* mime-view.el (mime-preview-follow-current-entity): Abolish
	unused local variable 'message-info.

1998-04-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-split-ignored-field-regexp): Add
 	Message-Id field.

1998-04-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mail-mime-setup.el: Must require 'alist.


1998-04-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.3.0 (Nadachi) was released.

1998-04-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-def.el: Don't require 'atype; abolish function
 	'field-unifier-for-mode.

1998-04-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el: Use 'ctree-set-calist-strictly instead of
 	'set-atype to set up for 'mime-acting-condition.

	* mime-play.el (mime/get-content-decoding-alist): Use
 	'ctree-match-calist instead of 'get-unified-alist.

	* mime-view.el (mime-acting-condition): Change format from list of
 	atype to ctree.


1998-04-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.2.4 (Arimagawa) was released.

	* NEWS: Modify for SEMI 1.2.4 (Arimagawa).

	* mime-view.el (mime-view-display-message): Check 'message-button
 	is 'visible.
	(mime-view-display-entity): Check 'header is 'visible.

1998-04-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Abolish variable
 	'mime-view-childrens-header-showing-Content-Type-list and function
 	'mime-view-header-visible-p.
	(mime-preview-follow-current-entity): Don't use
 	'mime-view-header-visible-p.

1998-04-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-condition): Don't display body of
 	message/rfc822 and message/news; add '(entity-button . invisible)
 	to default situation of child entity.
	(mime-view-display-entity): Don't display entity-button if
 	'entity-button field value of preview-condition is 'invisible.


1998-04-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.2.3 (Tanihama) was released.

	* mime-view.el: Abolish function 'mime-view-body-visible-p and
 	'mime-view-entity-separator-visible-p.
	(mime-view-display-entity): Don't use
 	'mime-view-entity-separator-visible-p.

1998-04-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview-condition): Specify
 	'childrens-situation field for message/rfc822 and message/news.
	(mime-view-display-message): Use value of 'childrens-situation
 	field of preview-situation as default-situation of children.
	(mime-view-display-entity): Add new argument 'default-situation;
 	use it as elements of draft of preview-situation; use value of
 	'header field of preview-situation instead of
 	'mime-view-header-visible-p; use value of 'childrens-situation
 	field of preview-situation as default-situation of children.


1998-04-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.2.2 (Naoetsu) was released.

	* README.en: Modify for FLIM.

1998-04-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Modify messages for FLIM and APEL 8.2.

1998-04-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Add "flim" instead of "rime" to 'load-path.

1998-04-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-calist::field-match-method-as-default-rule):
 	New function; setup for calist-field-match-method for 'header and
 	'body.

1998-04-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-preview-condition): Add (message-button
 	. visible) to application/pgp again.

1998-04-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-message): Abolish unused local
 	variable 'ctype.
	(mime-view-display-entity): Abolish unused local variable 'ctype.

	* mime-view.el (mime-view-display-message): Don't use
 	'mime-view-content-button-visible-ctype-list; abolish it.

1998-04-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-entity-button-visible-p): Omit to check
	entity is not message.
	(mime-view-header-visible-p): Omit to check entity is message.
	(mime-view-setup-buffers): Call 'mime-view-display-message instead
	of 'mime-view-display-entity.
	(mime-view-display-message): New function.
	(mime-view-display-entity): Abolish local variable
	'entity-node-id; don't check entity is message or not.

1998-04-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Add "rime" instead of "mel" to 'load-path.

1998-04-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Delete 'mime-def,
	'eword-encode and 'eword-decode.

	* mime-def.el, eword-encode.el, eword-decode.el: Abolish
	mime-def.el, eword-decode.el and eword-encode.el; (moved to RIME).

1998-04-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el (regexp-or): Moved from semi-def.el.

	* semi-def.el: Move 'regexp-or to mime-parse.el.
	Move 'eliminate-top-spaces to mime-def.el.

	* mime-def.el (eliminate-top-spaces): Moved from semi-def.el.

1998-04-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Add 'semi-def.

	* semi-setup.el: Require 'semi-def instead of 'mime-def.

	* mime-view.el: Require 'semi-def.

	* mime-def.el: Move SEMI depended definitions to semi-def.el.

	* semi-def.el: Move SEMI depended definitions from mime-def.el.

	* eword-decode.el (eword-decode-version): Don't use
	`mime-module-version'.


1998-04-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.2.1 (Nomachi) was released.

1998-04-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-setup-buffers): Don't use
	'mime-raw-flatten-message-info.
	(mime-view-display-entity): Display recursively.

1998-04-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* TODO: New file.

1998-04-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-version): Use
	`mime-module-version' instead of `semi-version'.

	* mime-edit.el (mime-edit-version-string): Use
	`mime-module-version' instead of `semi-version'.

	* mime-view.el (mime-view-version-string): Use
	`mime-module-version' instead of `semi-version'.

	* mime-def.el (mime-module-version): New variable; abolish
	`semi-version'.


1998-03-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.2.0 (Nishiizumi) was released.

	* NEWS: Update for SEMI 1.2.

1998-03-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el: Rename 'mime-view-plain-text-preview-hook ->
	'mime-preview-text/plain-hook.

	* mime-text.el (mime-text-add-url-buttons): New function.
	(mime-text-add-url-buttons-maybe): New function.

1998-03-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-text.el, mime-image.el: Rename
 	'mime-view-filter-for-* -> 'mime-preview-filter-for-*.

1998-03-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el: Rename 'mime-decode-text-body ->
 	'mime-text-decode-body.

1998-03-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-decode-text-body): Change interface; call
 	'mime-text-decode-hook.

1998-03-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* VERSION: New file.


1998-03-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.1.2 (Shin-Nishikanazawa) was released.

1998-03-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Modify about 'image-format.

	* mime-image.el (mime-view-filter-for-image): Refer 'image-format
	of preview-situation instead of 'mime-view-image-converter-alist;
	abolish variable 'mime-view-image-converter-alist.

1998-03-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Modify about 'body-filter.

1998-03-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el: Abolish 'mime-view-ps-to-gif-command.

	* mime-image.el (mime-view-filter-for-image): Change interface.
	Abolish `mime-view-filter-for-application/postscript'.

	* mime-text.el (mime-view-filter-for-text/plain): Change
	interface.
	(mime-view-filter-for-text/richtext): Change interface.
	(mime-view-filter-for-text/enriched): Change interface.

	* mime-view.el (mime-view-display-entity): Change interface of
	body-filter.

1998-03-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el (mime-preview-condition): Set 'with-filter in
	body-presentation-method for body-filter.

	* mime-view.el (mime-view-display-entity): Call body-filter only
	when body-presentation-method is 'with-filter.

1998-03-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): Modify to omit check
	for body-presentation-method.

1998-03-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Modify about `mime-preview-condition'.

1998-03-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el: Set up for `mime-preview-condition' instead of
	`mime-view-body-visible-condition' and
	`mime-view-content-filter-alist'.

	* mime-view.el (mime-preview-condition): New variable.
	(mime-view-body-visible-p): Use `mime-preview-condition' instead
	of `mime-view-body-visible-condition'; abolish variable
	`mime-view-body-visible-condition'.
	(mime-view-insert-message/partial-button): Add argument
	`situation'.
	(mime-view-display-entity): Use `mime-preview-condition' instead
	of `mime-view-content-filter-alist'; don't hard-coding for
	`message/partial-button'; abolish variable
	`mime-view-content-filter-alist'.

1998-03-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Require 'mime-text when compiling.

1998-03-21  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* eword-decode.el (eword-lexical-analyze-internal): Fixed return
	value.

	* mime-view.el (mime-view-body-visible-condition): text media-
	type is always visible.


1998-03-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.1.1 (Oshino) was released.

	* mime-play.el (mime-method-to-save): Must treat nil encoding as
	7bit.

1998-03-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: Update for latest version.

1998-03-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Must set up load-path before version check codes.

1998-03-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Don't require mime-text.el; add autoload setting
	for mime-text.el.
	(mime-text-decoder-alist): moved from mime-text.el.
	(mime-view-entity-separator-visible-p): New function.
	Abolish `mime-view-display-header', `mime-view-display-body' and
	`mime-view-entity-separator-function'.

	* mime-text.el: Require mime-view (mime-text.el is autoloaded by
	mime-view); variable `mime-text-decoder-alist' was moved to
	mime-view.el.

	* mime-play.el (mime-method-to-save): fixed.

1998-03-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* NEWS: New file.


1998-03-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.1.0 (Nonoichi) was released.

1998-03-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Abolish unused local-variable `raw-buf'.

	* mime-play.el (mime-raw-play-entity): fixed.

	* mime-view.el (mime-preview-original-window-configuration): Use
	`defvar' to avoid warning of byte-compiler.

	* mime-view.el (mime-view-display-entity): Don't use
	`mime-view-entity-button-function' (abolish it); use
	`mime-root-entity-p'.

1998-03-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-entity-button-visible-p): New function.
	(mime-view-entity-button-function): Use function
 	`mime-view-entity-button-visible-p'.

	* mime-view.el (mime-raw-entity-parent): New function.
	(mime-view-entity-button-function): Use `mime-raw-entity-parent'.

	* mime-view.el (mime-view-entity-button-function): Use
 	`mime-root-entity-p'.

	* mime-parse.el (mime-root-entity-p): New function.

1998-03-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Insert version check code.

1998-03-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el: Set up `mime-view-body-visible-condition' instead
 	of `mime-view-visible-media-type-list'.

	* mime-view.el (mime-view-body-visible-condition): New variable.
	(mime-view-body-visible-p): Use `mime-view-body-visible-condition'
 	instead of `mime-view-visible-media-type-list'.
	Abolish `mime-view-visible-media-type-list'.

	* mime-parse.el (mime-type/subtype-string): New function.
	(mime-entity-type/subtype): Use `mime-type/subtype-string'.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Use `mime-raw-write-region'.

	* mime-view.el (mime-raw-buffer-coding-system-alist): Move setting
	for mh-show-mode.

	* mime-play.el, mime-view.el: Rename
	`mime-raw-coding-system-alist' ->
	`mime-raw-buffer-coding-system-alist'.

	* mime-view.el, mime-play.el: Move `mime-raw-coding-system-alist'
	from mime-play.el to mime-view.el.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-raw-point-to-entity-node-id): Use
	`mime-raw-find-entity-from-point'.
	(mime-raw-point-to-entity-number): Likewise.

	* mime-view.el (mime-raw-find-entity-from-point): New function.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-body): Change interface.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el: Rename `mime-view-entity-info' ->
	`mime-view-entity'.

	* mime-view.el: Rename `mime-raw-entity-number-to-entity-info' ->
	`mime-raw-find-entity-from-number'.

	* mime-pgp.el, mime-view.el: Rename
	`mime-raw-entity-node-id-to-entity-info' ->
	`mime-raw-find-entity-from-node-id'.

	* mime-pgp.el, mime-partial.el, mime-play.el, mime-view.el,
 	mime-parse.el: Rename `mime-entity-info' -> `mime-entity'.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-header-visible-p): Change interface.
	(mime-view-body-visible-p): Change interface.

	* mime-view.el (mime-view-insert-entity-button): Change interface.
	(mime-view-entity-button-function): Change interface.

	* mime-view.el (mime-view-body-visible-p): Add DOC-string.

	* mime-view.el: `rcnum' -> `entity-node-id'.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Don't use temporary buffer for signed entity.

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Don't use temporary buffer for PGP-signature.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Use `write-region-as-binary'.

	* mime-pgp.el (mime-method-to-verify-application/pgp-signature):
	Use `mime-write-decoded-region'.

	* mime-pgp.el: Rename `rmcnum' -> `mother-node-id'.

1998-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-method-to-decrypt-application/pgp-encrypted):
	Use `mime-raw-point-to-entity-node-id'; abolish `entity-number'.

	* (mime-method-to-verify-application/pgp-signature): Use
	`mime-raw-point-to-entity-node-id'; abolish `entity-number'.

	* mime-pgp.el (mime-method-to-verify-multipart/signed): Use
	`mime-raw-point-to-entity-node-id'.

	* mime-view.el (mime-raw-point-to-entity-node-id): New function.

	* mime-view.el, mime-pgp.el: Rename `reversed-entity-number' ->
	`entity-node-id'.

	* mime-view.el, mime-parse.el: Rename `reversed-number' ->
	`node-id'.

	* mime-pgp.el: `rcnum' -> `reversed-entity-number'.

	* mime-pgp.el: `cnum' -> `entity-number'.

	* mime-pgp.el: `beg' -> `start'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el (mailcap-look-at-field): Change field-name to symbol.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el (mailcap-look-at-type-field): Must allow
	"implicit-wild".
	(mailcap-look-at-field): fixed.

1998-03-13  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* README.en (Bug reports): Modify description of tm mailing list.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-play.el: Rename
	`mime-view-quitting-method-for-mime-show-message-mode' ->
	`mime-preview-quitting-method-for-mime-show-message-mode'.

	* mime-play.el, mime-edit.el, mime-view.el: Rename
	`mime-view-quitting-method-alist' ->
	`mime-preview-quitting-method-alist'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Rename `mime-article::write-region' ->
	`mime-raw-write-region'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el, mime-play.el: Rename `mime-playback-entity' ->
	`mime-raw-play-entity'.

	* mime-play.el, mime-view.el: Rename `mime-view-cinfo' ->
	`mime-view-entity-info'.

	* mime-view.el, mime-parse.el: Rename `mime-entity-info-rnum' ->
	`mime-entity-info-reversed-number'.

	* mime-view.el: Rename `mime/flatten-content-info' ->
	`mime-raw-flatten-message-info'.

	* mime-pgp.el, mime-view.el: Rename `mime-raw-rcnum-to-cinfo' ->
	`mime-raw-reversed-entity-number-to-entity-info'.

	* mime-view.el: Rename `mime-raw-cnum-to-cinfo' ->
	`mime-raw-entity-number-to-entity-info'.

	* mime-pgp.el, mime-partial.el, mime-view.el: Rename
	`mime-raw-entity-info' -> `mime-raw-message-info'.

	* mime-play.el, mime-pgp.el, mime-view.el: Rename
	`mime-raw-point-content-number' ->
	`mime-raw-point-to-entity-number'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-pgp.el, mime-view.el: Rename ` mime-article/'
	-> `mime-raw-'.

	* mime-view.el: Rename `mime-view-get-original-major-mode' ->
	`mime-preview-original-major-mode'.

	* mime-view.el: Rename `mime-view-display-x-face' ->
	`mime-preview-display-x-face'.

	* mime-play.el, mime-pgp.el, mime-bbdb.el, mime-view.el: Rename
	`mime-view-buffer' -> `mime-preview-buffer'.

	* mime-play.el, mime-view.el: Rename `mime::preview/' ->
	`mime-preview-'.

	* mime-view.el: Rename `mime-view-original-major-mode' ->
	`mime-preview-original-major-mode'.

	* mime-play.el, mime-edit.el, mime-view.el: Rename
	`mime-view-kill-buffer' -> `mime-preview-kill-buffer'.

	* mime-view.el: Rename `mime-view-show-summary' ->
	`mime-preview-show-summary'.

	* mime-view.el: Rename `mime-view-quit' -> `mime-preview-quit'.

	* mime-view.el: Rename `mime-view-follow-current-entity' ->
	`mime-preview-follow-current-entity'.

	* mime-view.el: Rename `mime-view-print-current-entity' ->
	`mime-preview-print-current-entity'.

	* mime-view.el (mime-view-menu-list): Modify menu.

	* mime-view.el: Rename `mime-view-extract-current-entity' ->
	`mime-preview-extract-current-entity'.

	* mime-def.el, mime-play.el, mime-view.el: Rename
	`mime-view-play-current-entity' ->
	`mime-preview-play-current-entity'.

	* mime-view.el: Rename `mime-view-previous-line-content' ->
	`mime-preview-previous-line-entity'.

	* mime-view.el: Rename `mime-view-next-line-content' ->
	`mime-preview-next-line-entity'.

	* mime-view.el: Rename `mime-view-scroll-' ->
	`mime-preview-scroll-'.

	* mime-view.el: Rename `mime-view-move-to-' ->
	`mime-preview-move-to-'.

	* mime-play.el, mime-image.el: Rename `mime-preview/' ->
	`mime-preview-'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el (mime-method-to-combine-message/partial-pieces):
	Rename `mime-raw-content-info' -> `mime-raw-entity-info'.

	* mime-pgp.el, mime-view.el: Rename `mime-raw-content-info' ->
	`mime-raw-entity-info'.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-raw-content-info): Modify DOC-string.

1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: Abolish `eword-encode-RCS-ID'.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el: Rename
 	`mime-combine-message/partials-automatically' ->
 	`mime-method-to-combine-message/partial-pieces'.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-acting-condition): Separate type and subtype.

	* mime-view.el (mime-acting-condition): Separate type and subtype.

	* mime-play.el (mime-playback-entity): Separate type and subtype.


1998-03-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.0.2 (Nonoichi-Kōdaimae) was released.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el: Rename `mime-pgp-add-keys' ->
	`mime-method-to-add-application/pgp-keys'.

	* mime-pgp.el: Rename `mime-pgp-decrypt-application/pgp-encrypted'
	-> `mime-method-to-decrypt-application/pgp-encrypted'.

	* mime-pgp.el: Rename `mime-pgp-check-application/pgp-signature'
	-> `mime-method-to-verify-application/pgp-signature'.

	* mime-pgp.el: Rename `mime-check-multipart/signed' ->
	`mime-method-to-verify-multipart/signed'.

	* mime-pgp.el: Rename `mime-process-application/pgp' ->
	`mime-method-for-application/pgp'.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el (mailcap-look-at-type-field): Change type and subtype
	to symbol.

	* mailcap.el (mailcap-file): New variable.
	(mailcap-parse-file): New function.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (What's SEMI?): Remove what does SEMI stand for.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-acting-condition): Use `mime-method-to-save'
	instead of external method "tm-file".

	* mime-play.el: Rename `mime-extract-current-entity' ->
	`mime-method-to-save'.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Abolish mime-file.el.

	* mime-play.el (mime-extract-current-entity): New function; copied
	from mime-file.el; abolish mime-file.el.

	* mime-view.el (mime-acting-condition), mime-partial.el
	(mime-combine-message/partials-automatically), mime-play.el:
	Rename `mime-display-message/partial' ->
	`mime-method-to-store-message/partial'.

1998-03-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-acting-condition), mime-play.el: Rename
	`mime-display-caesar' -> `mime-method-to-display-caesar'.

	* mime-view.el (mime-acting-condition), mime-play.el: Rename
	`mime-display-message/external-ftp' ->
	`mime-method-to-display-message/external-ftp'.

	* mime-view.el (mime-acting-condition), mime-play.el: Rename
	`mime-display-message/rfc822' ->
	`mime-method-to-display-message/rfc822'.

	* mime-play.el: Rename `mime-article/make-method-args' ->
	`mime-make-external-method-args'.

	* mime-file.el: Fix setting.

1998-03-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Rename `mime-article/start-external-method-region'
	-> `mime-activate-external-method'.

	* mime-play.el, mime-pgp.el: Rename `mime-display-content' ->
	`mime-playback-entity'.

	* mime-file.el (mime-extract-current-entity): Use
	`mime-write-decoded-region'.

	* mime-file.el: Rename `mime-article/extract-file' ->
	`mime-extract-current-entity'.

1998-03-03  Fran çois Pinard   <pinard@iro.umontreal.ca>

	* mime-edit.el (mime-edit-insert-signature): Function
 	`mime-edit-insert-tag' is sometimes called with more arguments
 	than it is ready to accept. (cf. [tm-en:1585])

1998-03-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-insert-text): New optional argument
	`subtype'.


1998-02-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.0.1 (Magae) was released.

1998-02-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-check-multipart/signed): New function.

1998-02-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-and-fold-structured-field): Fixed.

	* mime-edit.el (mime-file-types): Use `defcustom'.


1998-02-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 1.0.0 (Nukajūtaku-mae) was released.

	* SEMI-ELS: Remove mime-tar.el.

1998-02-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-version): Use `semi-version';
	abolish `eword-decode-RCS-ID'.

	* mime-view.el (mime-view-version-string): Use `semi-version';
	abolish `mime-view-version' and `mime-view-RCS-ID'.

	* mime-edit.el (mime-edit-version-string): Use `semi-version';
	abolish `mime-edit-version' and `mime-edit-RCS-ID'.

	* mime-def.el (semi-version): New constant; abolish constant
	`semi-version-name'.

	* mime-view.el: Rename `mime-view-version-name' ->
	`mime-view-version-string'.

	* mime-edit.el: Rename `mime-edit-version-name' ->
	`mime-edit-version-string'.

	* eword-decode.el (eword-lexical-analyzers): New variable.
	(eword-analyze-quoted-string): Add second argument.
	(eword-analyze-domain-literal): New function.
	(eword-analyze-spaces): New function.
	(eword-analyze-special): New function.
	(eword-analyze-atom): Add second argument.
	(eword-lexical-analyze-internal): Use `eword-lexical-analyzers'.


1998-02-17  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.118.2 (Otomaru) was released.

	* eword-decode.el (eword-decode-and-unfold-structured-field): New
 	function.

	* eword-decode.el (eword-decode-and-fold-structured-field): New
 	function.
	(eword-decode-structured-field-body): Use it.
	(eword-decode-header): Likewise.

	* eword-decode.el (eword-decode-structured-field-body): If
 	`START-COLUMN' is nil, it uses `mapconcat'.

	* eword-decode.el (eword-decode-token): New function.
	(eword-decode-structured-field-body): Add new optional arguments
 	`START-COLUMN' and `MAX-COLUMN'; fill results; use function
 	`eword-decode-token'.
	(eword-decode-header): Specify START-COLUMN for
 	`eword-decode-structured-field-body'.

1998-02-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-header): Unfold fields including
 	encoded-words.

	* eword-decode.el (eword-decode-ignored-field-list): New variable.
	(eword-decode-structured-field-list): New variable.
	(eword-decode-header): Refer them.

	* eword-decode.el (eword-decode-header): Don't use
 	`eword-decode-unstructured-field-body'.

1998-02-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-header): New implementation; add
 	new argument `CODE-CONVERSION' as first argument.  Change
 	`SEPARATOR' as second argument.


1998-02-12  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.118.1 (Shijima) was released.

	* README.en (Bug reports): Modified for SEMI.

1998-02-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-normalize-body): Must not ignore case to
 	search "From " in beginning of line.

1998-01-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el: Comment out setting for inline Postscript
	feature.

1998-01-11  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-analyze-atom): New function.
	(eword-lexical-analyze-internal): Use `eword-analyze-atom' instead
	of `std11-analyze-atom'.

1997-11-26  Thierry Emery     <Thierry.Emery@aar.alcatel-alsthom.fr>

	* mime-edit.el (mime-edit-insert-text): Fix to avoid unexpected
 	entering enriched-mode. (cf. [tm-ja:2697])


1997-11-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.118 (Sodani) was released.

1997-11-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-maybe-hide-echo-buffer): bury MIME echo
 	buffer.

1997-11-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-maybe-hide-echo-buffer): New inline function;
	abolish `mime-hide-echo-buffer'.
	(mime-view-mode): Use `mime-maybe-hide-echo-buffer'.

1997-11-20  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el: Rename `mime-article/add-pgp-keys' ->
 	`mime-pgp-add-keys'.

	* mime-pgp.el: Rename `mime-article/decrypt-pgp' ->
 	`mime-pgp-decrypt-application/pgp-encrypted'.

	* mime-pgp.el: Rename `mime-article/check-pgp-signature' ->
 	`mime-pgp-check-application/pgp-signature'.

	* mime-pgp.el: Rename `mime::article/call-pgp-to-check-signature'
 	-> `mime-pgp-check-signature'.

	* mime-pgp.el: Rename `mime-article/view-application/pgp' ->
 	`mime-process-application/pgp'.


1997-11-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.116 (Dōhōji) was released.

1997-11-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-pgp.el, mime-partial.el: Rename
	`mime::article/content-info' -> `mime-raw-content-info'.

1997-11-11  Fran çois Pinard   <pinard@iro.umontreal.ca>

	* mime-edit.el: Modify space in prompt and removespurious trailing
	spaces in the files. (cf. [tm-en:1507])

1997-11-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Rename `mime-edit-enclose-region' ->
	`mime-edit-enclose-region-internal'.

	* mime-edit.el (mime-edit-enclose-quote-region,
	mime-edit-enclose-mixed-region, mime-edit-enclose-parallel-region,
	mime-edit-enclose-digest-region,
	mime-edit-enclose-alternative-region,
	mime-edit-enclose-signed-region,
	mime-edit-enclose-encrypted-region): Change subtype to symbol.

1997-11-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-bbdb.el, semi-setup.el: Use path-util.el instead of
	file-detect.el.

1997-11-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Add group `mime' to `default-mime-charset'.

1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (eword-encode-field): Must regard MIME-Version
	field as structured field.


1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.115.2 (Inokuchi) was released.

1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-split-message): Use `defcustom'.
	(mime-edit-message-default-max-lines): Use `defcustom'.
	(mime-edit-message-max-lines-alist): Use `defcustom'.

1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* Makefile: Abolish `execs' and `install-execs'.

1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit): New customize group.
	(mime-ignore-preceding-spaces): Use `defcustom'.
	(mime-ignore-trailing-spaces): Use `defcustom'.
	(mime-ignore-same-text-tag): Use `defcustom'.
	(mime-auto-hide-body): Use `defcustom'.
	(mime-edit-voice-recorder): Use `defcustom'.
	(mime-edit-mode-hook): Use `defcustom'.
	(mime-edit-translate-hook): Use `defcustom'.
	(mime-edit-exit-hook): Use `defcustom'.

	* mime-def.el (mime): New customize group.
	(mime-button-face): Use `defcustom'.
	(mime-button-mouse-face): Use `defcustom'.

1997-11-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-x-emacs-value): Don't add mule-version
	if enable-multibyte-characters is nil.

1997-10-31  Kazuhiro Ohta     <ohta@ele.cst.nihon-u.ac.jp>

	* mime-play.el (mime-article::write-region): fixed
	(cf. [tm-ja:2641]).

1997-10-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el (mime-setup-set-signature-key): Check local keymap
	is exist or not to fix problem about
	`gnus-summary-resend-message'.


1997-10-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.115.1 (Oyanagi) was released.

1997-10-03  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* mime-play.el (mime-display-message/partial): Use `write-region'.

	* mime-pgp.el (mime-article/check-pgp-signature): Use
	`write-region'.

	* mime-file.el (mime-article/extract-file): Use `write-region'.

1997-10-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Don't use `third' (don't use cl function).

	* SEMI-CFG: Add current directory to load-path.

	* mime-def.el, mime-edit.el (mime-edit-insert-text): Rename
 	`second' -> `cadr' (Don't use cl function).


1997-09-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.115 (Hinomiko) was released.

	* README.en: Modify for Emacs 20.2.

1997-09-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el (butlast, nbutlast): Don't use `defun-maybe' for cl
	functions.

1997-09-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el (butlast): New function; imported from cl.el.
	(nbutlast): New function; imported from cl.el.

1997-09-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-cut-header): Don't use `member-if'.

	* mime-def.el: Don't require cl.

	* eword-encode.el: Abolish variable `eword-generate-X-Nsubject'.
	(eword-encode-header): Abolish X-Nsubject field generator.

	* eword-encode.el (eword-find-field-encoding-method): New inline
	function.
	(eword-encode-header): Use it.

1997-09-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el: Use `exec-installed-p' to search
	`uncompface-program'.

1997-09-24  Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>

	* signature.el: Add doc-string to `signature-file-alist'.

	* mime-bbdb.el: Remove Artur Pioro from the authors list; Recent
	versions don't contain his code.

1997-09-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Don't use cl.
	(mime-article/rcnum-to-cinfo): New implementation (use function
	`mime-article/cnum-to-cinfo'); use `defsubst'.

1997-09-18  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-x-emacs-value): Use `(featurep
	'xemacs)'; add DOC-string.

1997-09-17  Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>

	* mime-edit.el (mime-edit-x-emacs-value): Add `(Meadow-version)'
	when running Meadow. (cf. [tm-ja:2567], [mule-win32:4339])

1997-09-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-mime-version-field-for-message/partial):
	New constant.
	(mime-edit-insert-partial-header): Use it.


1997-09-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.112 (Tsurugi) was released.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-insert-entity-button): Change interface
	to use `media-type' and `media-subtype' instead of `ctype'.
	(mime-view-entity-button-function): ditto.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-body-visible-p): Change interface to use
	`media-type' and `media-subtype' instead of `ctype'.
	(mime-view-entity-separator-function): ditto.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity): Use `media-type' and
	`media-subtype' instead of `ctype' to compare with
	message/partial.

	* mime-view.el (mime-view-follow-current-entity,
	mime-view-display-entity, mime-view-entity-button-function): Use
	`mime-entity-info-media-type' and `mime-entity-info-media-subtype'
	instead of `mime-entity-info-type/subtype'.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Abolish macro `define-structure'.

	(make-mime-entity-info, mime-entity-info-rnum,
	mime-entity-info-point-min, mime-entity-info-point-max,
	mime-entity-info-parameters, mime-entity-info-encoding,
	mime-entity-info-children): New implementation.

	(mime-entity-info-media-type, mime-entity-info-media-subtype): New
	inline function.

	* mime-view.el (mime-view-display-entity,
	mime-article/point-content-number, mime-article/cnum-to-cinfo,
	mime/flatten-content-info): Use `mime-entity-info-children'
	instead of `mime::content-info/children'.

	* mime-parse.el (mime-entity-info-children): New inline function.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-body-visible-p,
	mime-view-display-entity): Use `mime-entity-info-encoding' instead
	of `mime::content-info/encoding'.

	* mime-play.el (mime-display-content): Use
	`mime-entity-info-encoding' instead of
	`mime::content-info/encoding'.

	* mime-parse.el (mime-entity-info-encoding): New inline function.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity), mime-partial.el
	(mime-combine-message/partials-automatically), mime-play.el
	(mime-display-content): Use `mime-entity-info-parameters' instead
	of `mime::content-info/parameters'.

	* mime-parse.el (mime-entity-info-parameters): New inline
	function.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-header-visible-p,
	mime-view-body-visible-p, mime-view-entity-button-function,
	mime-view-display-entity, mime-view-follow-current-entity),
	mime-play.el (mime-display-content): Use
	`mime-entity-info-type/subtype' instead of
	`mime::content-info/type'.

	* mime-parse.el (mime-entity-info-type/subtype): New inline
	function.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity,
	mime-article/rcnum-to-cinfo, mime-view-follow-current-entity,
	mime-view-move-to-upper): Use `mime::content-info/rcnum' instead
	of `mime-entity-info-rnum'.

	* mime-parse.el (mime-entity-info-rnum): New inline function.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-display-entity,
	mime-article/point-content-number,
	mime-view-follow-current-entity), mime-play.el
	(mime-display-content), mime-pgp.el
	(mime-article/check-pgp-signature, mime-article/decrypt-pgp): Use
	`mime-entity-info-point-{min|max}' instead of
	`mime::content-info/point-{min|max}'.

	* mime-parse.el (mime-entity-info-point-min): New inline function.
	(mime-entity-info-point-max): New inline function.
	(mime-parse-multipart): Use `mime-entity-info-point-max' instead
	of `mime::content-info/point-max'.

1997-09-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el (mailcap-skip-comment): Check `chr' is nil.

	* mime-edit.el (mime-edit-decode-buffer): Modify for new return
	format of `mime-parse-Content-Type'.

	* mime-parse.el (mime-parse-Content-Type): Change return format.
	(mime-read-Content-Type): Modify DOC-string.
	(make-mime-entity-info): New inline function.
	(mime-parse-multipart): Change interface.
	(mime-parse-message): Rename names of arguments.

	* mime-def.el (mime-tspecials): Remove `.' and control-characters.
	(mime-token-regexp): Add specification for control-characters.

1997-09-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-cut-header): Use `defun' instead of
	`defsubst'.

	* mime-view.el: Rename `mime-preview/display-body' ->
	`mime-view-display-body'.

	* mime-view.el: Rename `mime-preview/display-header' ->
	`mime-view-display-header'.

1997-09-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el, mime-edit.el: Rename `mime/Content-Type' ->
	`mime-read-Content-Type'.

	* mime-parse.el (symbol-concat): New implementation.

1997-08-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Abolish alias `last*'.

	* eword-decode.el (eword-lexical-analyze): `last' of Emacs 20.0.97
	allows two arguments.

1997-08-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-lexical-analyze): Use `last*' instead of
	`last' (for Emacs 20.0.96).

	* mime-def.el (last*): New alias for old emacsen.

1997-07-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el, mime-def.el: Constant
	`mime-disposition-type-regexp' was moved from mime-def.el to
	mime-parse.el.


1997-07-25  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.97 (Naka-Tsurugi) was released.

1997-07-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Delete unnecessary "[mime-edit.el]" from
	DOC-strings.

1997-07-23  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-analyze-encoded-word): cdr of return
	value must not nil (cf.[tm-ja:2496])

1997-07-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-play.el: `mime-article/view-message/rfc822'
	-> `mime-display-message/rfc822'.

1997-07-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (eword-phrase-route-addr-to-rwl): Use function
	`eword-addr-seq-to-rwl'.

	* eword-encode.el: `tm-eword::phrase-route-addr-to-rwl' ->
	`eword-phrase-route-addr-to-rwl'.

	* eword-encode.el (eword-addr-seq-to-rwl): New function.
	(eword-addr-spec-to-rwl): Use function `eword-addr-seq-to-rwl'.

	* eword-encode.el (eword-addr-spec-to-rwl): New implementation.

	* eword-encode.el: `tm-eword::addr-spec-to-rwl' ->
	`eword-addr-spec-to-rwl'.

1997-07-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Constant `mime::ctype-regexp' was abolished.

	* mime-parse.el: Constant `mime::dtype-regexp' was abolished.

	* mime-parse.el, mime-def.el: `mime/disposition-type-regexp' ->
	`mime-disposition-type-regexp'.


1997-07-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.96 (Kaga-Ichinomiya) was released.

1997-07-05  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: (mime-edit-normalize-body):
	- Protect "From " in beginning of line (insert `ESC ( B' before it
	  if possible, otherwise encode by quoted-printable)
	- canonicalize line break code for base64

1997-07-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* signature.el (signature-separator): New variable.
	(insert-signature): Insert `signature-separator' when signature is
	inserted at end of file.

1997-07-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-version-name): Add `semi-version-name'.

	* mime-view.el (mime-view-version-name): New constant.

	* mime-def.el (semi-version-name): New constant.

1997-07-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en (Required environment): Updated.

1997-07-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el, mime-def.el: `mime/content-type-subtype-regexp'
	-> `mime-media-type/subtype-regexp'.

1997-07-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el, mime-def.el, mailcap.el: `mime/token-regexp' ->
	`mime-token-regexp'.

	* mime-def.el: `mime/tspecials' -> `mime-tspecials'.

1997-07-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-pgp.el, mime-def.el: `mime/temp-buffer-name'
	-> `mime-temp-buffer-name'.

1997-07-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el (mime-decode-text-body): Canonicalize line break
	code.

1997-06-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mailcap.el: New file.

1997-06-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (eword-field-encoding-method-alist): Add
	"Message-ID" as ignored.

1997-06-26  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (tm-eword::encode-string-1): avoid infinite loop
	caused by long non-encoded-word element. (cf. [tm-en:1356])

1997-06-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime-preview/display-message/partial' ->
	`mime-view-insert-message/partial-button'.

	* mime-view.el (mime-preview/display-message/partial): Use
	`mime-add-button' again.

1997-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: `tm-eword::lc-words-to-words' ->
	`eword-encode-charset-words-to-words'.

	* eword-encode.el (tm-eword::lc-words-to-words): New
	implementation; function `tm-eword::parse-word' was abolished.

1997-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: `tm-eword::split-to-lc-words' ->
	`eword-encode-divide-into-charset-words'.

	* eword-encode.el: Function `tm-eword::parse-lc-word' was
	abolished.
	(tm-eword::split-to-lc-words): New implementation.

1997-06-21  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: `tm-eword::char-type' ->
	`eword-encode-char-type'.

	* eword-encode.el: `tm-eword::encode-encoded-text' ->
	`eword-encode-text'

	* mime-view.el (mime-view-insert-entity-button,
	mime-preview/display-message/partial): Use `mime-insert-button'.

	(mime-view-setup-buffers): Enclose codes to display preview-buffer
	by `(let ((inhibit-read-only t)) ...)'.

	* mime-def.el (mime-insert-button): New inline function.

	* mime-def.el (mime-add-button): Argument `func' was renamed to
	`function'; Use overlay for `mime-button-mouse-face'.


1997-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.92 was released.

	* mime-view.el, mime-play.el, mime-partial.el:
	`mime-article/decode-' -> `mime-display-'.

	* mime-play.el (mime-display-caesar): fixed.

1997-06-18  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-decode-structured-field-body): fixed.

1997-06-16  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-decode.el (eword-lexical-analyze-cache): New variable.
	(eword-lexical-analyze-cache-max): New variable.
	(eword-analyze-quoted-string): New function.
	(eword-analyze-comment): New function.
	(eword-analyze-encoded-word): New function.
	(eword-lexical-analyze-internal): New function.
	(eword-lexical-analyze): New function.
	(eword-decode-structured-field-body): New function.
	(eword-decode-unstructured-field-body): New function.
	(eword-extract-address-components): New function.

1997-06-11  Steven L Baur     <steve@xemacs.org>

	* eword-encode.el (tm-eword::char-type, tm-eword::encode-rwl,
	tm-eword::encode-rwl): Clean up Ebola
	infection. (cf.[tm-en:1346],[xemacs-beta:9333])


1997-05-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.91 was released.

Wed May 28 13:16:15 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-define-keymap): fixed problem about
	[tab], [delete] and [backspace] keys.

Tue May 27 03:26:23 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-sign-pgp-elkins): Enclose PGP-processing
	by `as-binary-process'.

1997-05-23  Steven L Baur  <steve@altair.xemacs.org>

	* mime-view.el (mime-acting-condition): Add image/png
	mime type. (cf.[tm-en:1334])

	* mime-image.el: Add image/png mime type. (cf.[tm-en:1334])

	* mime-edit.el (mime-file-types): Add png handling.
	(mime-content-types): Ditto. (cf.[tm-en:1334])

Fri May 23 22:13:47 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-define-keymap): Doesn't bind
	`beginning-of-buffer' and `end-of-buffer' for "<" and ">" keys.


1997-05-15  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.88 was released.

Thu May 15 06:05:13 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* Makefile (tar): New implementation.

Tue May 13 14:32:39 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-MK (config-semi): fixed.

	* SEMI-CFG: Add site-lisp/apel/ even if LISPDIR is specified.

Tue May 13 14:11:48 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* README.en: Add `LISPDIR'.

	* Makefile (LISPDIR): New variable.

	* SEMI-CFG: Setting for load-path is modified.

Mon May 12 12:30:42 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-tar.el, mime-play.el, mime-pgp.el, mime-file.el,
	mime-view.el: `mime/content-decoding-condition' ->
	`mime-acting-condition'.


1997-05-09  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.87 was released.

Fri May  9 04:19:21 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-tar.el: `mime-viewer/uuencode-encoding-name-list' ->
	`mime-view-uuencode-encoding-name-list'.

Fri May  9 03:07:02 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Use "text/x-rot13-47-48" instead of
	"text/x-rot13-47".

	* mime-view.el (mime/content-decoding-condition): Add
	"text/x-rot13-47-48".

Fri May  9 01:26:13 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-normalize-body): Use
	`mule-caesar-region' instead of `caesar-region'.

	* mime-play.el (mime-display-caesar): Use `mule-caesar-region'
	instead of `caesar-region'.

	* mime-def.el: Add autoload for mule-caesar.el.

	* mime-def.el: Function caesar-region was abolished.

Thu May  8 23:31:45 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-edit.el, mime-def.el: `tm:caesar-region' ->
	`caesar-region'.

Thu May  8 22:37:47 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-define-keymap): Use
	`set-keymap-default-binding' for XEmacs.

Wed May  7 10:04:36 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-display-caesar): Don't use
	`buffer-substring'.

	* mime-play.el (mime-display-caesar): Use `view-buffer' instead of
	`view-mode-enter'.

Wed May  7 09:37:54 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Don't require `view'.

	Constant `mime-view-text/plain-mode-map' was abolished.

	Function `mime-view-text/plain-mode' and
	`mime-view-text/plain-exit' were abolished.

	(mime-display-caesar): Use `view-mode-enter mother' instead of
	`mime-view-text/plain-mode'.

Wed May  7 09:33:48 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el (mime/content-decoding-condition):
	`mime-article/decode-caesar' -> `mime-display-caesar'.

Wed May  7 05:49:03 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-cut-header): fixed. (cf.[tm-ja:2386])


1997-04-30  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI: Version 0.83 was released.

Sat Apr  5 06:20:34 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Overlay is required by emu.

Thu Apr  3 18:09:35 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el, mime-view.el, mime-text.el:
 	`mime-preview/filter-' -> `mime-view-filter-'.

	* mime-view.el: `mime-preview/get-original-major-mode' ->
 	`mime-view-get-original-major-mode'.

Thu Mar 27 22:16:53 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-mode): Hide mime-echo window.

	* mime-view.el: Function `mime-hide-echo-buffer' was moved from
 	mime-play.el.

	* mime-play.el: Function `mime-hide-echo-buffer' was moved to
 	mime-view.el.

	* mime-play.el (mime-hide-echo-buffer): New inline function.

	* mime-play.el (mime-echo-window-height): New variable.

Thu Mar 27 21:48:32 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-content-end): Abolish unused local
 	variable `beg'.

Thu Mar 27 21:45:49 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-follow-current-entity): Abolish unused
 	local variable `rc'.

Thu Mar 27 21:42:08 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (eword-encode-field): Intern down-cased
 	field-name and use `memq' instead of `member' to detect a field is
 	address-list or not.

Thu Mar 27 21:17:25 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/check-pgp-signature): Use
 	`insert-buffer-substring'.

Thu Mar 27 20:59:00 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/check-pgp-signature):
 	`mime-article/show-output-buffer' -> `mime-show-echo-buffer'.

	* mime-play.el: `mime-article/show-output-buffer' ->
 	`mime-show-echo-buffer'.

	* mime-play.el: `mime/output-buffer-window-is-shared-with-bbdb' ->
 	`mime-echo-window-is-shared-with-bbdb'.

Thu Mar 27 20:47:14 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Variable
 	`mime/output-buffer-window-is-shared-with-bbdb' was moved from
 	mime-def.el.

	* mime-def.el: Variable
 	`mime/output-buffer-window-is-shared-with-bbdb' was moved to
 	mime-play.el.

Thu Mar 27 20:40:57 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-mode): `mime/output-buffer-name' ->
 	`mime-echo-buffer-name'.

	* mime-play.el: `mime/output-buffer-name' ->
 	`mime-echo-buffer-name'.

	* mime-pgp.el (mime-article/check-pgp-signature):
 	`mime/output-buffer-name' -> `mime-echo-buffer-name'.

	* mime-def.el (mime-echo-buffer-name): Renamed from
 	`mime/output-buffer-name'.

Fri Mar 21 17:55:10 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-content-end): Abolish unused local
 	variable `top'.

	* mime-view.el: Function `mime-view-make-preview-buffer' was
 	abolished.

	* mime-view.el: `mime-view-setup-buffer' ->
 	`mime-view-setup-buffers'.


1997-03-18  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* MU: Version 0.40.2 was released.
	* SEMI: Version 0.75 was released.

Tue Mar 18 15:28:25 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-edit-translate-single-part-tag): Add
 	DOC-string.

Tue Mar 18 15:21:28 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime::preview/original-major-mode' ->
 	`mime-view-original-major-mode'.

Tue Mar 18 15:17:48 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el, mime-view.el: `mime::preview/mother-buffer' ->
 	`mime-mother-buffer'.

Tue Mar 18 15:12:10 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el, mime-play.el, mime-edit.el, mime-view.el:
 	`mime::preview/article-buffer' -> `mime-raw-buffer'.

Tue Mar 18 14:47:23 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-tar.el, mime-play.el, mime-pgp.el, mime-bbdb.el,
 	mime-view.el: `mime::article/preview-buffer' ->
 	`mime-view-buffer'.

Tue Mar 18 14:32:53 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Structure `mime::preview-content-info' was
 	abolished.

	(mime-view-setup-buffer): Return only
 	`mime::article/preview-buffer'.

	(mime-view-make-preview-buffer): Don't generate
 	preview-content-list; Return only `mime::article/preview-buffer'.

	(mime-view-display-entity): Don't create
 	`mime::preview-content-info'.

	(mime-view-mode): Don't set for `mime::preview/content-list'.

Tue Mar 18 13:56:18 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el (mime-combine-message/partials-automatically):
 	Don't use preview-content-list.

Tue Mar 18 13:06:09 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el: Don't require mime-partial; It is autoloaded.

	* mime-partial.el: `mime-article/grab-message/partials' ->
 	`mime-combine-message/partials-automatically'.

	* mime-partial.el: `mime-partial/preview-article' ->
 	`mime-view-partial-message'.

	* mime-partial.el: `mime-partial/preview-article-method-alist' ->
 	`mime-view-partial-message-method-alist'.

	* mime-play.el
 	(mime-view-quitting-method-for-mime-show-message-mode): Don't use
 	preview-content-list.

	* mime-text.el (mime-text-decoder-alist): `mime/show-message-mode'
 	-> `mime-show-message-mode'.

	* mime-pgp.el (mime-article/view-application/pgp):
 	`mime/show-message-mode' -> `mime-show-message-mode'.

	* mime-view.el (mime-view-follow-current-entity): New
 	implementation.

Tue Mar 18 08:24:07 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime-view-follow-content' ->
 	`mime-view-follow-current-entity'.

	* mime-view.el (mime-view-mode): Don't use preview-content-list to
 	move to initial point.

	* mime-view.el: Function `mime-preview/cinfo-to-pcinfo' was
 	abolished.

	* mime-view.el: Function `mime-preview/point-pcinfo' was
 	abolished.

	* mime-view.el: Function `mime-preview/point-content-number' was
 	abolished.

	* mime-play.el (mime-view-play-current-entity): New
 	implementation.

Mon Mar 17 17:18:29 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-quit): Use variable
 	`mime::preview/original-major-mode'.

	* mime-view.el (mime-view-show-summary): Use variable
 	`mime::preview/original-major-mode'.

	* mime-view.el (mime-view-scroll-down-entity): New implementation.

	* mime-view.el (mime-view-scroll-up-entity): New implementation.

Mon Mar 17 16:19:30 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime-view-scroll-down-content' ->
 	`mime-view-scroll-down-entity'.

	* mime-view.el: `mime-view-scroll-up-content' ->
 	`mime-view-scroll-up-entity'.

	* mime-view.el (mime-view-move-to-next): New implementation.

Mon Mar 17 16:03:11 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime-view-next-content' ->
 	`mime-view-move-to-next'.

	* mime-view.el (mime-view-move-to-previous): New implementation.

	* mime-view.el: `mime-view-previous-content' ->
 	`mime-view-move-to-previous'.

	* mime-view.el: `mime-view-up-content' ->
 	`mime-view-move-to-upper'.

Mon Mar 17 15:39:17 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-play.el: `mime/show-message-mode' ->
 	`mime-show-message-mode'.

	* mime-view.el (mime-view-up-content): New implementation.

	* mime-view.el: `mime-preview/display-content' ->
 	`mime-view-display-entity'.

	* mime-view.el (mime-preview/display-content): Put
 	`mime-view-raw-buffer' and `mime-view-cinfo' as text-property.

	* mime-view.el: Variable `mime-view-visible-field-regexp' was
 	abolished.

	* mime-view.el: `mime-preview/cut-header' ->
 	`mime-view-cut-header'.

	* mime-view.el (mime-view-entity-separator-function): New
 	implementation.

	* mime-view.el: `mime-preview/default-content-separator' ->
 	`mime-view-entity-separator-function'.

Mon Mar 17 13:49:27 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-view-header-visible-p): Abolish optional
 	argument `ctype'.

	* mime-view.el (mime-view-entity-button-function): New
 	implementation.

	* mime-view.el: Variable
 	`mime-view-content-button-ignored-ctype-list' was abolished.

	* mime-view.el: `mime-preview/default-content-button-function' ->
 	`mime-view-entity-button-function'.

	* mime-view.el: Variable `mime-preview/content-button-function'
 	was abolished.

	* mime-def.el (mime-add-button): New implementation.

	* mime-view.el (mime-view-insert-entity-button): modified.

	* mime-view.el: `mime-preview/insert-content-button' ->
 	`mime-view-insert-entity-button'.

	* mime-view.el (mime-view-header-visible-p): Don't calculate ctype
 	is optional argument `ctype' is not nil.

Mon Mar 17 12:12:01 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: `mime-print-entity' ->
 	`mime-view-print-current-entity'.

	* mime-view.el: `mime-extract-entity' ->
 	`mime-view-extract-current-entity'.

	* mime-play.el, mime-view.el: `mime-play-entity' ->
 	`mime-view-play-current-entity'.

	* mime-view.el (mime-play-entity, mime-extract-entity,
 	mime-print-entity): Add DOC-string.

	* mime-view.el: `mime-view-print-content' -> `mime-print-entity'.

	* mime-view.el: `mime-view-extract-content' ->
 	`mime-extract-entity'.

	* mime-play.el: Variable `mime-view-decoding-mode' was abolished.

	* mime-play.el: Variable `mime-view-decoding-mode' was moved from
 	mime-view.el.

	* mime-view.el: Variable `mime-view-decoding-mode' was moved to
 	mime-play.el.

Mon Mar 17 05:09:05 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el: Use `mime-play-entity' instead of
 	`mime-view-play-content'.

Mon Mar 17 05:06:33 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el, mime-play.el: `mime-preview/decode-content' ->
 	`mime-play-entity'.

	* mime-view.el (mime-view-play-content, mime-view-extract-content,
 	mime-view-print-content): Modify to use optional argument `mode'.

Mon Mar 17 04:41:21 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el (mime-preview/decode-content,
 	mime-article/decode-content): Add new optional argument `mode'.

Sun Mar 16 02:23:31 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el: `mime-charset/maybe-decode-buffer' ->
 	`mime-text-decode-buffer-maybe'.

	* mime-text.el: `mime-preview/decode-text-buffer' ->
 	`mime-decode-text-body'.

	* mime-view.el (mime-view-visible-media-type-list): Add
 	"text/rfc822-headers".

Sun Mar 16 01:02:03 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el, mime-view.el:
 	`mime-view-default-showing-Content-Type-list' ->
 	`mime-view-visible-media-type-list'.

Sun Mar 16 00:22:03 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: `mime-raw::text-decoder' -> `mime-text-decoder'.

	* mime-pgp.el (mime-article/view-application/pgp):
 	`mime-charset/decode-buffer' -> `mime-text-decode-buffer'.

	* mime-text.el: `mime-charset/decode-buffer' ->
 	`mime-text-decode-buffer'.

Sat Mar 15 23:59:09 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/view-application/pgp):
 	`mime-raw::text-decoder' -> `mime-text-decoder'.

	* mime-text.el: `mime-raw::text-decoder' -> `mime-text-decoder'.

Sat Mar 15 23:53:49 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el: Variable `mime-raw::text-decoder' was moved from
 	mime-view.el.

	* mime-view.el: Variable `mime-raw::text-decoder' was moved to
 	mime-text.el.

Sat Mar 15 22:40:50 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/view-application/pgp): Use
 	`insert-buffer-substring'.

Sat Mar 15 22:27:53 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/view-application/pgp):
 	`mime::article/code-converter' -> `mime-raw::text-decoder'.

	* mime-play.el (mime-article/view-message/rfc822):
 	`mime::article/code-converter' -> `mime-raw::text-decoder'.

	* mime-text.el (mime-preview/decode-text-buffer):
 	`mime::article/code-converter' -> `mime-raw::text-decoder'.

	* mime-view.el: `mime::article/code-converter' ->
 	`mime-raw::text-decoder'.

Sat Mar 15 21:20:02 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el (mime-article/add-pgp-keys): Abolish unused local
 	variables `charset' and `mime::article/preview-buffer'.

	* mime-pgp.el (mime-article/add-pgp-keys): Abolish unused local
 	variable `mode'.

Sat Mar 15 21:10:43 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-image.el (mime-preview/filter-for-image): Abolish unused
 	local variable `charset'.

	* mime-pgp.el (mime-article/check-pgp-signature): Abolish unused
 	local variable `status'.

	* mime-pgp.el: (mime-article/view-application/pgp,
 	mime-article/add-pgp-keys): Abolish unused local variable
 	`cur-buf'.

	* mime-image.el (mime-preview/filter-for-image,
 	mime-preview/filter-for-application/postscript): Abolish unused
 	local variable `mode'.

Sat Mar 15 20:56:19 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el
 	(mime-preview/filter-for-text/richtext,
 	mime-preview/filter-for-text/enriched): Abolish unused local
 	variable `mode'.

	* mime-text.el (mime-preview/decode-text-buffer): New
 	implementation.

	* mime-view.el (mime-view-follow-content): Abolish unused
 	variables `f', `mid', `subj', `reply-to', `cc', `to', `from', `he'
 	and `hb'.

	* mime-edit.el (mime-edit-goto-tag): Abolish unused variable
 	`multipart'.

	* mime-file.el (mime-article/extract-file): Abolish unused local
 	variable `the-buf'.

	* mime-tar.el: Quote *autoconv*.

Sat Mar 15 20:29:25 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el (mime-article/grab-message/partials): Unused
 	local variable `mother' was abolished.

	* mime-play.el (mime-article/decode-caesar): Unused local variable
 	`cur-buf' was abolished.

	* mime-play.el (mime-article/decode-message/external-ftp): Unused
 	local variable `access-type' was abolished; Comment out `mode'.

	* mime-play.el (mime-article/view-message/rfc822): Unused local
 	variable `cur-buf' was abolished.

	* mime-text.el (mime-preview/filter-for-text/richtext,
 	mime-preview/filter-for-text/enriched): Unused local variable `m'
 	was abolished.

	* mime-parse.el (mime-parse-multipart):
	Unused local variable `ct' was abolished.

	* eword-encode.el: Require eword-decode.

	* mime-image.el (mime-preview/filter-for-application/postscript):
 	Unused local variable `m' was abolished.

Sat Mar 15 19:47:27 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el: (mime-article/view-application/pgp):
 	`mime-viewer/code-converter-alist' -> `mime-text-decoder-alist'.

	* mime-pgp.el (mime-pgp-command): New variable.

	(mime::article/call-pgp-to-check-signature): Use variable
 	`mime-pgp-command'. (cf. [tm-en:1259])

Sat Mar 15 19:25:25 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-pgp.el: `mime/viewer-mode' -> `mime-view-mode'.
  	(cf. [tm-en:1259])


1997-03-14  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* emu: Version 7.40.1 was released.
	* APEL: Version 3.2 was released.
	* bitmap-mule: Version 7.17 was released.
	* MU: Version 0.40.1 was released.
	* MEL: Version 6.3 was released.
	* SEMI: Version 0.72 was released.

Fri Mar 14 08:48:07 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Add mail-mime-setup.el.

Fri Mar 14 08:47:06 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mail-mime-setup.el: New module.

	* mime-setup.el: Only loads MUA specific setup files.

	* semi-setup.el: Setting for mime-edit, signature and mu-cite were
 	moved from mime-setup.el.

	* semi-setup.el: Setting for gnus-mime was moved to
 	gnus-mime/gnus-mime-setup.el.

	* semi-setup.el: Setting for mh-e was moved to emh/emh-setup.el.

	* Makefile: modified for SEMI package.

Fri Mar 14 07:42:44 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-MK: Don't compile and install other packages.

Fri Mar 14 06:09:23 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Definition of `mime-edit-mode' must be previous to
 	`add-minor-mode'.

	* mime-image.el (mime-preview/filter-for-image): Don't use
 	`assoc-value'.

Fri Mar 14 04:49:04 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Variable `mime-edit-prefix' and `mime-edit-map'
 	were abolished; Use `mime-edit-mode-map' directly.

	Use "C-c C-m" for enclosure commands.

	Add new binding "C-c C-x s" for `mime-edit-set-sign', "C-c C-x e"
 	for `mime-edit-set-encrypt'.

Fri Mar 14 04:41:27 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el: Require file-detect.

Wed Mar 12 07:49:41 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Delete variables about other packages.

Mon Mar 10 15:16:26 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Variable `mime-temp-directory' was moved to
 	mel/mel.el.

1997-03-10  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): Delete `mime-ftp'.

	* mime-view.el (mime/content-decoding-condition): Set up for
	`mime-article/decode-message/external-ftp'.

	* semi-setup.el: tm-latex.el was abolished.

	* semi-setup.el: tm-ftp is merged to mime-play.el.

	* mime-play.el (mime-article/dired-function): New variable; copied
 	from tm-ftp.el.

	(mime-article/dired-function-for-one-frame,
 	mime-article/decode-message/external-ftp): New function; copied
 	from tm-ftp.el.

1997-03-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-partial.el (mime-article/grab-message/partials): Don't use
 	`assoc-value'.

1997-03-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-play.el: Require filename.

1997-03-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-setup.el: Don't check `(boundp 'epoch::version)'.

	* mime-setup.el: Use `turn-on-mime-edit' instead of
 	`mime-edit-mode'.

	* mime-edit.el (mime-edit-decode-buffer): Renamed from
 	`mime-editor::edit-again'; optional argument `code-conversion' was
 	changed to `not-decode-text' (behavior was reversed).
	(mime-edit-again): modified for `mime-edit-decode-buffer'.

	* mime-edit.el (mime-edit-again-ignored-field-regexp): New
 	variable.

	* mime-edit.el (mime-edit-again): optional argument
 	`code-conversion' was changed to `not-decode-text' (behavior was
 	reversed); optional argument `no-mode' was renamed to
 	`not-turn-on'; `mail-header-separator' was replaced to null line
 	before converting.

1997-03-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: `mime-edit-mode' -> `turn-on-mime-edit';
 	`mime-edit-toggle-mode' -> `mime-edit-mode'.

	Alias `mime-mode' was abolished.

1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el (eword-encode-header): fixed.

	* mime-edit.el: Comments was modified.
	(mime-edit-mode): DOC-string was modified.

	* mime-edit.el: Function `mime-edit-define-menu-for-emacs19' was
 	abolished.  Buffer local variable `mime-edit-mode-old-local-map'
 	was abolished.

	* mime-edit.el: `mime-edit-minor-mime-map' ->
 	`mime-edit-mode-map'.

	* mime-edit.el: `mime-edit-mime-map' -> `mime-edit-map'.

	* mime-edit.el: Function `mime-edit-define-keymap' was abolished.

1997-03-06  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: `mime-prefix' -> `mime-edit-prefix'.

1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* semi-setup.el: tm-pgp.el was already renamed to mime-pgp.el.

1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el (pgp-function-alist): `tm:mc-' -> `mime-mc-'.

1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el (mime-temp-directory): Refer environment variable
 	"MIME_TMP_DIR" as default value.

1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS (semi-modules-to-compile): tm-latex.el and tm-html.el
 	were abolished.

	* mime-tar.el (mime-decode-message/tar), mime-play.el, mime-pgp.el
	(mime-article/check-pgp-signature), mime-partial.el
	(mime-article/grab-message/partials), mime-image.el, mime-edit.el
	(mime-edit-split-and-send), mime-def.el: Variable `mime/tmp-dir'
 	was renamed to `mime-temp-directory'.

	* mime-edit.el: `mime/edit-again' was renamed to
 	`mime-edit-again'.

1997-03-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-text.el, mime-edit.el: `mime/temporary-message-mode' was
 	renamed to `mime-temp-message-mode'.

	* mime-edit.el: Draft preview feature was abolished.

	* mime-edit.el (mime-transfer-level-string): Fixed DOC-string.

	Buffer local variable `mime/editing-buffer' was renamed to
 	`mime-edit-buffer'.

	* mime-edit.el (mime-edit-insert-x-emacs-field): New variable.
	(mime-edit-x-emacs-value): New variable.
	(mime-edit-translate-body): Insert X-Emacs field if variable
 	`mime-edit-insert-x-emacs-field' is not nil.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-view.el (mime-preview/insert-content-button): Don't use
 	function `assoc-value'.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-bbdb.el: `mime-bbdb-' -> `mime-bbdb/'.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-MK: compile and install emu and apel.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS: tm-bbdb.el was renamed to mime-bbdb.el.

	* mime-bbdb.el: Renamed from tm-bbdb.el.

	* SEMI-CFG (EMU_PREFIX, EMU_DIR): New variable.
	(APEL_PREFIX, APEL_DIR, APEL_RELATIVE_DIR): New variable.
	(load-path): Add "../apel" instead of "../tl".

	* SEMI-ELS: alist.el was moved to ../apel/.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-parse.el: Require emu; Function `char-list-to-string' was
 	abolished.

	* mime-edit.el: Require emu; definitions about visible/invisible
 	were abolished.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: Require emu; function
 	`find-non-ascii-charset-string' and
 	`find-non-ascii-charset-region' were abolished.

	* mime-def.el: Require atype; functions about atype were
 	abolished.

1997-03-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Require emu; Variable `running-xemacs' was
 	abolished; Macro `defun-maybe' was abolished; Function `functionp'
 	was abolished; Variable `charsets-mime-charset-alist',
 	`default-mime-charset' and `mime-charset-coding-system-alist' were
 	abolished; Function `mime-charset-to-coding-system',
 	`charsets-to-mime-charset', `detect-mime-charset-region',
 	`encode-mime-charset-region', `decode-mime-charset-region',
 	`encode-mime-charset-string' and `decode-mime-charset-string' were
 	abolished.

Sat Mar  1 04:12:37 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el (charsets-to-mime-charset): New function; copied
 	from emu.el.

	* eword-encode.el: Use `char-bytes' instead of `char-length'.

	* mime-def.el (eliminate-top-spaces): New inline-function; copied
 	from tl-str.el.

	* mime-edit.el: Fixed about definition of visible/invisible
 	functions for XEmacs.

Sat Mar  1 03:39:01 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el (enable-invisible, end-of-invisible): New macro;
 	copied from emu-19.el.
	(invisible-region, invisible-p, next-visible-point): New function;
 	copied from emu-19.el and emu-xemacs.el.
	(visible-region): New function; copied from emu-19.el.

	* mime-edit.el (mime-edit-make-boundary): New function.
	(mime-edit-translate-body, mime-edit-translate-region): Use
	`mime-edit-make-boundary'.

	* mime-edit.el (replace-space-with-underline): New inline
	function; copied from tl-str.el.

Sat Mar  1 02:07:00 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-encode.el (find-non-ascii-charset-region): New
 	inline-function; copied from emu-e20.el.

Fri Feb 28 06:46:48 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el: Require cl.

	* mime-view.el (mouse-button-2): New variable; copied from
 	emu-19.el and emu-xemacs.el.

	* mime-def.el (defun-maybe): New macro; copied from emu.el.
	(functionp): New function; copied from emu.el.

Fri Feb 28 05:14:54 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-play.el: Supports only Emacs/mule API.

	* mime-def.el (field-unify): Fixed.

	* semi-setup.el: Don't require mime-play.

	* mime-def.el: Function `put-fields' were abolished.

	* mime-def.el: atype functions were moved from mime-play.el.

	* mime-play.el: atype functions were moved to mime-def.el.

Fri Feb 28 04:50:13 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el (call-after-loaded): New function; moved from
 	semi-setup.el.

	* semi-setup.el: Function `call-after-loaded' was moved to
 	mime-def.el; require mime-def.

Fri Feb 28 04:44:27 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* semi-setup.el: require mime-play instead of mime-view when
 	compiling.

Fri Feb 28 04:21:43 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* SEMI-MK: BINS were abolished.

	* SEMI-CFG: require cl.

	* SEMI-CFG: Variable `BIN_SRC_DIR' and `BINS' were abolished.

Fri Feb 28 04:08:12 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* SEMI-MK: Renamed from TM-MK.

	* SEMI-CFG: Don't require tl-misc.

	* SEMI-ELS (semi-modules-to-compile): Add alist.el.

Fri Feb 28 02:33:20 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-play.el (field-unify): Fixed.

Fri Feb 28 02:22:38 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-setup.el, mime-image.el, mime-edit.el, mime-play.el:
 	Require alist.

	* alist.el: New module; separated from tl-list.el.

	* mime-play.el: Function `put-alist' and `del-alist' were moved to
 	alist.el.

	* mime-play.el (mime-article/coding-system-alist): Use
 	`no-conversion' instead of *noconv*.

Thu Feb 27 13:48:48 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-parse.el (char-list-to-string): New inline-function; copied
 	from emu-19.el.

Thu Feb 27 13:43:38 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-parse.el (symbol-concat): New inline-function; copied from
 	tl-str.el.

	* semi-setup.el: require 'mime-view when compiling.

	* mime-parse.el (regexp-*): New inline-function; copied from
 	tl-str.el.

Thu Feb 27 13:28:10 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* semi-setup.el (running-xemacs): New variable.

Thu Feb 27 09:00:33 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-play.el: `mime/viewer-mode' -> `mime-view-mode'.

	* mime-def.el: fixed DOC string.

Thu Feb 27 08:56:45 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el: Don't require emu.

	* mime-def.el (charsets-mime-charset-alist, default-mime-charset,
 	mime-charset-coding-system-alist): New variable; copied from
 	emu-e20.el.
	(mime-charset-to-coding-system, detect-mime-charset-region,
 	encode-mime-charset-region, decode-mime-charset-region,
 	encode-mime-charset-string, decode-mime-charset-string): New
 	function; copied from emu-e20.el.

	* eword-encode.el (find-non-ascii-charset-string): New
 	inline-function; copied from emu-e20.el.

Thu Feb 27 08:36:01 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-tar.el: Don't require emu.

Thu Feb 27 08:34:21 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-play.el (put-alist, del-alist): New function; copied from
 	tl-list.el.
	(put-fields, field-unifier-for-default, field-unifier-for-mode,
 	field-unify, assoc-unify, get-unified-alist, delete-atype,
 	remove-atype, replace-atype, set-atype): New function; copied from
 	tl-atype.el.  Don't require tl-atype.

Thu Feb 27 08:18:16 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* semi-setup.el (call-after-loaded): New function; imported from
 	tl-misc.el; Don't require tl-misc.

Thu Feb 27 08:10:24 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-pgp.el: Renamed from tm-pgp.el.

Thu Feb 27 08:05:45 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el (pgp-function-alist): tm-edit-mc.el was renamed to
 	mime-mc.el.

	* mime-mc.el: Renamed from tm-edit-mc.el.

Thu Feb 27 06:38:44 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-text.el: `tm:mother-button-dispatcher' ->
 	`mime-button-mother-dispatcher'.

	* mime-def.el, mime-text.el (mime-preview/filter-for-text/plain),
 	mime-view.el, mime-tar.el (mime-tar-set-properties):
 	`tm:add-button' -> `mime-add-button'.

	* mime-file.el: Renamed from tm-file.el.

Wed Feb 26 13:01:25 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el: Must require emu.

	* eword-decode.el (eword-decode-region): Unused local variable
 	`charset', `encoding' and `text'.

Wed Feb 26 07:58:29 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el (eword-decode-encoded-word): Use
 	`add-text-properties' directly.

Wed Feb 26 07:44:22 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el (tm:add-button): Use `add-text-properties' directly.

	* mime-def.el (running-xemacs): New variable; if it is not nil,
 	require overlay.

	* mime-def.el (regexp-or): New function.

Wed Feb 26 04:57:33 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-tar.el: Renamed from tm-tar.el.

	* mime-view.el (mime-view-define-keymap): `tm:button-dispatcher'
 	-> `mime-button-dispatcher'.

	* mime-def.el: `tm:button-dispatcher' -> `mime-button-dispatcher'.

	* mime-def.el: `tm:mother-button-dispatcher' ->
 	`mime-button-mother-dispatcher'.

	* mime-def.el: `semi-data' -> `mime-button-data'.

	* mime-def.el: `semi-callback' -> `mime-button-callback'.

	* mime-def.el: `tm:mouse-face' -> `mime-button-mouse-face'.

	* mime-def.el: `tm:button-face' -> `mime-button-face'.

	* mime-def.el (tm:add-button, tm:button-dispatcher):
 	`mime-callback' was renamed to `semi-callback'; `mime-data' was
 	renamed to `semi-data'.

Wed Feb 26 03:54:17 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-def.el (tm:add-button): Use `make-overlay' directly.

	* mime-def.el (tm:add-button): Use `overlay-put' directly.

Tue Feb 25 07:40:37 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-text.el: `tm:browse-url' was renamed to
 	`mime-text-browse-url'.

	* mime-text.el: Require browse-url.

	* mime-text.el: `tm:URL-regexp' was renamed to
 	`mime-text-url-regexp'.

	* mime-text.el: Variable `tm:URL-regexp',
 	`browse-url-browser-function' and function `tm:browse-url' were
 	moved from mime-def.el.

	* mime-def.el: Variable `tm:URL-regexp',
 	`browse-url-browser-function' and function `tm:browse-url' were
 	moved to mime-text.el.

	* eword-decode.el: Variable `tm:warning-face' was renamed to
 	`eword-warning-face'.

	* eword-decode.el: Variable `tm:warning-face' was moved from
 	mime-def.el.

	* mime-def.el: Variable `tm:warning-face' was moved to
 	eword-decode.el.

	* mime-def.el: Function `tm:set-face-region' was abolished.

	* mime-edit.el: `mime-edit-make-charset-default-encoding-alist' ->
 	`mime-make-charset-default-encoding-alist'.

	* mime-edit.el: `mime-edit-transfer-level' ->
 	`mime-transfer-level'.

	* mime-edit.el: Function `mime/encoding-name' was renamed to
 	`mime-encoding-name'.

	* mime-def.el: Function `mime/make-charset-default-encoding-alist'
 	was abolished.

	* mime-edit.el: Function `mime/encoding-name' was moved from
 	mime-def.el.

	* mime-def.el: Function `mime/encoding-name' was moved to
 	mime-edit.el.

Tue Feb 25 06:15:53 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el: Variable `mime-charset-type-list' was moved from
 	mime-def.el.

	* mime-def.el: Variable `mime-charset-type-list' was moved to
 	mime-edit.el.

Mon Feb 24 10:07:33 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-encode.el (eword-encode-header): fixed typo.

Mon Feb 24 10:04:23 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el (mime-edit-insert-message, mime-edit-insert-mail,
 	mime-editor::edit-again): Don't use `assoc-value'; Don't require
 	tl-list.

Mon Feb 24 10:00:50 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-play.el: require tl-atype.

	* mime-view.el: Don't require tl-atype.

Mon Feb 24 09:58:14 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: Don't require tl-misc.

Mon Feb 24 09:57:03 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-encode.el (eword-encode-header): Use function `assoc-if'
 	instead of `ASSOC'; require cl instead of tl-list.

	* mime-parse.el (define-structure): New macro; Don't require
 	tl-misc.el.

	* mime-view.el (mime-preview/insert-content-button): Don't use
 	function `assoc-value'.

	* mime-view.el: Require cl instead of tl-list.

	* mime-view.el: Don't require tl-str.el.

Mon Feb 24 09:12:12 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-parse.el (define-structure): New macro; Don't require
 	tl-misc.el.

	* mime-view.el (mime-preview/insert-content-button): Don't use
 	function `assoc-value'.

	* mime-view.el: Require cl instead of tl-list.

	* mime-view.el: Don't require tl-str.el.

Mon Feb 24 09:04:48 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el: Constant
 	`eword-Q-encoding-and-encoded-text-regexp' was abolished.

	* eword-decode.el (quoted-printable-hex-chars,
 	quoted-printable-octet-regexp, eword-Q-encoded-text-regexp,
 	eword-Q-encoding-and-encoded-text-regexp): New constant; moved
 	from mime-def.el.

	* mime-def.el (quoted-printable-hex-chars,
 	quoted-printable-octet-regexp, eword-Q-encoded-text-regexp,
 	eword-Q-encoding-and-encoded-text-regexp): Moved to
 	eword-decode.el.

	* eword-decode.el (base64-token-regexp,
 	base64-token-padding-regexp, eword-B-encoded-text-regexp): New
 	constant; moved from mime-def.el.

	* mime-def.el: Constant `base64-token-regexp',
 	`base64-token-padding-regexp' and `eword-B-encoded-text-regexp'
 	were moved to eword-decode.el.

	* mime-def.el: Constant `eword-B-encoding-and-encoded-text-regexp'
 	was abolished.

Mon Feb 24 08:52:01 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el: Don't require emu.

	* eword-decode.el: Don't require tl-str.el.

	* mime-def.el (get-version-string): New inline-function; imported
 	from tl-str.el.

Mon Feb 24 02:42:24 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-setup.el: Function `mime/encode-message-header' was renamed
 	to `eword-encode-header'.

	* mime-edit.el, eword-encode.el: Function
 	`eword-encode-message-header' was renamed to
 	`eword-encode-header'.

Mon Feb 24 02:26:02 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el (eword-decode-header): New optional argument
 	`SEPARATOR'; Use function `std11-narrow-to-header'.

	* mime-view.el, mime-setup.el, eword-decode.el: Function
 	`eword-decode-message-header' was renamed to
 	`eword-decode-header'.

Mon Feb 24 02:17:11 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el: tm-ew-e.el was renamed to eword-encode.el;
 	Function `mime/encode-message-header' was renamed to
 	`eword-encode-message-header'.

Mon Feb 24 01:59:28 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: Function `mime-eword/decode-string' was renamed to
 	`eword-decode-string'.

	* mime-def.el: `mime/Q-' -> `eword-Q-'.

	* mime-def.el: `mime/B-' -> `eword-B-'.

Mon Feb 24 01:46:59 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* eword-decode.el: Constant `eword-charset-regexp' was renamed to
 	`mime-charset-regexp'.

	* mime-def.el: Constant `mime/charset-regexp' was renamed to
 	`mime-charset-regexp'.

Mon Feb 24 01:38:18 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: Function `mime/decode-message-header' was renamed to
	`eword-decode-message-header'.

	* mime-view.el: tm-ew-d.el was renamed to eword-decode.el.

Mon Feb 24 01:32:33 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-setup.el: tm-ew-d.el was renamed to eword-decode.el;
 	Function `mime/decode-message-header' was renamed to
 	`eword-decode-message-header'.

Sat Feb 22 17:30:15 1997  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-CFG: Renamed from TM-CFG.

	* SEMI-ELS: Renamed from TM-ELS.

	* eword-encode.el: `eword-exist-encoded-word-in-subject' ->
 	`eword-in-subject-p'.

	* eword-encode.el: `mime/' -> `eword-'.

	* eword-encode.el (eword-generate-X-Nsubject): Don't refer
 	variable `mime/use-X-Nsubject'.

	* eword-encode.el (eword-generate-X-Nsubject): Renamed from
 	`mime/generate-X-Nsubject'.

	* eword-encode.el (eword-field-encoding-method-alist): Don't refer
 	variable `mime/no-encoding-header-fields'.

	* eword-encode.el (eword-field-encoding-method-alist): Renamed
 	from `mime/field-encoding-method-alist'.

	* eword-encode.el: Renamed from tm-ew-e.el.

	* eword-decode.el: Renamed from tm-ew-d.el.

	* mime-view.el: Don't require tm-def.

	* mime-parse.el: tm-def.el was renamed to mime-def.el.

	* mime-def.el: Renamed from tm-def.el.

1997-02-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* SEMI-ELS: Renamed from TM-ELS.

1997-02-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* eword-encode.el: `eword-exist-encoded-word-in-subject' ->
 	`eword-in-subject-p'.

	* eword-encode.el: `mime/' -> `eword-'.

	* eword-encode.el (eword-generate-X-Nsubject): Don't refer
 	variable `mime/use-X-Nsubject'.

	* eword-encode.el (eword-generate-X-Nsubject): Renamed from
 	`mime/generate-X-Nsubject'.

	* eword-encode.el (eword-field-encoding-method-alist): Don't refer
 	variable `mime/no-encoding-header-fields'.

	* eword-encode.el (eword-field-encoding-method-alist): Renamed
 	from `mime/field-encoding-method-alist'.

	* eword-encode.el: Renamed from tm-ew-e.el.

	* eword-decode.el: Renamed from tm-ew-d.el.

	* mime-view.el: Don't require tm-def.

	* mime-parse.el: tm-def.el was renamed to mime-def.el.

1997-02-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-def.el: Renamed from tm-def.el.

Fri Feb 21 08:04:42 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: Don't `suppress-keymap'.

Fri Feb 21 07:42:32 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: tm-parse.el was renamed to mime-parse.el.

	* mime-parse.el: Renamed from tm-parse.el.

	* mime-view.el: Key-binding for function
 	`mime-view-display-x-face' was abolished.

Fri Feb 21 07:04:51 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-setup.el: modified for mime-edit.el.

Fri Feb 21 07:02:52 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el: `mime-editor/' -> `mime-edit-'.

Fri Feb 21 06:57:11 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-edit.el: based on tm-edit 7.105.

	* semi-setup.el: tm-image.el was renamed to mime-image.el.

	* mime-image.el: Renamed from tm-image.el.

Fri Feb 21 05:57:53 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* semi-setup.el: Renamed from tm-setup.el.

	* mime-setup.el: Setting for GNUS was abolished.

	* mime-setup.el: Variable `mime-setup-use-sc' was abolished.

	* mime-view.el: tm-play.el was renamed to mime-play.el.

	* mime-partial.el: Renamed from tm-partial.el.

	* mime-play.el: Renamed from tm-play.el.

	* mime-view.el: `tm-text' is renamed to `mime-text'.

	* mime-view.el (mime-view-mode): Optional argument `mother-keymap'
 	was renamed to `default-keymap-or-function'; optional argument
 	`default-function' was abolished.

	* mime-text.el: `mime-view-code-converter-alist' ->
 	`mime-text-decoder-alist'.

	* mime-text.el: Renamed from tm-text.el.

Thu Feb 20 09:02:36 1997  Tomohiko Morioka  <tmorioka@mule.etl.go.jp>

	* mime-view.el: `mime/viewer-mode' -> `mime-view-mode'.

	* mime-view.el: Renamed from tm-view.el.

Thu Jul 11 14:57:42 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-file-types): add for patch.

	* mime-edit.el: rearrangement.

Wed Jul 10 12:05:05 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/normalize-body): Use function
 	`encode-mime-charset-region' instead of
 	`mime-charset-encode-region'.

Wed Jul 10 11:51:13 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/normalize-body): fixed.

	* mime-edit.el (mime-editor/define-charset):
	Argument `charset' was changed to
	symbol.
	(mime-editor/choose-charset): Changed to return symbol.
	(mime-editor/normalize-body): charset was changed to symbol.

Wed Jul 10 11:22:55 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/make-charset-default-encoding-alist):
 	New function.
	(mime-editor/charset-default-encoding-alist): Use function
 	`mime-editor/make-charset-default-encoding-alist'.
	(mime-editor/toggle-transfer-level): Use function
 	`mime-editor/make-charset-default-encoding-alist'.

	* mime-edit.el (mime-editor/choose-charset): Use function
 	`detect-mime-charset-region' instead of
 	`mime/find-charset-region'.

Tue Jul  9 13:24:21 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime/editor-mode): Don't toggle.

	(mime-editor/toggle-mode): New function.

Tue Jul  2 14:06:53 1996  Alastair Burt <burt@dfki.uni-kl.de>

	* mime-edit.el: I think the following is the best way to handle
 	tm-edit as a minor mode in XEmacs (at least in 19.14 -- I am not
 	sure if "add-minor-mode" works the same way in earlier versions).
  	By clicking on the mode line you can turn mime/editor-mode on or
 	off.

Thu Jun 27 14:08:17 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/encrypt-pgp-kazu): Use macro
 	`as-binary-process'.

	* mime-edit.el (mime-editor/sign-pgp-kazu): Use macro
 	`as-binary-process'.

Wed Jun 12 05:58:23 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/split-message-sender-alist): setting
 	for `mail-mode' was moved to tm-rmail.el.

Sun Jun  9 06:44:19 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Variable
 	`mime-editor/message-default-sender-alist' was abolished.

Sun Jun  9 06:40:26 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Variable `mime-editor/window-config-alist' was
 	abolished.

Sun Jun  9 06:35:10 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/split-and-send): New implementation.

Mon Jun  3 17:39:10 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor::edit-again): fixed about multipart.

Wed May 29 09:57:53 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/define-charset,
 	mime-editor/set-parameter): Function `mime-set-parameter' was
 	renamed to `mime-editor/set-parameter'.

	* mime-edit.el (mime-set-parameter): New implementation

	(mime-editor/translate-single-part-tag): New function.
	(mime-editor/translate-region): Use function
 	`mime-editor/translate-single-part-tag'.

Tue May 28 15:15:33 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor::edit-again): fixed.

	* mime-edit.el (mime/edit-again): fixed.

	* mime-edit.el (mime-editor::edit-again): modified for new tag
 	rule.

	* mime-edit.el (mime-editor/insert-signature): Use variable
 	`signature-file-name' instead of `signature'.

	* mime-edit.el (mime-editor/multipart-beginning-regexp): Don't
 	require begging new-line.

	(defconst mime-editor/multipart-end-regexp): Don't require begging
 	new-line.

	(mime-editor/find-inmost): modified for new enclosure tag rule.

	(mime-editor/translate-region): modified for new enclosure tag rule.

	(mime-editor/enclose-region): modified for new enclosure tag rule.

Sun May 26 05:04:20 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el: Add `(provide 'tm-edit)'.

	Do `(run-hooks 'tm-edit-load-hook)' if variable
 	`mime-edit-load-hook' is not bound.

Sun May 26 02:10:08 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/insert-binary-buffer): fixed.
	(mime-editor/normalize-body): fixed.

Sat May 25 20:47:32 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/normalize-body): fixed.

	(mime-editor/content-end): Used function `invisible-p' and
 	`next-visible-point'.

Sat May 25 20:05:20 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/insert-binary-buffer): Use function
 	`invisible-region' instead of `mime-flag-region'.
	(mime-editor/normalize-body): Use function `visible-region'
 	instead of `mime-flag-region'.
	(mime-editor/content-end): New implementation.

Sat May 25 16:04:28 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/enquote-region): New command; bound to
 	`C-c C-x q'.

	(mime-editor/menu-list): New item for function
 	`mime-editor/enquote-region'.

Sat May 25 15:52:44 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/process-multipart-1): Use function
 	`string-equal' instead of `string='.

Sat May 25 15:48:33 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/process-multipart-1): fixed about
 	condition of next tag inserting.

Sat May 25 15:36:58 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/enclose-region): fixed for new format.

Sat May 25 15:15:03 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/insert-partial-header): Comment of
 	Mime-Version field was modified.

	* mime-edit.el (mime-editor/insert-tag): Don't insert unnecessary
 	line break.

	* mime-edit.el (mime-editor/version-name): New constant.

	(mime-editor/mime-version-value): Use constant
	`mime-editor/version-name'.

	(mime-editor/insert-partial-header): Use constant
	`mime-editor/version-name'.

Fri May 24 15:16:37 1996  MORIOKA Tomohiko  <morioka@jaist.ac.jp>

	* mime-edit.el (mime-editor/goto-tag): fixed for a tag without
 	line break.
	(mime-editor/normalize-body): fixed for a tag without line break.

	* mime-edit.el (mime-editor/translate-region): fixed for a part
 	starting without line break.

	* mime-edit.el (mime-editor/single-part-tag-regexp): It allows any
 	column.
	(mime-editor/quoted-single-part-tag-regexp): New constant.
	(mime-editor/enquote-region): New function.
	(mime-editor/dequote-region): New function.
	(mime-editor/process-multipart-1): Processing for ``quote''
 	enclosure was added.
	(mime-editor/translate-body): Use function
 	`mime-editor/dequote-region'.

	(mime-editor/mime-version-value): Comment was renamed.

	* mime-edit.el: Renamed from tm-edit.el
07070100000001000081A4000003E80000006400000001627140E500000377000000000000000000000000000000000000002700000000semi-1.14.6+239+gb1c245b81715/Makefile#
# Makefile for SEMI kernel.
#

PACKAGE = semi
API	= 1.14
RELEASE = 6

FLIM_API= 1.14

TAR	= tar
RM	= /bin/rm -f
CP	= /bin/cp -p

EMACS	= emacs
XEMACS	= xemacs
FLAGS   = -batch -q -no-site-file -l SEMI-MK

PREFIX	= NONE
LISPDIR = NONE
PACKAGEDIR = NONE
VERSION_SPECIFIC_LISPDIR = NONE
PACKAGE_LISPDIR = package-user-dir

GOMI	= *.elc

VERSION	= $(API).$(RELEASE)
ARC_DIR_PREFIX = /home/kanji/tomo/public_html/comp/emacsen/lisp
ARC_DIR = $(ARC_DIR_PREFIX)/semi/semi-$(API)-for-flim-$(FLIM_API)


elc:
	$(EMACS) $(FLAGS) -f compile-semi $(PREFIX) $(LISPDIR) \
		$(VERSION_SPECIFIC_LISPDIR) $(PACKAGE_LISPDIR)

install-elc:	elc
	$(EMACS) $(FLAGS) -f install-semi $(PREFIX) $(LISPDIR) \
		$(VERSION_SPECIFIC_LISPDIR) $(PACKAGE_LISPDIR)

install:	install-elc


clean:
	-$(RM) $(GOMI)

release:
	-$(RM) $(ARC_DIR)/$(PACKAGE)-$(VERSION).tar.gz
	mv /tmp/$(PACKAGE)-$(VERSION).tar.gz $(ARC_DIR)
07070100000002000081A4000003E80000006400000001627140E500003EB3000000000000000000000000000000000000002300000000semi-1.14.6+239+gb1c245b81715/NEWSSEMI NEWS --- history of major-changes.
Copyright (C) 1998,1999 Free Software Foundation, Inc.

* Changes in SEMI 1.13

** PGP 5.0i and GnuPG are now supported for PGP/MIME

  You can select the various PGP or GnuPG commands by the user option
`pgg-default-scheme' or `pgg-scheme'. The former is for encrypting and
signing, the latter could be bound for controlling which command is
used to process the incoming PGP armors. Note that Mailcrypt is not
needed anymore. A user interface for editing or viewing has never
changed. Note also that `pgp-function' and `pgp-functions-alist' are
abolished in this version.


** Requires FLIM 1.13 API


** Don't expect raw-buffer

In FLIM 1.13 API, existence of a raw-buffer corresponding to each
entity is not guaranteed.

*** Now acting-method must not expect to run in raw-buffer

Function `mime-play-entity' was changed to permit to run in any buffer
(may be called in preview-buffer).  So each acting-method is called in
any buffer.

*** Don't refer variable `mime-raw-buffer'

Preview-buffer's local variable `mime-raw-buffer' is deleted.  So
don't refer it.

*** Don't refer variable `mime-preview-buffer'

There are no guarantee about existence of a raw-buffer corresponding
to each entity, so don't refer buffer local variables of the
raw-buffer, e.g. `mime-preview-buffer'.


** Function `mime-play-entity'

Function `mime-play-entity' was renamed from `mime-raw-play-entity'
and changed interface.

Current interface is:

    mime-play-entity (entity &optional situation ignored-method)

Please use `situation' if you would like to specify `mode' and
`ignore-examples'.


** Text property `mime-view-entity-{header|body}'

Now mime-view put text property `mime-view-entity-header' and
`mime-view-entity-body' in header and body of each entity.


** Behavior change about `mime-display-header-hook'

Function `mime-display-entity' runs `mime-display-header-hook' before
it inserts "\n".

In addition, now it is cleared that current point means beginning of
header when `mime-display-entity' runs `mime-display-header-hook'.
Therefore header-presentation-method must not change current point.


** New variable `mime-preview-move-scroll'

This variables decides how to scroll in the MIME-View-mode
when mime-preview-move-upper, mime-preview-move-previous,
mime-preview-move-next is called. Those are bound to `u', `p', `n',
respectively.


* Changes in SEMI 1.12

There are no user-visible changes.

** New function `eliminate-top-spaces'

Now mime-edit has it.


* Changes in SEMI 1.11

** New function `mime-edit-decode-message-in-buffer'

Add new function `mime-edit-decode-message-in-buffer'.  Function
`mime-edit-decode-buffer' was abolished.


** Requires FLIM 1.12 API


* Changes in SEMI 1.10

** Abolish variable `mime-temp-directory'

  FLIM 1.11 and SEMI 1.10 use variable `temporary-file-directory'
instead of `mime-temp-directory'.  So environment variable
"MIME_TMP_DIR" and "TM_TMP_DIR" are not effective to specify temporary
directory of FLIM and SEMI.


** Abolish function `mime-text-insert-decoded-body'

  SEMI 1.10 uses function `mime-insert-text-content' of FLIM 1.11 API
instead of `mime-text-insert-decoded-body'.

  Now `mime-view-caesar' does not run `mime-text-decode-hook'.


* Changes in SEMI 1.9

** User option `mime-encoding-list'

  SEMI 1.9 requires FLIM 1.10 API.  In FLIM 1.10 API, variable
`mime-file-encoding-method-alist' was abolished.  If you want to use
non-standard Content-Transfer-Encoding to insert a file into sending
message, please edit new user option `mime-encoding-list' instead of
`mime-file-encoding-method-alist'.


** Constant `mime-user-interface-product'

  Constant `mime-user-interface-version' was renamed to
`mime-user-interface-product'.  Notice that data format is changed
too.

  FLIM 1.10 API provides following macros to access a slot of the new
data format:

     mime-product-name (product)

     mime-product-version (product)

     mime-product-code-name (product)

Please use them to get elements of the constant
`mime-user-interface-product'.


* Changes in SEMI 1.8

** Don't use "file" command to detect content of entity

  Acting-method to detect content of entity was modified not to use
"file" command.

  Variable `mime-file-content-type-alist' was abolished.  Instead of
it, new variable `mime-magic-type-alist' is available to customize.
It is an alist of regexp about magic-number vs. corresponding
media-types.  Each element looks like (REGEXP TYPE SUBTYPE).  REGEXP
is a regular expression to match against the beginning of the content
of entity.  TYPE is symbol to indicate primary type of media-type.
SUBTYPE is symbol to indicate subtype of media-type.


** Abolish external X-Face viewer


** Abolish obsolete utility for *-field-list and *-field-regexp

  Abolish function `tm:set-fields', `tm:add-fields' and
`tm:delete-fields'.


** Change MUA interface of automatic message/partial combining

  Abolish variable `mime-view-partial-message-method-alist'.

  Instead of it, `request-partial-message-method' in acting-situation
is available to specify MUA depended implementation.

  Each element of `mime-view-partial-message-method-alist' were
required to display message at current summary line, and its return
value were ignored.  On the other hand,
`request-partial-message-method' is required to return structure of
message at current summary line.  Format of it is mime-entity.


** User-Agent field

  MIME-Edit inserts User-Agent field instaed of X-Emacs field if
`mime-edit-insert-user-agent-field' is not nil.  Contents of
User-Agent is specified by mime-edit-user-agent-value'.

  X-Emacs field related features were abolished.


* Changes in SEMI 1.7

** Header-presentation-method

  Now MIME-View uses header-presentation-method instead of
header-filter.

  - abolish variable `mime-view-content-header-filter-alist'

  - abolish function `mime-view-cut-header'

  - Rename `mime-view-content-header-filter-hook' to
    `mime-display-header-hook'


** Abolish `mime-view-ignored-field-regexp'

  Now mime-view uses `mime-view-ignored-field-list' directly in
default header-presentation-method.


** Abolish body filter support

  Please use body-presentation-method.


** Methods for MUAs

  - Rename `mime-view-following-method-alist' to
    `mime-preview-following-method-alist'

  - Rename `mime-method-to-combine-message/partial-pieces' to
    `mime-combine-message/partial-pieces-automatically'


* Changes in SEMI 1.6

** Abolish tm-compatible external method support

  Abolish tm-compatible external method support.  Please use mailcap
method instead of it.


** Abolish `mime-edit-signing-type' and `mime-edit-encrypting-type'

  C-c C-m C-s encloses as "pgp-signed" which means PGP/MIME signature.

  C-c C-m C-e encloses as "pgp-encrypted" which means PGP/MIME
encryption.


** New method to detect content of entity

  Now MIME-View can detect content of entity for
application/octet-stream in default setting.

  It uses "file" command to detect.  User can customize
`mime-file-content-type-alist' to specify media-type for output of
"file" command.  It is an alist of "file" output patterns
vs. corresponding media-types.  Each element looks like (REGEXP TYPE
SUBTYPE).  REGEXP is pattern for "file" command output.  TYPE is
symbol to indicate primary type of media-type.  SUBTYPE is symbol to
indicate subtype of media-type.


** New interface to display message

- Function `mime-view-buffer'
- Function `mime-view-display-message'


** Change interface of internal playback method

  Interface of internal playback method was changed to

	(entity situation)

It is as same as interface of body-presentation-method.


** Change interface of `mime-view-entity-button-visible-p'

** Change interface of `mime-view-insert-entity-button'


** `mime-preview-original-major-mode'

  Abolish variable `mime-preview-original-major-mode'.

  Please use function `mime-preview-original-major-mode' instead of
it.


** mime-preview-over-to-{previous|next}-method-alist

  `mime-preview-over-to-{previous|next}-method-alist' were renamed
from `mime-view-over-to-{previous|next}-method-alist'.


* Changes in SEMI 1.5

** mime-w3

  Add inline text/html preview feature using w3.  If
`mime-setup-enable-inline-html' is not nil, semi-setup.el sets up it.


** `pgp-elkins' -> `pgp-mime'

  Rename `pgp-elkins' -> `pgp-mime'.  Variable
`mime-edit-signing-type' and `mime-edit-encrypting-type' does not
allow `pgp-elkins'.


** type-subtype-score

  Now MIME-View chooses one entity to display body in
multipart/alternative.  In this mechanism,
`mime-view-type-subtype-score-alist' is used to specify priority of
each entity.

  Variable `mime-view-type-subtype-score-alist' is alist of
TYPE-SUBTYPE vs. SCORE.  TYPE-SUBTYPE is cons pair (TYPE . SUBTYPE),
symbol TYPE or t.  TYPE and SUBTYPE are symbol.  `t' means default.
SCORE is integer.  Larger number is larger priority.


** text presentation

  Change text presentation mechanism.  In anything older than SEMI
1.4, text presentation mechanism is based on filter model.  However it
has design problem about conversion between byte representation and
text presentation.  So SEMI was changed to use
body-presentation-method to display text entity.  In this purpose, old
text decoding features were abolished and introduces news features
(cf. next section).


** mime-raw-representation-type and mime-raw-representation-type-alist

  Abolish `mime-text-decoder' and `mime-text-decoder-alist' because of
text presentation mechanism change (cf. previous section).  Instead of
it, SEMI introduces variable about representation-type of
mime-raw-buffer.  If it is `binary', mime-raw-buffer is as same as
network representation.  If it is `cooked', mime-raw-buffer is
code-converted.

  `mime-raw-representation-type-alist' is an alist of major-mode
vs. representation-type.  Each element looks like

    (SYMBOL . REPRESENTATION-TYPE).

SYMBOL is major-mode or t.  t means default.

  `mime-raw-representation-type' is a buffer local variable of
mime-raw-buffer.  If it is non-nil, it overrides
`mime-raw-representation-type-alist'.

  In addition, `mime-raw-buffer-coding-system-alist' was abolished.
Because representation-type has enough information.


* Changes in SEMI 1.4

** mailcap

  mailcap was supported to set up 'mime-acting-condition.

  tm-external-method scripts written by born shell were abolished.


** mime-add-condition

  New function to set up 'mime-preview-condition and/or
'mime-acting-condition.


** signature setting in semi-setup.el

  Abolish MUA depended signature setting.

  Setting for mail-mode were moved to mail-mime-setup.el.


* Changes in SEMI 1.3

** mime-acting-condition

  Format of variable 'mime-acting-condition was changed from `atype'
to `condition tree'.  Its format is as same as
'mime-preview-condition.

  If there are two or more conditions are found when matching, menu
pops up to select method to run.  Selected situation will be added to
example database. (cf. mime-acting-situation-examples-file)

** New variables

*** mime-view-find-every-acting-situation

	Find every available acting-situation if non-nil.

*** mime-acting-situation-examples-file

	File name of example about acting-situation demonstrated by
	user.


* Changes in SEMI 1.2

** User setting

*** hooks

  'mime-view-plain-text-preview-hook was renamed to
'mime-preview-text/plain-hook.

*** Variable

  Variable 'mime-view-childrens-header-showing-Content-Type-list was
abolished.  Please use 'mime-preview-condition instead.

*** API about visible-predicates were abolished

  Following functions were abolished:

    mime-view-header-visible-p (entity message-info)

    mime-view-body-visible-p (entity message-info)

    mime-view-entity-separator-visible-p (entity message-info)

Please use 'mime-preview-condition instead.

  Function 'mime-view-entity-button-visible-p is not abolished, but it
is obsoleted.

*** mime-preview-condition

  Following are added as pre-defined keys:

	'childrens-situation	default preview-situation for children
	'message-button		to specify to display message-button
				    nil:	default (invisible)
				    'visible:	visible
				    'invisible:	invisible
	'entity-button		to specify to display entity-button
				    nil:	default (visible)
				    'visible:	visible
				    'invisible:	invisible
	'header			to specify to display header
				    nil:	default (invisible)
				    'visible:	visible
				    'invisible:	invisible

** API

*** Interface for body-filter

  'mime-view-filter-for-* was renamed to 'mime-preview-filter-for-*.


*** mime-text-decode-body

  Function 'mime-decode-text-body was renamed to
'mime-text-decode-body and changed interface.  New interface is
following:

	mime-text-decode-body (SITUATION)

SITUATION is preview-situation.  Content-Transfer-Encoding and
MIME-charset are specified in field of it.


* Changes in SEMI 1.1

** User setting

*** Setting variable about visible body

  'mime-view-visible-media-type-list and
'mime-view-content-filter-alist were abolished.  Please use
'mime-preview-condition instead.

  Notice that 'mime-preview-condition is not list of
media-type/subtype string nor association-list.  It uses new
data-structure `ctree' (condition-tree; it is introduced to replace
`atype').  Function 'ctree-set-calist-strictly and
'ctree-set-calist-with-default may be useful to modify it (`calist'
(condition-alist) is as same as `atype').


*** API about visible-predicates

  Interface of visible-predicates for entity elements were changed.
New interfaces are following:

    mime-view-entity-button-visible-p (entity message-info)

    mime-view-header-visible-p (entity message-info)

    mime-view-body-visible-p (entity message-info)

    mime-view-entity-separator-visible-p (entity message-info)


** API

*** entity representation

  Structure 'mime-entity-info was renamed to 'mime-entity.  So various
functions were renamed too.


*** Interface for entity-button generators

  Interface of entity-button generators was changed.  New interfaces
is following:

    mime-view-insert-entity-button (entity message-info subject)


*** mime-preview-condition and preview-situation

  Conditions about preview generation are unified to
'mime-preview-condition.  Namely other variables, such as
'mime-view-visible-media-type-list, 'mime-view-content-filter-alist,
'mime-view-image-converter-alist were abolished.

  Preview-situation is generated from entity information, running
environment and 'mime-preview-condition.  These elements are checked
to match with each other. (it is similar to acting-situation)

  Format of preview-situation is association-list.  Following key is
pre-defined:

	'type			  media-type
	'subtype		  media-subtype
	'encoding		  content-transfer-encoding
	'major-mode		  major-mode of MUA
	<STRING>		  attribute of Content-Type field.
	'body-presentation-method body-presentation-method

If 'body-presentation-method is 'with-filter, 'body-filter is used to
specify body-filter function.  If 'body-presentation-method is
function, it is called to generate presentation of entity body.

Body-filter function 'mime-view-filter-for-image refers 'image-format.

Setting for message/partial button is specified by
'mime-preview-condition instead of hard-coding.


*** Interface for body-filter

  Interface of body-filter was changed.  New interfaces is following:

    <body-filter> (situation)

Current pre-defined filters are following:

	mime-view-filter-for-text/plain (situation)
	mime-view-filter-for-text/richtext (situation)
	mime-view-filter-for-text/enriched (situation)
	mime-view-filter-for-image (situation) ; if available

'mime-view-filter-for-application/postscript was abolished.


*** Format of mime-acting-condition (acting-situation)

  Format of `mime-acting-condition' were changed.  `type' and
`subtype' are separated and changed to symbol.


*** Renaming

- mime-view-buffer -> mime-preview-buffer


Local variables:
mode: outline
paragraph-separate: "[ 	]*$"
end:
07070100000003000081A4000003E80000006400000001627140E500000416000000000000000000000000000000000000002500000000semi-1.14.6+239+gb1c245b81715/README-*- outline -*-

[README for SEMI-EPG]


* What's SEMI-EPG?

SEMI-EPG is a variant of SEMI.  The remarkable features are that it
uses EasyPG and lexical binding, so Emacs 24.5 and later are
supported.  See README.[en|ja] for details of original SEMI.


* GitHub

Development of SEMI-EPG uses Git.  The latest developing version is
available at the following Git repository:

  % git clone https://github.com/wanderlust/semi.git

Or you can view the SEMI-EPG repository via WWW at:

    https://github.com/wanderlust/semi

We hope you will join the open development.


* Bug reports

If you write bug-reports and/or suggestions for improvement, please
send them to the Wanderlust Mailing List.  See
https://wanderlust.github.io/wl-docs/wl.html#Wanderlust-Mailing-List
for details.

Alternatively, You can also use GitHub.  If you send a pull request,
please embed unindented ChangeLog entries in commit messages like
Emacs's.  See "Commit messages" section of Emacs's CONTRIBUTE
file.

https://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE
07070100000004000081A4000003E80000006400000001627140E500001CD9000000000000000000000000000000000000002800000000semi-1.14.6+239+gb1c245b81715/README.en;; -*- coding: utf-8; -*-
[README for SEMI kernel package (English Version)]

What's SEMI?
============

  SEMI is a library to provide MIME feature for GNU Emacs.  MIME is a
  proposed internet standard for including content and headers other
  than (ASCII) plain text in messages.

	RFC 2045 : Internet Message Bodies
	RFC 2046 : Media Types
	RFC 2047 : Message Header Extensions
	RFC 2048 : MIME Registration Procedures
	RFC 2049 : MIME Conformance

  SEMI has the following features:

	- MIME message viewer   (mime-view-mode) (RFC 2045 .. 2049)
	- MIME message composer (mime-edit-mode) (RFC 2045 .. 2049)

  MIME message viewer and composer also support following features:

	- filename handling by Content-Disposition field (RFC 1806)
	- PGP/MIME security Multiparts (RFC 2015)
	- application/pgp (draft-kazu-pgp-mime-00.txt; obsolete)
	- text/richtext (RFC 1521; obsolete; preview only)
	- text/enriched (RFC 1896)
	- External method configuration by mailcap (RFC 1524)

  Notice that this package does not contain MIME extender for any
  MUAs.  They are released as separated packages.


Required environment
====================

  SEMI supports XEmacs 21.1 or later, and GNU Emacs 20.4 or later.

  SEMI does not support anything older than GNU Emacs 19.28 or XEmacs
  19.14.  In addition, SEMI does not word with byte-indexing Mule
  implementations, such as Mule 1, Mule 2 and GNU Emacs 20.1/20.2.

  SEMI also does not support Emacs 19.29 to 19.34, XEmacs 19.15 or
  XEmacs 20.2, but SEMI may work with them.

  SEMI requires APEL (10.7 or later) and FLIM (1.14.2 or later)
  package.  Please install them before installing it.  APEL package is
  available at:

	http://git.chise.org/elisp/dist/apel/

  and FLIM package is available at:

	http://git.chise.org/elisp/dist/flim/flim-1.14/


Installation
============

(a) run in expanded place

  If you don't want to install other directories, please do only
  following:

	% make

  You can specify the emacs command name, for example

	% make EMACS=xemacs

  If `EMACS=...' is omitted, EMACS=emacs is used.

(b) make install

  If you want to install other directories, please do following:

	% make install

  You can specify the emacs command name, for example

	% make install EMACS=xemacs

  If `EMACS=...' is omitted, EMACS=emacs is used.

  You can specify the prefix of the directory tree for Emacs Lisp
  programs and shell scripts, for example:

	% make install PREFIX=~/

  If `PREFIX=...' is omitted, the prefix of the directory tree of the
  specified emacs command is used (perhaps /usr/local).

  For example, if PREFIX=/usr/local and EMACS 19.34 is specified, it
  will create the following directory tree:

	/usr/local/share/emacs/19.34/site-lisp/  --- emu
	/usr/local/share/emacs/site-lisp/apel/   --- APEL
	/usr/local/share/emacs/site-lisp/flim/   --- FLIM
	/usr/local/share/emacs/site-lisp/semi/   --- SEMI

  You can specify site-lisp directory, for example

	% make install LISPDIR=~/share/emacs/lisp

  If `LISPDIR=...' is omitted, site-lisp directory of the specified
  emacs command is used (perhaps /usr/local/share/emacs/site-lisp or
  /usr/local/lib/xemacs/site-lisp).

  If the emu modules (included in APEL package) have been installed in
  the non-standard directory, you should specify where they will be
  found, for example:

	% make install VERSION_SPECIFIC_LISPDIR=~/elisp

(c) install as a XEmacs package

  If you want to install to XEmacs package directory, please do
  following:

	% make install-package

  You can specify the emacs command name, for example

	% make install-package XEMACS=xemacs-21

  If `XEMACS=...' is omitted, XEMACS=xemacs is used.

  You can specify the package directory, for example:

	% make install PACKAGEDIR=~/.xemacs

  If `PACKAGEDIR=...' is omitted, the first existing package
  directory is used.

  Notice that XEmacs package system requires XEmacs 21.0 or later.

(a,b,c)

  You can specify other optional settings by editing the file
  ${archive}/SEMI-CFG.  Please read ${archive}/README.en and comments
  in ${archive}/SEMI-CFG.


Initialization
==============

(a) load-path

  If you are using Emacs or Mule, please add directory of emu, apel,
  flim and semi 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" "semi"))
  --------------------------------------------------------------------

  If you are using XEmacs, there are no need of setting about
  load-path.

(b) mime-setup

  Please insert the following into your ~/.emacs:

	(load "mime-setup")


Documentation
=============

  To get started, please read ${archive}/README.en.

  RFC's 822, 1524, 1806, 1847, 1896, 2015, 2045, 2046, 2047, 2048 and
  2049 are available via anonymous ftp:

	ftp://ftp.merit.edu/internet/documents/rfc/


Mailing lists
=============

  If you write bug-reports and/or suggestions for improvement, please
  send them to the Emacs-MIME Mailing Lists:

	emacs-mime-en@lists.chise.org	(English)
	emacs-mime-ja@lists.chise.org	(Japanese)

  Via the Emacs-MIME ML, you can report SEMI bugs, obtain the latest
  release of SEMI, and discuss future enhancements to SEMI.  To join
  the Emacs-MIME ML, please see the descriptions of the following
  pages:

      http://lists.chise.org/mailman/listinfo/emacs-mime-en (English)
      http://lists.chise.org/mailman/listinfo/emacs-mime-ja (Japanese)


Git based development
=====================

  The SEMI development sources can be accessed via Git repository.
  You can get the latest SEMI sources by the following:
  
  % git clone http://git.chise.org/git/elisp/semi.git

  Or you can view the SEMI repository via WWW at:

    http://git.chise.org/gitweb/?p=elisp/semi.git

  If you would like to join Git based development, please declare it
  in the Emacs-MIME mailing list at first.

  We hope you will join the open development.


Authors
=======

Original authors

    MORIOKA Tomohiko <morioka@jaist.ac.jp>
	(the author of mime-view and various parts of SEMI)
    UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
	(the author of mime.el of emacs-mime-tools.  mime.el is the
	origin of mime-edit.el of SEMI)

Other authors

    Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
	(a major author of signature.el and a lot of codes)
    MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
	(anonymous ftp codes of mime-play.el)
    OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
	(a major author of mime-partial.el and signature.el)

    Steinar Bang <sb@metis.no>
    Steven L. Baur <steve@miranova.com>
    Kevin Broadey <KevinB@bartley.demon.co.uk>
    Alastair Burt <burt@dfki.uni-kl.de>
    Eric Ding <ericding@San-Jose.ate.slb.com>
    Thierry Emery <Thierry.Emery@aar.alcatel-alsthom.fr>
    Simon Josefsson <jas@pdc.kth.se>
    Jens Lautenbacher <jtl@tkm.physik.uni-karlsruhe.de>
    Carsten Leonhardt <leo@arioch.tng.oche.de>
    Pekka Marjola <marjola@bilbo.ntc.nokia.com>
    Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>
    Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp>
    Alexandre Oliva <oliva@dcc.unicamp.br>
    François Pinard <pinard@iro.umontreal.ca>
    Artur Pioro <artur@flugor.if.uj.edu.pl>
    Dan Rich <drich@morpheus.corp.sgi.com>
        (contribute to evolve mime-image.el with XEmacs)
    Katsumi Yamaoka <yamaoka@jpl.org>
07070100000005000081A4000003E80000006400000001627140E5000023FD000000000000000000000000000000000000002800000000semi-1.14.6+239+gb1c245b81715/README.ja[README for SEMI kernel package (日本語版)]

SEMI ずは?
=========

 SEMI は GNU Emacs に察しお MIME 機胜を提䟛するラむブラリです。MIME は、
 メッセヌゞ内にプレヌンテキスト (ASCII) 以倖の内容やヘッダを含むものに
 関しお提案されたむンタヌネット芏栌です。

        RFC 2045 : Internet Message Bodies
        RFC 2046 : Media Types
        RFC 2047 : Message Header Extensions
        RFC 2048 : MIME Registration Procedures
        RFC 2049 : MIME Conformance

 SEMI は、以䞋の機胜を持っおいたす:

        - MIME message viewer   (mime-view-mode) (RFC 2045 .. 2049)
        - MIME message composer (mime-edit-mode) (RFC 2045 .. 2049)

 MIME message viewer ず MIME message compiser はさらに次の特城を持っお
 いたす:

        - filename handling by Content-Disposition field (RFC 1806)
        - PGP/MIME security Multiparts (RFC 2015)
        - application/pgp (draft-kazu-pgp-mime-00.txt; obsolete)
        - text/richtext (RFC 1521; obsolete; preview only)
        - text/enriched (RFC 1896)
        - External method configuration by mailcap (RFC 1524)

 このパッケヌゞには MUAs に関する MIME 拡匵は含たれおいないこずに泚意
 しおください。これらは、別のパッケヌゞずしお配垃されおいたす。


必芁な環境
==========

 SEMI は、XEmacs 21.1 以降、および GNU Emacs 20.4 以降に察応しおいたす。

 SEMI は、GNU Emacs 19.28 たたは XEmacs 19.14 よりも叀いものに぀いおは、
 䞀切察応しおいたせん。加えお、SEMI は Mule 1, Mule 2 および GNU Emacs
 20.1/20.2 などで実装されおいる byte-indexing では動䜜したせん。

 SEMI は、Emacs 19.29 から 19.34, XEmacs 19.15 たたは XEmacs 20.2 に぀
 いおも察応はしおいたせんが、動くかもしれたせん。

 SEMI は、APEL (10.7 以降) ず FLIM (1.14.2 以降) を必芁ずしたす。 SEMI
 をむンストヌルする前に、これらをむンストヌルしおください。APEL は、以
 䞋で入手可胜です。:

	http://git.chise.org/elisp/dist/apel/

 そしお、FLIM は以䞋で入手可胜です。:

	http://git.chise.org/elisp/dist/flim/flim-1.14/


むンストヌル
============

(a) 展開した堎所で実行する

 もし、他のディレクトリにむンストヌルするこずを望たないならば、以䞋の
 みを実行しおください。:

        % make

 あなたは emacs コマンド名を指定するこずが可胜です。䟋えば、

        % make EMACS=xemacs

 もし、`EMACS=...' が省略されるず、EMACS=emacs が甚いられたす。

(b) make install

 もしあなたが、他のディレクトリにむンストヌルするこずを望むならば、以䞋
 を実行しおください。:

        % make install

 あなたは emacs コマンド名を指定するこずが可胜です。䟋えば、

        % make install EMACS=xemacs

 もし、`EMACS=...' が省略されるず、EMACS=emacs が甚いられたす。

 あなたは、Emacs Lisp プログラムずシェルスクリプトに関するディレクトリ階
 局の接頭語を指定するこずができたす。たずえば、:

        % make install PREFIX=~/

 もし、`PREFIX=...' が省略されるず、指定した emacs コマンドのディレク
 トリ階局の接頭語が䜿甚されたす。(たぶん、/usr/local)

 䟋えば、もし、PREFIX=/usr/local および、EMACS 19.34 が指定されるず、
 以䞋のようなディレクトリ階局が䜜成されるでしょう。:

        /usr/local/share/emacs/19.34/site-lisp/  --- emu
        /usr/local/share/emacs/site-lisp/apel/   --- APEL
        /usr/local/share/emacs/site-lisp/flim/   --- FLIM
        /usr/local/share/emacs/site-lisp/semi/   --- SEMI

 あなたは、site-lisp のディレクトリを指定するこずができたす。䟋えば、

        % make install LISPDIR=~/share/emacs/lisp

 もし、`LISPDIR=...' が省略されるず、指定した emacs コマンドの
 site-lisp ディレクトリが䜿甚されたす(たぶん、
 /usr/local/share/emacs/site-lisp たたは
 /usr/local/lib/xemacs/site-lisp)。

 もし、emu モゞュヌル (APEL に含たれおいる)が䞀般的ではないディレクト
 リにむンストヌルされおいる堎合には、あなたは、これらがどこで芋付けら
 れるか指定する必芁がありたす。:

        % make install VERSION_SPECIFIC_LISPDIR=~/elisp

(c) XEmacs package ずしおのむンストヌル

 もしあなたが、XEmacs package のディレクトリにむンストヌルするこずを望
 むならば、以䞋を実行しおください。:

        % make install-package

 あなたは、emacs command の名前を指定するこずができたす。たずえば、:

        % make install-package XEMACS=xemacs-21

 もし、`XEMACS=...' が省略されるず、XEMACS=xemacs が甚いられたす。

 あなたは、package のディレクトリを指定するこずができたす。たずえば、:

        % make install PACKAGEDIR=~/.xemacs

 もし、`PACKAGEDIR=...' が省略されるず、最初に存圚する package のディ
 レクトリが䜿甚されたす。

 XEmacs package システムは、XEmacs 21.0 以降を必芁ずするこずに泚意しおく
 ださい。

(a,b,c)

 あなたは、${archive}/SEMI-CFG ずいうファむルを曞き換えるこずにより、
 他のオプションの蚭定を指定するこずができたす。${archive}/README.en ず
 ${archive}/SEMI-CFG のコメントを読んでください。


初期化
======

(a) load-path

 あなたが XEmacs 21.1 以降あるいは GNU Emacs 20.4 以降を䜿甚しおいるな
 ら、load-path に関しお必芁な蚭定はありたせん。

(b) mime-setup

 あなたの ~/.emacs に以䞋の蚘述を远加しおください。:

        (load "mime-setup")


付属資料
========

 SEMI を䜿い始めるために、${archive}/README.en を読んでください。

 RFC 822, 1524, 1806, 1847, 1896, 2015, 2045, 2046, 2047, 2048 および
 2049 は anonymous ftp を経由しお入手可胜です。:

        ftp://ftp.merit.edu/internet/documents/rfc/


メヌリングリスト
================

 もし、あなたが、バグレポヌトおよび/たたは改良のための提案を曞く堎合には、
 それらを Emacs-MIME メヌリングリストに送っおください。

        emacs-mime-en@lists.chise.org  (英語)
        emacs-mime-ja@lists.chise.org  (日本語)

 Emacs-MIME ML を通しお、SEMI のバグを報告したり、SEMI の最新のリリヌ
 スに関する情報を入手したり、SEMI の将来の拡匵に぀いお議論するこずなど
 ができたす。Emacs-MIME ML に加入したい方は、以䞋の頁の蚘述を芋お賌読
 手続きを行っおください

      http://lists.chise.org/mailman/listinfo/emacs-mime-ja 日本語
      http://lists.chise.org/mailman/listinfo/emacs-mime-en 英語


Git に基づいた開発
==================

 SEMI の開発には Git を甚いおおり、次のような操䜜により SEMI の最新の
 ゜ヌスを取埗するこずができたす。

   % git clone http://git.chise.org/git/elisp/semi.git

 この SEMI のリポゞトリヌは WWW 経由でも閲芧するこずができたす

    http://git.chise.org/gitweb/?p=elisp/semi.git

 Git に基づいた開発に参加したいずきは、たず Emacs-MIME メヌリングリス
 トにおその旚を宣蚀しおください。

 我々は倚くの方がこの開かれた開発に参加しおくださるこずを望んでいたす。


䜜者
====

元の䜜者

    MORIOKA Tomohiko <morioka@jaist.ac.jp>
        (SEMI のいろいろな郚分ず mime-view の䜜者)
    UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
        (emacs-mime-tools の mime.el の䜜者。mime.el は SEMI の
        meme-edit.el の原型です)

他の䜜者

    Shuhei KOBAYASHI  <shuhei-k@jaist.ac.jp>
        (たくさんのコヌドず signature.el の䞻芁な䜜者)
    MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
        (mime-play.el の anonymous ftp コヌド)
    OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
        (mime-partial.el ず signature.el の䞻芁な䜜者)

    Steinar Bang <sb@metis.no>
    Steven L. Baur <steve@miranova.com>
    Kevin Broadey <KevinB@bartley.demon.co.uk>
    Alastair Burt <burt@dfki.uni-kl.de>
    Eric Ding <ericding@San-Jose.ate.slb.com>
    Thierry Emery <Thierry.Emery@aar.alcatel-alsthom.fr>
    Simon Josefsson <jas@pdc.kth.se>
    Jens Lautenbacher <jtl@tkm.physik.uni-karlsruhe.de>
    Carsten Leonhardt <leo@arioch.tng.oche.de>
    Pekka Marjola <marjola@bilbo.ntc.nokia.com>
    Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>
    Kazuhiro Ohta <ohta@ele.cst.nihon-u.ac.jp>
    Alexandre Oliva <oliva@dcc.unicamp.br>
    François Pinard <pinard@iro.umontreal.ca>
    Artur Pioro <artur@flugor.if.uj.edu.pl>
    Dan Rich <drich@morpheus.corp.sgi.com>
        (XEmacs ず共に mime-image.el を発展させるために寄䞎)
    Katsumi Yamaoka <yamaoka@jpl.org>
07070100000006000081A4000003E80000006400000001627140E500000DD4000000000000000000000000000000000000002700000000semi-1.14.6+239+gb1c245b81715/SEMI-CFG;;; -*-Emacs-Lisp-*-

;; SEMI-CFG: installation setting about SEMI.

;;; Code:

(defvar default-load-path load-path)

(add-to-list 'load-path
	     (expand-file-name "../../site-lisp/apel" data-directory))
(add-to-list 'load-path
	     (expand-file-name "." data-directory))

(if (boundp 'LISPDIR)
    (progn
      (add-to-list 'default-load-path LISPDIR)
      (add-to-list 'load-path LISPDIR)
      (add-to-list 'load-path (expand-file-name "emu" LISPDIR))
      (add-to-list 'load-path (expand-file-name "apel" LISPDIR))
      ))

(defvar VERSION_SPECIFIC_LISPDIR nil)

(if VERSION_SPECIFIC_LISPDIR
    (add-to-list 'load-path VERSION_SPECIFIC_LISPDIR))

(if (boundp 'PACKAGE_LISPDIR)
    (let ((default-directory PACKAGE_LISPDIR))
      (normal-top-level-add-subdirs-to-load-path)))

(condition-case nil
    (require 'install)
  (error (error "Please install APEL 8.7 or later.")))

(add-path "bitmap-mule")
(add-path "flim")

(add-to-list 'load-path (expand-file-name "."))

(or (module-installed-p 'calist)
    (error "Please install APEL 8.7 or later."))
(or (module-installed-p 'mime)
    (error "Please install FLIM 1.6.0 or later."))
(if (module-installed-p 'tm-view)
    (message "Please remove tm from load-path."))


;;; @ Please specify optional package directory if you use them.
;;;

;; It is only necessary to use `add-path' if these packages are not
;; already on the standard load-path of Emacs.

;; Function `get-latest-path' detect latest version of such package
;; under load-path directories. If you want to use a version of a
;; package instead of latest version, please specify by argument of
;; function `add-path'.

;; Function `add-path' finds path under load-path directories. If a
;; package does not exist in load-path, please specify by absolutely
;; (`~/' is available), for example
;;	(add-path "~/lib/elisp/bbdb")
;; or
;;	(add-path "/opt/share/xmule/site-lisp/bbdb")


;;; @@ Please specify BBDB path.
;;;

(let ((path (get-latest-path "bbdb" 'all-paths)))
  (if path
      (progn
	(add-path path)
	(add-path (expand-file-name "lisp" path)) ; run-in-place installation
	)))

;; Or please specify path.
;; (add-path "bbdb-1.50" 'all-paths)


;;;
;;; @@ Please specify Emacs/W3 path.
;;;

(let ((path (get-latest-path "w3" 'all-paths)))
  (if path
      (progn
	(add-path path)
	(add-path (expand-file-name "lisp" path)) ; run-in-place installation
	)))

;; Or please specify path.
;; (add-path "w3-4.0pre.20" 'all-paths)


;;;
;;; @@ Please specify CUSTOM path.
;;;

(add-latest-path "custom")


;;; @ Please specify prefix of install directory.
;;;

;; Please specify install path prefix.
;; If it is omitted, shared directory (maybe /usr/local is used).
(defvar PREFIX install-prefix)
;;(setq PREFIX "~/")

;; Please specify emu prefix [optional]
(setq EMU_PREFIX
      (if (string-match "XEmacs" emacs-version)
	  "emu"
	""))

;; Please specify SEMI prefix [optional]
(setq SEMI_PREFIX "semi")


;;; @ executables
;;;

;; Please specify binary path. (for external method scripts)
(setq METHOD_DIR (expand-file-name "share/semi" PREFIX))




;;; @ optional settings
;;;

;; It is generated by automatically. Please set variable `PREFIX'.
;; If you don't like default directory tree, please set it.
(defvar LISPDIR (install-detect-elisp-directory PREFIX))
;; (setq install-default-elisp-directory "~/lib/emacs/lisp")

(setq SEMI_KERNEL_DIR	(expand-file-name SEMI_PREFIX	LISPDIR))
(setq SETUP_FILE_DIR	SEMI_KERNEL_DIR)

(defvar PACKAGEDIR (install-get-default-package-directory))

;;; SEMI-CFG ends here
07070100000007000081A4000003E80000006400000001627140E5000003F4000000000000000000000000000000000000002700000000semi-1.14.6+239+gb1c245b81715/SEMI-ELS;;; -*-Emacs-Lisp-*-

;; SEMI-ELS: list of SEMI modules to install

;;; Code:

(setq semi-modules-to-compile
      '(signature
	mime-pgp mime-tnef
	semi-def mime-view mime-play mime-partial
	mime-edit mime-signature
	semi-setup mail-mime-setup))

(setq semi-modules-not-to-compile nil)

(mapcar (function
	 (lambda (cell)
	   (let ((c-module (car cell))
		 (i-modules (cdr cell))
		 )
	     (if (module-installed-p c-module)
		 (setq semi-modules-to-compile
		       (nconc semi-modules-to-compile i-modules))
	       (setq semi-modules-not-to-compile
		     (nconc semi-modules-not-to-compile i-modules))
	       )
	     )))
	'((w3			mime-w3)
	  (bbdb-vcard-vcard21	mime-vcard)
	  (shr			mime-shr)
	  ))

(setq semi-modules-to-compile
      (nconc semi-modules-to-compile '(mime-image)))

(when (eq system-type 'darwin)
  (setq semi-modules-to-compile
	(nconc semi-modules-to-compile '(mime-mac))))

(setq semi-modules (append semi-modules-to-compile
			   semi-modules-not-to-compile))

;;; SEMI-ELS ends here
07070100000008000081A4000003E80000006400000001627140E5000007E6000000000000000000000000000000000000002600000000semi-1.14.6+239+gb1c245b81715/SEMI-MK;;; -*-Emacs-Lisp-*-

;; SEMI-MK: installer for SEMI.

;;; Code:

(defun config-semi ()
  (let (prefix exec-prefix lisp-dir version-specific-lisp-dir)
    (and (setq prefix (car command-line-args-left))
	 (or (string-equal "NONE" 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)
	     ))
    (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)))
	     ))
    (setq command-line-args-left (cdr command-line-args-left))
    (and (setq package-lisp-dir (car command-line-args-left))
	 (or (string-equal "NONE" package-lisp-dir)
	     (progn
	       (defvar PACKAGE_LISPDIR
		 (if (boundp (intern package-lisp-dir))
		     (symbol-value (intern package-lisp-dir))
		   package-lisp-dir))
	       (princ (format "PACKAGE_LISPDIR=%s\n"
			      PACKAGE_LISPDIR)))))
    (setq command-line-args-left (cdr command-line-args-left)))
  (load-file "SEMI-CFG")
  (load-file "SEMI-ELS")
  (princ (format "PREFIX=%s
LISPDIR=%s\n" PREFIX LISPDIR))
  )

(defun directory= (dir1 dir2)
  (string= (file-name-as-directory dir1)(file-name-as-directory dir2))
  )

(defun compile-semi ()
  ;; to avoid to read situation-examples-file at compile time.
  (setq mime-situation-examples-file nil)
  (config-semi)
  (print load-path)
  (compile-elisp-modules semi-modules-to-compile ".")
  (compile-elisp-module  'mime-setup		".")
  )

(defun install-semi ()
  (config-semi)
  (princ (format "%s\n" emacs-version))
  (install-elisp-modules semi-modules	 "."	SEMI_KERNEL_DIR)
  (install-elisp-modules '(mime-setup)	 "."	SETUP_FILE_DIR)
  )

;;; SEMI-MK ends here
07070100000009000081A4000003E80000006400000001627140E5000002F3000000000000000000000000000000000000002D00000000semi-1.14.6+239+gb1c245b81715/SEMI-naming.ol* MIME-View

** mime-entity-*

  mime-entity related functions.


** mime-raw-*

  mime-raw-buffer related features.

    - buffer local variables in mime-raw-buffer

    - functions expected running in mime-raw-buffer


** mime-preview-*

  mime-preview-buffer related features.

    - buffer local variables in mime-preview-buffer

    - functions expected running in mime-preview-buffer


** mime-display-*

    - functions to make presentation in mime-preview-buffer from
      element(s) of mime-raw-buffer


** mime-view-*

  MIME-View related general features.

    - variables or functions related with both mime-raw-buffer and
      mime-preview-buffer

    - customizable variables

    - view something and enter another mode in another buffer
0707010000000A000081A4000003E80000006400000001627140E5000006E3000000000000000000000000000000000000002300000000semi-1.14.6+239+gb1c245b81715/TODO[TODO]
======

* MIME-View

** dynamic configuration for 'mime-preview-condition

** Don't expect raw-buffer

** lazy generating of situations from mime-entity information


* MIME-Edit

** WYSIWYG editing support

** Use MIME-Preview like tag and display

** Redesign to use two buffers for one message

  MIME-View is based on "Multiple Representation Space (layer) Model".
In this model, network representation and its presentation are
distinguished.  Thus MIME-View uses two buffers for one message,
'mime-raw-buffer (for network representation) and
'mime-preview-buffer.  MIME-View manages them based on information of
entities.  According to experience of MIME-View, this model is good to
treat complex structured data, such as MIME.

  MIME-Edit was designed to use one buffer for one message.  So it is
hard to edit like WYSIWYG style.  Format of tag is limited by
translation.  Content of forwarded message is unreadable.  It is
better to introduce "Multiple Representation Space Model" to resolve
these problems.

** Check available MIME-charset

    MIME-charset $B0J30$,@8@.$5$l$k>l9g$N=hM}$r;XDj$G$-$k$h$&$K$9$k!#(B

    For example:

        (a) translate problematic characters to similar representation
	(b) display warning message
	    (e.g. "`x-ctext' is generated.  Do you send it? (yes/no)")
	(c) stop sending

** Don't use buffer-local variables

  Don't use buffer-local variables to control behavior about
translating to network representation, such as 'mime-transfer-level,
'mime-transfer-level-string,
'mime-edit-charset-default-encoding-alist, 'mime-edit-pgp-processing.
Because they have problem with Semi-gnus.


* Etc.

** Write manual



[Known Bugs]
============

* MIME-Edit

** Content-ID is mandatory for message/external-body
0707010000000B000081A4000003E80000006400000001627140E500002002000000000000000000000000000000000000002600000000semi-1.14.6+239+gb1c245b81715/VERSION[SEMI Version names]

0.72	--------		--------
0.75	--------		--------
0.83	--------		--------
0.87	--------		--------
0.88	--------		--------
0.91	--------		--------
0.92	--------		--------

;;-------------------------------------------------------------------------
;;	Hokuriku Railway	北陞鉄道
;;	Ishikawa Line		石川線
;;-------------------------------------------------------------------------
0.96	Kaga-Ichinomiya		加賀䞀の宮	; 癜山比咩神瀟
0.97	Naka-Tsurugi		䞭鶎来
0.112	Tsurugi			鶎来		; <=> じゃいバス
0.115	Hinomiko		日埡子
0.115.1	Oyanagi			小柳
0.115.2	Inokuchi		井口
0.116	Dōhōji			道法寺
0.118	Sodani			曜谷
0.118.1	Shijima			四十䞇
0.118.2	Otomaru			乙䞞
1.0.0	NukajÅ«taku-mae		額䜏宅前
1.0.1	Magae			銬替
1.0.2	Nonoichi-Kōdaimae	野々垂工倧前
1.1.0	Nonoichi		野々垂
1.1.1	Oshino			抌野
1.1.2	Shin-Nishikanazawa	新西金沢	; <=> JR 西金沢
1.2.0	Nishiizumi		西泉
1.2.1	Nomachi			野町

;;-------------------------------------------------------------------------
;;	West Japan Railway	西日本旅客鉄道	http://www.westjr.co.jp/
;;	Hokuriku Line		北陞本線
;;-------------------------------------------------------------------------
1.2.2	Naoetsu			盎江接		; = JR 信越本線
1.2.3	Tanihama		谷浜
1.2.4	Arimagawa		有間川
1.3.0	Nadachi			名立
1.3.1	Tsutsuishi		筒石
1.3.2	Nō			胜生
1.3.3	Uramoto			浊本
1.3.4	Kajiyashiki		梶屋敷
1.4.0	Itoigawa		糞魚川		; = JR 倧糞線
1.4.1	Ōmi			青海
1.4.2	Oyashirazu		芪䞍知
1.4.3	Ichiburi		垂振
1.4.4	EcchÅ«-Miyazaki		越䞭宮厎
1.4.5	Tomari			泊
1.4.6	Nyūzen			入善
1.5.0	Nishi-Nyūzen		西入善
1.5.1	Ikuji			生地
1.5.2	Kurobe			黒郚
1.5.3	Uozu			魚接		; <=> 富山地方鉄道
1.5.4	Higashi-Namerikawa	東滑川
1.6.0	Namerikawa		滑川		; <=> 富山地方鉄道
1.7.0	Mizuhashi		æ°Žæ©‹
1.7.1	Higashi-Toyama		東富山
1.8.0	Toyama			富山		; = JR 高山本線、富山枯線
1.8.1	Kureha			呉矜
1.8.2	Kosugi			小杉
1.8.3	EcchÅ«-Daimon		越䞭倧門
1.8.4	Takaoka			高岡		; = JR 氷芋線、城端線
1.8.5	Nishi-Takaoka		西高岡
1.8.6	Fukuoka			犏岡
1.9.0	Isurugi			石動
1.9.1	Kurikara		倶利䌜矅
1.10.0	Tsubata			接幡
1.10.1	Morimoto		森本
1.10.2	Higashi-Kanazawa	東金沢
1.11.0	Kanazawa		金沢		; <=> 北陞鉄道 北鉄金沢
1.12.0	Nishi-Kanazawa		西金沢		; <=> 北陞鉄道 新西金沢
1.12.1	[JR] Nonoichi		[JR] 野々垂
1.13.0	Mattō			束任
1.13.1	Kaga-Kasama		加賀笠間
1.13.2	Mikawa			矎川
1.13.3	Komaiko			小舞子
1.13.4	Terai			寺井
1.13.5	Meihō			明峰
1.13.6	Komatsu			小束
1.13.7	Awazu			粟接
1.14.0	Iburihashi		動橋
1.14.1	Kaga-Onsen		加賀枩泉
1.14.2	Daishōji		倧聖寺
1.14.3	Ushinoya		牛ノ谷
1.14.4	Hosorogi		现呂朚
1.14.5	Awara-Onsen		芊原枩泉
1.14.6	Maruoka			䞞岡
1.14.7	Harue			春江
-------	Morita			森田
-------	Fukui			犏井
:	:			:
-------	Tsuruga			æ•Šè³€		; = JR 小浜線
-------	Shin-Hikida		新疋田
-------	Ōmi-Shiotsu		近江塩接	; = JR 湖西線
-------	Yogo			䜙呉
-------	Kinomoto		朚ノ本
-------	Takatsuki		高月
-------	Kawake			河毛
-------	Torahime		虎姫
-------	Nagahama		長浜
-------	Tamura			田村
-------	Sakata			坂田
	(Maibara)		(米原)		; = JR 東海道本線


[WEMI version names]

;;-------------------------------------------------------------------------
;;	East Japan Railway	東日本旅客鉄道	http://www.jreast.co.jp/
;;	Tōkaidō Line		東海道本線
;;-------------------------------------------------------------------------
1.2.0	Tōkyō			東京
1.2.1	Shinbashi		新橋	; = JR 山手線、暪須賀線
1.2.2	Shinagawa		品川	; = JR 山手線、暪須賀線
1.2.3	Kawasaki		川厎	; = JR 南歊線
1.2.4	Yokohama		暪浜	; = JR 京浜東北線・根岞線、暪須賀線
1.3.0	Totsuka			戞塚	; = JR 暪須賀線
1.3.1	Ōfuna			倧船	; = JR 根岞線、暪須賀線
1.4.0	Fujisawa		藀沢	; <=> 小田急電鉄 江ノ島線、江ノ島電鉄
1.4.1	Tsujidō			蟻堂	; 「蟻」= J90@B-4454:128b
1.4.2	Chigasaki		茅ヶ厎	; = JR 盞暡線
1.4.3	Hiratsuka		平塚
1.4.4	Ōiso			倧磯
1.4.5	Ninomiya		二宮
1.4.6	Kōzu			囜府接	; = JR 埡殿堎線
1.5.0	Kamonomiya		鎚宮
1.5.1	Odawara			小田原	; <=> 小田急、箱根登山鉄道、
					;     䌊豆箱根鉄道
1.5.2	Hayakawa		早川
1.5.3	Nebukawa		根府川
1.5.4	Manazuru		真鶎
1.6.0	Yugawara		湯河原
1.7.0	Atami			熱海	; = JR 䌊東線
;;-------------------------------------------------------------------------
;;	Central Japan Railway	東海旅客鉄道
;;-------------------------------------------------------------------------
1.7.1	Kan'nami		凜南
1.8.0	Mishima			䞉島	; = 䌊豆箱根鉄道
1.8.1	Numazu			沌接	; = JR 埡殿堎線
1.8.2	Katahama		片浜
1.8.4	Hara			原
1.8.5	Higashi-Tagonoura	東田子ノ浊
1.8.6	Yoshiwara		吉原	; = 岳南鉄道
1.9.0	Fuji			富士	; = JR 身延線
1.9.1	Fujikawa		富士川
1.10.0	Shin-Kambara		新蒲原
1.10.1	Kambara			蒲原
1.10.2	Yui			由比
1.11.0	Okitsu			興接
1.12.0	Shimizu			æž…æ°Ž
1.12.1	Kusanagi		草薙
1.13.0	Shizuoka		静岡
1.13.1	Abekawa			安倍川
1.13.2	Mochimune		甚宗
1.13.3	Yaizu			焌接
1.13.4	Nishi-Yaizu		西焌接
1.13.5	Fijieda			藀枝
1.13.6	Rokugō			六合
1.13.7	Shimada			島田
1.14.0	Kanaya			金谷	; = 倧井川鉄道
------	Kikugawa		菊川
------	Kakegawa		掛川	; = 倩竜浜名湖鉄道
------	Fukuroi			袋井
------	Iwata			磐田
------	Toyodachō		豊田町
------	TenryÅ«gawa		倩竜川
------	Hamamatsu		浜束	; = 遠州鉄道
------	Takatsuka		高塚
------	Maisaka			舞阪
------	Bentenjima		匁倩島
------	Araimachi		新居町
------	Wasizu			鷲接
------	Shinjohara		新所原	; = 倩竜浜名湖鉄道
------	Futagawa		二河
------	Toyohashi		豊橋	; = JR 飯田線
:	:			:
------	Kanayama		金山	; =JR 䞭倮本線
------	Otōbashi		å°Ÿé ­æ©‹
------	Nagoya			名叀屋	; = JR 関西本線・䞭倮本線
:	:			:
------	Gifu			岐阜	; = JR 高山本線
:	:			:
------	Samegai			醒ヶ井
;;-------------------------------------------------------------------------
;;	West Japan Railway	西日本旅客鉄道	http://www.westjr.co.jp/
;;-------------------------------------------------------------------------
------	Maibara			米原	; = JR 北陞本線
:	:			:
------	Kusatsu			草接	; = JR 草接線
:	:			:
------	Yamashina		山科	; = JR 湖西線
------	Kyōto			京郜	; = JR 奈良線・山陰本線
					; <=> 近鉄 京郜線、京郜垂亀通局 烏䞞線
:	:			:
------	Ōsaka			倧阪	; = JR 倧阪環状線 <=> JR 東西線 北新地
					;   <=> 倧阪垂亀通局、阪神、阪急 梅田
:	:			:
------	Kōbe			神戞	; = JR 山陜本線


[REMI version names]

;;-------------------------------------------------------------------------
;;	West Japan Railway	西日本旅客鉄道	http://www.westjr.co.jp/
;;	Himi Line		氷芋線
;;-------------------------------------------------------------------------
1.4.0	Himi			氷芋
1.5.0	Shimao			島尟
1.6.0	Amaharashi		雚晎
1.8.0	EcchÅ«-Kokubu		越䞭囜分
1.8.1	Fushiki			䌏朚	; <=> りラゞオスットック航路
1.8.2	Nōmachi			胜町
1.8.3	EcchÅ«-Nakagawa		越䞭䞭川
1.8.4	Takaoka			高岡	; = JR 北陞本線、城端線

;;-------------------------------------------------------------------------
;;	Hokuetsu Express	北越急行
;;		http://www.tiara.or.jp/~tokamaci/hokuhoku/hokuhoku.html
;;	Hokuhoku Line		ほくほく線
;;-------------------------------------------------------------------------
1.13.0	Saigata			犀期	; = JR 信越本線
1.13.1	Kubiki			くびき
1.13.2	Ōike-Ikoinomori		倧池いこいの森
1.14.0	Uragawara		うらがわら
1.14.1	Mushigawaōsugi		虫川倧杉
1.14.2	Hokuhoku-Ōshima		ほくほく倧島
1.14.3	Matsudai		た぀だい


[etc.]

;;-------------------------------------------------------------------------
;;	West Japan Railway	西日本旅客鉄道	http://www.westjr.co.jp/
;;	Kosei Line	 	湖西線
;;-------------------------------------------------------------------------
-------	(Ōmi-Shiotsu)		(近江塩接)	; = JR 北陞本線
:	:			:
-------	Nishi-Ōtsu		西倧接
	(Yamashina)		(山科)	; = JR 東海道本線
0707010000000C000081A4000003E80000006400000001627140E5000001CF000000000000000000000000000000000000002500000000semi-1.14.6+239+gb1c245b81715/ftp.in--<<alternative>>-{

  It is available from

    http://kanji.zinbun.kyoto-u.ac.jp/~tomo/lemi/dist/semi/semi-API-for-flim-FLIM_API/

--[[message/external-body; access-type=URL;
	URL*0="http://";
	URL*1="kanji.zinbun.kyoto-u.ac.jp/~tomo/";
	URL*2="lemi/dist/";
	URL*3="semi/semi-API-for-flim-FLIM_API/";
	URL*4="PACKAGE-VERSION.tar.gz"]]
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="PACKAGE-VERSION.tar.gz"
--}-<<alternative>>
0707010000000D000081A4000003E80000006400000001627140E500000748000000000000000000000000000000000000003100000000semi-1.14.6+239+gb1c245b81715/mail-mime-setup.el;;; mail-mime-setup.el --- setup file for mail-mode.  -*- lexical-binding: t -*-

;; Copyright (C) 1994,1995,1996,1997,1998,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: mail-mode, MIME, multimedia, multilingual, encoded-word

;; This file is part of SEMI (Setting for Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'semi-setup)
(require 'alist)


(autoload 'turn-on-mime-edit "mime-edit"
  "Unconditionally turn on MIME-Edit minor mode." t)

;; (autoload 'eword-decode-header "eword-decode"
;;   "Decode MIME encoded-words in header fields." t)


;;; @ for mail-mode, RMAIL and VM
;;;

;; (add-hook 'mail-setup-hook 'eword-decode-header)
(add-hook 'mail-setup-hook 'turn-on-mime-edit 'append)
(add-hook 'mail-send-hook  'mime-edit-maybe-translate)
(set-alist 'mime-edit-split-message-sender-alist
           'mail-mode (lambda ()
                        (interactive)
                        (funcall send-mail-function)))


;;; @ for signature
;;;

(if mime-setup-use-signature
    (setq mail-signature nil))


;;; @ end
;;;

(provide 'mail-mime-setup)

;;; mail-mime-setup.el ends here
0707010000000E000081A4000003E80000006400000001627140E500019624000000000000000000000000000000000000002B00000000semi-1.14.6+239+gb1c245b81715/mime-edit.el;; -*- mode: emacs-lisp; coding: utf-8; lexical-binding: t -*-
;;; mime-edit.el --- Simple MIME Composer for GNU Emacs

;; Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,03
;;   Free Software Foundation, Inc.

;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
;;	MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
;;	Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
;; Created: 1994/08/21 renamed from mime.el
;;	Renamed: 1997/2/21 from tm-edit.el
;; Keywords: MIME, multimedia, multilingual, mail, news

;; This file is part of SEMI (Sophisticated Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:

;; This is an Emacs minor mode for editing Internet multimedia
;; messages formatted in MIME (RFC 2045, 2046, 2047, 2048 and 2049).
;; All messages in this mode are composed in the tagged MIME format,
;; that are described in the following examples.  The messages
;; composed in the tagged MIME format are automatically translated
;; into a MIME compliant message when exiting the mode.

;; Mule (multilingual feature of Emacs 20 and multilingual extension
;; for XEmacs 20) has a capability of handling multilingual text in
;; limited ISO-2022 manner that is based on early experiences in
;; Japanese Internet community and resulted in RFC 1468 (ISO-2022-JP
;; charset for MIME).  In order to enable multilingual capability in
;; single text message in MIME, charset of multilingual text written
;; in Mule is declared as either `ISO-2022-JP-2' [RFC 1554].  Mule is
;; required for reading the such messages.

;; This MIME composer can work with Mail mode, mh-e letter Mode, and
;; News mode.  First of all, you need the following autoload
;; definition to load mime-edit-mode automatically:
;;
;; (autoload 'turn-on-mime-edit "mime-edit"
;;           "Minor mode for editing MIME message." t)
;;
;; In case of Mail mode (includes VM mode), you need the following
;; hook definition:
;;
;; (add-hook 'mail-mode-hook 'turn-on-mime-edit)
;; (add-hook 'mail-send-hook 'mime-edit-maybe-translate)
;;
;; In case of MH-E, you need the following hook definition:
;;
;; (add-hook 'mh-letter-mode-hook
;;           (function
;;            (lambda ()
;;              (turn-on-mime-edit)
;;              (make-local-variable 'mail-header-separator)
;;              (setq mail-header-separator "--------")
;;              ))))
;; (add-hook 'mh-before-send-letter-hook 'mime-edit-maybe-translate)
;;
;; In case of News mode, you need the following hook definition:
;;
;; (add-hook 'news-reply-mode-hook 'turn-on-mime-edit)
;; (add-hook 'news-inews-hook 'mime-edit-maybe-translate)
;;
;; In case of Emacs 19, it is possible to emphasize the message tags
;; using font-lock mode as follows:
;;
;; (add-hook 'mime-edit-mode-hook
;;           (function
;;            (lambda ()
;;              (font-lock-mode 1)
;;              (setq font-lock-keywords (list mime-edit-tag-regexp))
;;              ))))

;; The message tag looks like:
;;
;;	--[[TYPE/SUBTYPE;PARAMETERS][ENCODING]]
;;
;; The tagged MIME message examples:
;;
;; This is a conventional plain text.  It should be translated into
;; text/plain.
;;
;;--[[text/plain]]
;; This is also a plain text.  But, it is explicitly specified as is.
;;--[[text/plain; charset=ISO-8859-1]]
;; This is also a plain text.  But charset is specified as iso-8859-1.
;;
;; ¡Hola!  Buenos días.  ¿Cómo está usted?
;;--[[text/enriched]]
;; <center>This is a richtext.</center>
;;
;;--[[image/gif][base64]]^M...image encoded in base64 comes here...
;;
;;--[[audio/basic][base64]]^M...audio encoded in base64 comes here...

;;; Code:

(require 'mail-utils)
(require 'sendmail)
(require 'alist)
(require 'pccl)
(require 'invisible)
(require 'mel)
(require 'mime-view)
(require 'epa)

(autoload 'eword-encode-string "eword-encode")
(autoload 'eword-decode-and-unfold-unstructured-field-body "eword-decode")

;;; @ version
;;;

(eval-and-compile
  (defconst mime-edit-version
    (concat
     (mime-product-name mime-user-interface-product) " "
     (mapconcat #'number-to-string
		(mime-product-version mime-user-interface-product) ".")
     " - \"" (mime-product-code-name mime-user-interface-product) "\"")))


;;; @ variables
;;;

(defgroup mime-edit nil
  "MIME edit mode"
  :group 'mime)

(defcustom mime-ignore-preceding-spaces nil
  "*Ignore preceding white spaces if non-nil."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-ignore-trailing-spaces nil
  "*Ignore trailing white spaces if non-nil."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-ignore-same-text-tag t
  "*Ignore preceding text content-type tag that is same with new one.
If non-nil, the text tag is not inserted unless something different."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-auto-hide-body t
  "*Hide non-textual body encoded in base64 after insertion if non-nil."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-edit-insert-file-confirm t
  "*Confirm guessed mime type when inserting files."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-edit-voice-recorder
  (function mime-edit-voice-recorder-for-sun)
  "*Function to record a voice message and encode it."
  :group 'mime-edit
  :type 'function)

(defcustom mime-edit-mode-hook nil
  "*Hook called when enter MIME mode."
  :group 'mime-edit
  :type 'hook)

(defcustom mime-edit-translate-hook nil
  "*Hook called before translating into a MIME compliant message.
To insert a signature file automatically, call the function
`mime-edit-insert-signature' from this hook."
  :group 'mime-edit
  :type 'hook)

(defcustom mime-edit-exit-hook nil
  "*Hook called when exit MIME mode."
  :group 'mime-edit
  :type 'hook)

(defvar mime-content-types
  '(("text"
     ;; Charset parameter need not to be specified, since it is
     ;; defined automatically while translation.
     ("plain"
      ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
      )
     ("enriched")
     ("html")
     ("css") ; rfc2318
     ("csv") ; rfc4180
     ("xml") ; rfc2376
     ("xml") ; rfc2376
     ("vcard") ; rfc6350
     ;; ("x-rot13-47-48")
     )
    ("message"
     ("external-body"
      ("access-type"
       ("anon-ftp"
	("site" "ftp.jaist.ac.jp" "wnoc-fuk.wide.ad.jp" "nic.karrn.ad.jp")
	("directory" "/pub/GNU/elisp/mime")
	("name")
	("mode" "image" "ascii" "local8"))
       ("ftp"
	("site")
	("directory")
	("name")
	("mode" "image" "ascii" "local8"))
       ("tftp"        ("site") ("name"))
       ("afs"         ("site") ("name"))
       ("local-file"  ("site") ("name"))
       ("mail-server"
	("server" "ftpmail@nic.karrn.ad.jp")
	("subject"))
       ("url"         ("url"))))
     ("rfc822")
     ("news"))
    ("application"
     ("javascript")
     ("msword")
     ("octet-stream" ("type" "" "tar" "shar"))
     ("postscript")
     ("pdf")
     ("rtf")
     ("zip")
     ("x-shockwave-flash")
     ("x-7z-compressed")

                                        ; OpenOffice
     ("vnd.oasis.opendocument.text")
     ("vnd.oasis.opendocument.spreadsheet")
     ("vnd.oasis.opendocument.graphics")
     ("vnd.oasis.opendocument.chart")
     ("vnd.oasis.opendocument.formula")
     ("vnd.oasis.opendocument.text-master")
     ("vnd.oasis.opendocument.presentation")
     ("vnd.oasis.opendocument.text-template")
     ("vnd.oasis.opendocument.spreadsheet-template")
     ("vnd.oasis.opendocument.presentation-template")
     ("vnd.oasis.opendocument.graphics-template")

     ("msword")
     ("vnd.ms-excel")
     ("vnd.ms-powerpoint")
                                        ; Microsoft Office (OpenXML)
     ("vnd.ms-excel.addin.macroEnabled.12")
     ("vnd.ms-excel.sheet.binary.macroEnabled.12")
     ("vnd.ms-excel.sheet.macroEnabled.12")
     ("vnd.ms-excel.template.macroEnabled.12")
     ("vnd.ms-powerpoint.addin.macroEnabled.12")
     ("vnd.ms-powerpoint.presentation.macroEnabled.12")
     ("vnd.ms-powerpoint.slideshow.macroEnabled.12")
     ("vnd.ms-powerpoint.template.macroEnabled.12")
     ("vnd.ms-word.document.macroEnabled.12")
     ("vnd.ms-word.template.macroEnabled.12")
     ("vnd.openxmlformats-officedocument.presentationml.presentation")
     ("vnd.openxmlformats-officedocument.presentationml.slideshow")
     ("vnd.openxmlformats-officedocument.presentationml.template")
     ("vnd.openxmlformats-officedocument.spreadsheetml.sheet")
     ("vnd.openxmlformats-officedocument.spreadsheetml.template")
     ("vnd.openxmlformats-officedocument.wordprocessingml.document")
     ("vnd.openxmlformats-officedocument.wordprocessingml.template")
     ("vnd.ms-xpsdocument")
                                        ; Microsoft Project
     ("vnd.ms-project")
     ("vnd.ms-tnef")
     ("ms-tnef")
     ("x-kiss" ("x-cnf")))
    ("image"
     ("bmp")
     ("gif")
     ("jpeg")
     ("png")
     ("svg+xml")
     ("tiff")
     ("x-pic")
     ("x-mag")
     ("x-xwd")
     ("x-xbm"))
    ("audio"
     ("basic")
     ("mpeg")
     ("ogg")
     ("vorbis"))
    ("video"
     ("mpeg")
     ("ogg")
     ("mp4")
     ("quicktime")
     ("x-flv")))
  "*Alist of content-type, subtype, parameters and its values.")

(defcustom mime-file-types
  (eval-when-compile
    (mapcar
     (lambda (list)
       (let ((name  '(nil nil nil "name" nil nil "filename")))
	 (mapcar (lambda (elt)
		   (prog1
		       (if (and (car name)
				(null (assoc (car name) elt)))
			   (nreverse `((,(car name) . file)
				       . ,(reverse elt)))
			 elt)
		     (setq name (cdr name))))
		 list)))
     '(
       ;; Programming languages
       ("\\.cc$"
	"application" "octet-stream" (("type" . "C++") ("charset" . charset))
	"7bit"
	"attachment"	nil)

       ("\\.el$"
	"application" "octet-stream" (("type" . "emacs-lisp") ("charset" . charset))
	"7bit"
	"attachment"	nil)

       ("\\.lsp$"
	"application" "octet-stream" (("type" . "common-lisp") ("charset" . charset))
	"7bit"
	"attachment"	nil)

       ("\\.pl$"
	"application" "octet-stream" (("type" . "perl") ("charset" . charset))
	"7bit"
	"attachment"	nil)

       ;; Text or translated text

       ("\\.txt$\\|\\.pln$"
	"text"	"plain"		(("charset" . charset))
	nil
	"inline"		nil)

       ("\\.css$"
	"text"	"css"		(("charset" . charset))
	nil
	"inline"		nil)

       ("\\.csv$"
	"text"	"csv"		(("charset" . charset))
	nil
	"inline"		nil)

       ("\\.tex$\\|\\.latex$"
	"text"	"x-latex"	(("charset" . charset))
	nil
	"inline"		nil)

       ;; .rc : procmail modules pm-xxxx.rc
       ;; *rc : other resource files

       ("\\.\\(rc\\|lst\\|log\\|sql\\|mak\\)$\\|\\..*rc$"
	"text"	"plain"		(("charset" . charset))
	nil
	"attachment"	nil)

       ("\\.html$"
	"text"	"html"		(("charset" . charset))
	nil
	nil		nil)

       ("\\.diff$\\|\\.patch$"
	"application" "octet-stream" (("type" . "patch"))
	nil
	"attachment"	nil)

       ("\\.signature"
	"text"	"plain"		(("charset" . charset))	nil	nil	nil)


       ("\\.js$"
	"application"	"javascript" (("charset" . charset))
	nil
	"inline"	nil)

       
       ("\\.vcf$"
	"text"	"vcard"		(("charset" . "UTF-8"))
	nil
	"inline"		nil)

       ;; Microsoft Project
       ("\\.mpp$"
	"application" "vnd.ms-project" nil
	"base64"
	"attachment" nil)
       
       
       ;; Microsoft Office (none-OpenXML)
       
       ("\\.rtf$"				; Rich text format
	"application" "rtf" nil
	"base64"
	"attachment" nil)
       ("\\.doc$"				;MS Word
	"application" "msword" nil
	"base64"
	"attachment" nil)
       ("\\.xls$"				; MS Excel
	"application" "vnd.ms-excel" nil
	"base64"
	"attachment" nil)
       ("\\.ppt$"				; MS Power Point
	"application" "vnd.ms-powerpoint" nil
	"base64"
	"attachment" nil)

       
       ;; Microsoft Office (OpenXML)
       
                                        ; MS Word
       ("\\.docm$"
	"application" "vnd.ms-word.document.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.docx$"
	"application" "vnd.openxmlformats-officedocument.wordprocessingml.document" nil
	"base64"
	"attachment" nil)
       ("\\.dotm$"
	"application" "vnd.ms-word.template.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.dotx$"
	"application" "vnd.openxmlformats-officedocument.wordprocessingml.template" nil
	"base64"
	"attachment" nil)
       
                                        ; MS Power Point
       ("\\.potm$"
	"application" "vnd.ms-powerpoint.template.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.potx$"
	"application" "vnd.openxmlformats-officedocument.presentationml.template" nil
	"base64"
	"attachment" nil)
       ("\\.ppam$"
	"application" "vnd.ms-powerpoint.addin.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.ppsm$"
	"application" "vnd.ms-powerpoint.slideshow.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.ppsx$"
	"application" "vnd.openxmlformats-officedocument.presentationml.slideshow" nil
	"base64"
	"attachment" nil)
       ("\\.pptm$"
	"application" "vnd.ms-powerpoint.presentation.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.pptx$"
	"application" "vnd.openxmlformats-officedocument.presentationml.presentation" nil
	"base64"
	"attachment" nil)
       
                                        ; MS Excel
       ("\\.xlam$"
	"application" "vnd.ms-excel.addin.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.xlsb$"
	"application" "vnd.ms-excel.sheet.binary.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.xlsm$"
	"application" "vnd.ms-excel.sheet.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.xlsx$"
	"application" "vnd.openxmlformats-officedocument.spreadsheetml.sheet" nil
	"base64"
	"attachment" nil)
       ("\\.xltm$"
	"application" "vnd.ms-excel.template.macroEnabled.12" nil
	"base64"
	"attachment" nil)
       ("\\.xltx$"
	"application" "vnd.openxmlformats-officedocument.spreadsheetml.template" nil
	"base64"
	"attachment" nil)
       
       
       ;; Open Office
       ("\\.odt$"
	"application" "vnd.oasis.opendocument.text" nil
	"base64"
	"attachment" nil)
       ("\\.ods$"
	"application" "vnd.oasis.opendocument.spreadsheet" nil
	"base64"
	"attachment" nil)
       ("\\.odg$"
	"application" "vnd.oasis.opendocument.graphics" nil
	"base64"
	"attachment" nil)
       ("\\.odf$"
	"application" "vnd.oasis.opendocument.formula" nil
	"base64"
	"attachment" nil)
       ("\\.odm$"
	"application" "vnd.oasis.opendocument.text-master" nil
	"base64"
	"attachment" nil)
       ("\\.odp$"
	"application" "vnd.oasis.opendocument.presentation" nil
	"base64"
	"attachment" nil)
       ("\\.ott$"
	"application" "vnd.oasis.opendocument.text-template" nil
	"base64"
	"attachment" nil)
       ("\\.ots$"
	"application" "vnd.oasis.opendocument.spreadsheet-template" nil
	"base64"
	"attachment" nil)
       ("\\.otp$"
	"application" "vnd.oasis.opendocument.presentation-template" nil
	"base64"
	"attachment" nil)
       ("\\.otg$"
	"application" "vnd.oasis.opendocument.graphics-template" nil
	"base64"
	"attachment" nil)
       
       ;; Postscript and PDF
       ("\\.ps$"
	"application" "postscript"	nil
	"base64"
	"attachment"	nil)
       ("\\.pdf$"
	"application" "pdf"	nil
	"base64"
	"attachment"	nil)

       ;;  Pure binary

       ("\\.jpg$\\|\\.jpeg$"
	"image"	"jpeg"		nil
	"base64"
	"inline"		nil)
       ("\\.gif$"
	"image"	"gif"		nil
	"base64"
	"inline"		nil)
       ("\\.png$"
	"image"	"png"		nil
	"base64"
	"inline"		nil)
       ("\\.bmp$"
	"image"	"bmp"		nil
	"base64"
	"inline"		nil)
       ("\\.svg$"
	"image"	"svg+xml"   nil
	"base64"
	"inline"		nil)
       ("\\.tiff$"
	"image"	"tiff"		nil
	"base64"
	"inline"		nil)
       ("\\.pic$"
	"image"	"x-pic"		nil
	"base64"
	"inline"		nil)
       ("\\.mag$"
	"image"	"x-mag"		nil
	"base64"
	"inline"		nil)
       ("\\.xbm$"
	"image"	"x-xbm"		nil
	"base64"
	"inline"		nil)
       ("\\.xwd$"
	"image"	"x-xwd"		nil
	"base64"
	"inline"		nil)

       ;; Audio and video

       ("\\.au$\\|\\.snd$"
	"audio"	"basic"		nil
	"base64"
	"attachment"		nil)
       ("\\.mp[234]\\|\\.m4[abp]$"
	"audio"	"mpeg"		nil
	"base64"
	"attachment"		nil)
       ("\\.ogg$"
	"audio"	"ogg"		nil
	"base64"
	"attachment"		nil)
       ("\\.ogg$"
	"audio"	"vorbis"		nil
	"base64"
	"attachment"		nil)
       ("\\.mpg\\|\\.mpeg$"
	"video"	"mpeg"		nil
	"base64"
	"attachment"	nil)
       ("\\.mp4\\|\\.m4v$"
	"video"	"mp4"		nil
	"base64"
	"attachment"	nil)
       ("\\.qt$\\|\\.mov$"
	"video"	"quicktime"		nil
	"base64"
	"attachment"	nil)
       ("\\.flv$"
	"video"	"x-flv"		nil
	"base64"
	"attachment"	nil)
       ("\\.swf$"
	"application"	"x-shockwave-flash"		nil
	"base64"
	"attachment"	nil)


       ;; Compressed files

       ("\\.tar\\.gz$"
	"application" "octet-stream" (("type" . "tar+gzip"))
	"base64"
	"attachment"	nil)
       ("\\.tgz$"
	"application" "octet-stream" (("type" . "tar+gzip"))
	"base64"
	"attachment"	nil)
       ("\\.tar\\.Z$"
	"application" "octet-stream" (("type" . "tar+compress"))
	"base64"
	"attachment"	nil)
       ("\\.taz$"
	"application" "octet-stream" (("type" . "tar+compress"))
	"base64"
	"attachment"	nil)
       ("\\.gz$"
	"application" "octet-stream" (("type" . "gzip"))
	"base64"
	"attachment"	nil)
       ("\\.Z$"
	"application" "octet-stream" (("type" . "compress"))
	"base64"
	"attachment"	nil)
       ("\\.lzh$"
	"application" "octet-stream" (("type" . "lha"))
	"base64"
	"attachment"	nil)
       ("\\.zip$"
	"application" "zip" nil
	"base64"
	"attachment"	nil)
       ("\\.7z$"
	"application" "x-7z-compressed" nil
	"base64"
	"attachment"	nil)
       ("winmail\\.dat$"
	"application" "ms-tnef" nil
	"base64"
	"attachment"	nil)

       ;; Rest

       (".*"
	"application" "octet-stream" nil
	nil
	"attachment"	nil))))
  "*Alist of file name, types, parameters, and default encoding.
If encoding is nil, it is determined from its contents."
  :type `(repeat
	  (list regexp
		;; primary-type
		(choice :tag "Primary-Type"
			,@(nconc (mapcar (lambda (cell)
					   (list 'item (car cell)))
					 mime-content-types)
				 '(string)))
		;; subtype
		(choice :tag "Sub-Type"
			,@(nconc
			   (apply #'nconc
				  (mapcar (lambda (cell)
					    (mapcar (lambda (cell)
						      (list 'item (car cell)))
						    (cdr cell)))
					  mime-content-types))
			   '(string)))
		;; parameters
		(repeat :tag "Parameters of Content-Type field"
			(cons string (choice string symbol)))
		;; content-transfer-encoding
		(choice :tag "Encoding"
			,@(cons
			   '(const nil)
			   (mapcar (lambda (cell)
				     (list 'item cell))
				   (mime-encoding-list))))
		;; disposition-type
		(choice :tag "Disposition-Type"
			(item nil)
			(item "inline")
			(item "attachment")
			string)
		;; parameters
		(repeat :tag "Parameters of Content-Disposition field"
			(cons string (choice string symbol)))))
  :group 'mime-edit)

(defvar mime-edit-debug nil)

;;; @@ about charset, encoding and transfer-level
;;;

(defvar mime-charset-type-list
  '((us-ascii		7 nil)
    (iso-8859-1		8 "quoted-printable")
    (iso-8859-2		8 "quoted-printable")
    (iso-8859-3		8 "quoted-printable")
    (iso-8859-4		8 "quoted-printable")
    (iso-8859-5		8 "quoted-printable")
    (koi8-r		8 "quoted-printable")
    (iso-8859-7		8 "quoted-printable")
    (iso-8859-8		8 "quoted-printable")
    (iso-8859-9		8 "quoted-printable")
    (iso-8859-14	8 "quoted-printable")
    (iso-8859-15	8 "quoted-printable")
    (iso-2022-jp	7 "base64")
    (iso-2022-jp-3	7 "base64")
    (iso-2022-kr	7 "base64")
    (euc-kr		8 "base64")
    (cn-gb		8 "base64")
    (gb2312		8 "base64")
    (cn-big5		8 "base64")
    (big5		8 "base64")
    (shift_jis		8 "base64")
    (tis-620		8 "base64")
    (iso-2022-jp-2	7 "base64")
    (iso-2022-int-1	7 "base64")))

(defvar mime-transfer-level 7
  "*A number of network transfer level.  It should be 7 or bigger.")
(make-variable-buffer-local 'mime-transfer-level)

(defsubst mime-encoding-name (transfer-level &optional not-omit)
  (cond ((> transfer-level 8) "binary")
	((= transfer-level 8) "8bit")
	(not-omit "7bit")))

(defvar mime-transfer-level-string
  (mime-encoding-name mime-transfer-level 'not-omit)
  "A string formatted version of mime-transfer-level")
(make-variable-buffer-local 'mime-transfer-level-string)

;;; @@ about content transfer encoding

(defvar mime-content-transfer-encoding-priority-list
  '(nil "8bit" "binary"))

;;; @@ about message inserting
;;;

(defvar mime-edit-yank-ignored-field-list
  '("Received" "Approved" "Path" "Replied" "Status"
    "Xref" "X-UIDL" "X-Filter" "X-Gnus-.*" "X-VM-.*")
  "Delete these fields from original message when it is inserted
as message/rfc822 part.
Each elements are regexp of field-name.")

(defvar mime-edit-yank-ignored-field-regexp
  (concat "^"
	  (apply (function regexp-or) mime-edit-yank-ignored-field-list)
	  ":"))

(defvar mime-edit-message-inserter-alist nil)
(defvar mime-edit-mail-inserter-alist nil)


;;; @@ about message splitting
;;;

(defcustom mime-edit-split-message nil
  "*Split large message if it is non-nil."
  :group 'mime-edit
  :type 'boolean)

(defcustom mime-edit-message-default-max-lines 1000
  "*Default maximum lines of a message."
  :group 'mime-edit
  :type 'integer)

(defcustom mime-edit-message-max-lines-alist
  '((news-reply-mode . 500))
  "Alist of major-mode vs maximum lines of a message.
If it is not specified for a major-mode,
`mime-edit-message-default-max-lines' is used."
  :group 'mime-edit
  :type 'list)

(defconst mime-edit-split-ignored-field-regexp
  "\\(^Content-\\|^Subject:\\|^Mime-Version:\\|^Message-Id:\\)")

(defcustom mime-edit-split-blind-field-regexp
  "\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)"
  "*Regular expression to match field-name to be ignored when split sending."
  :group 'mime-edit
  :type 'regexp)

(defvar mime-edit-split-message-sender-alist nil)

(defvar mime-edit-news-reply-mode-server-running nil)

;;; @@ about PGP/MIME
;;;

(defgroup mime-edit-pgp nil
  "MIME edit mode (PGP/MIME)"
  :group 'mime-edit)

(defcustom mime-edit-pgp-verbose nil
  "If non-nil, ask the user about the current operation more verbosely."
  :group 'mime-edit-pgp
  :type 'boolean)

(defcustom mime-edit-pgp-signers nil
  "A list of your own key ID which will be preferredly used to sign a message."
  :group 'mime-edit-pgp
  :type '(repeat (string :tag "Key ID")))

(defcustom mime-edit-pgp-encrypt-to-self t
  "If t, add your own key ID to recipient list when encryption."
  :group 'mime-edit-pgp
  :type 'boolean)

(defcustom mime-edit-pgp-filtered-validities
  '(invalid disabled revoked expired never)
  "A list of keys's validities which are not used for signing and encrypting."
  :group 'mime-edit-pgp
  :type
  '(choice
    (const nil :tag "Any keys are used.")
    (repeat (choice (const unknow)
		    (const invalid)
		    (const disabled)
		    (const revoked)
		    (const expired)
		    (const none)
		    (const undefined)
		    (const never)
		    (const marginal)
		    (const full)
		    (const ultimate)))))


;;; @@ about tag
;;;

(defconst mime-edit-single-part-tag-regexp
  "--[[][[]\\([^]]*\\)]\\([[]\\([^]]*\\)]\\|\\)]"
  "*Regexp of MIME tag in the form of [[CONTENT-TYPE][ENCODING]].")

(defconst mime-edit-quoted-single-part-tag-regexp
  (concat "- " (substring mime-edit-single-part-tag-regexp 1)))

(defconst mime-edit-multipart-beginning-regexp "--<<\\([^<>]+\\)>>-{\n")

(defconst mime-edit-multipart-end-regexp "--}-<<\\([^<>]+\\)>>\n")

(defconst mime-edit-beginning-tag-regexp
  (regexp-or mime-edit-single-part-tag-regexp
	     mime-edit-multipart-beginning-regexp))

(defconst mime-edit-end-tag-regexp
  (regexp-or mime-edit-single-part-tag-regexp
	     mime-edit-multipart-end-regexp))

(defconst mime-edit-tag-regexp
  (regexp-or mime-edit-single-part-tag-regexp
	     mime-edit-multipart-beginning-regexp
	     mime-edit-multipart-end-regexp))

(defvar mime-tag-format "--[[%s]]"
  "*Control-string making a MIME tag.")

(defvar mime-tag-format-with-encoding "--[[%s][%s]]"
  "*Control-string making a MIME tag with encoding.")


;;; @@ multipart boundary
;;;

(defvar mime-multipart-boundary "Multipart"
  "*Boundary of a multipart message.")


;;; @@ optional header fields
;;;

(defvar mime-edit-insert-user-agent-field t
  "*If non-nil, insert User-Agent header field.")

(defvar mime-edit-user-agent-value
  (concat (mime-product-name mime-user-interface-product)
	  "/"
	  (mapconcat #'number-to-string
		     (mime-product-version mime-user-interface-product) ".")
	  " ("
	  (mime-product-code-name mime-user-interface-product)
	  ") "
	  (mime-product-name mime-library-product)
	  "/"
	  (mapconcat #'number-to-string
		     (mime-product-version mime-library-product) ".")
	  " ("
	  (mime-product-code-name mime-library-product)
	  ") "
	  (if (fboundp 'apel-version)
	      (concat (apel-version) " "))
	  (if (boundp 'epg-version-number)
	      (concat "EasyPG/" epg-version-number " "))
	  (let ((ver (if (and (not (boundp 'emacs-build-number))
			      (string-match "\\.[0-9]+$" emacs-version))
			 (substring emacs-version 0 (match-beginning 0))
		       emacs-version)))
	    (concat "Emacs/" ver " (" system-configuration ")"
		    (if (boundp 'mule-version)
			(concat " MULE/" mule-version)))))
  "Body of User-Agent field.
If variable `mime-edit-insert-user-agent-field' is not nil, it is
inserted into message header.")


;;; @ constants
;;;

(defconst mime-tspecials-regexp "[][()<>@,;:\\\"/?.= \t]"
  "*Specify MIME tspecials.
Tspecials means any character that matches with it in header must be quoted.")

(defconst mime-edit-mime-version-value
  (concat "1.0 (generated by " mime-edit-version ")")
  "MIME version number.")

(defconst mime-edit-mime-version-field-for-message/partial
  (concat "MIME-Version:"
	  (mime-encode-field-body
	   (concat " 1.0 (split by " mime-edit-version ")\n")
	   "MIME-Version"))
  "MIME version field for message/partial.")


;;; @ keymap and menu
;;;

(defvar mime-edit-mode-flag nil)
(make-variable-buffer-local 'mime-edit-mode-flag)

(defvar mime-edit-mode-entity-prefix "\C-c\C-x"
  "Keymap prefix for MIME-Edit mode commands to insert entity or set status.")
(defvar mime-edit-mode-entity-map (make-sparse-keymap)
  "Keymap for MIME-Edit mode commands to insert entity or set status.")

(define-key mime-edit-mode-entity-map "\C-t" 'mime-edit-insert-text)
(define-key mime-edit-mode-entity-map "\C-i" 'mime-edit-insert-file)
(define-key mime-edit-mode-entity-map "i"    'mime-edit-insert-file-as-text)
(define-key mime-edit-mode-entity-map "\C-e" 'mime-edit-insert-external)
(define-key mime-edit-mode-entity-map "\C-v" 'mime-edit-insert-voice)
(define-key mime-edit-mode-entity-map "\C-y" 'mime-edit-insert-message)
(define-key mime-edit-mode-entity-map "\C-m" 'mime-edit-insert-mail)
(define-key mime-edit-mode-entity-map "\C-w" 'mime-edit-insert-signature)
(define-key mime-edit-mode-entity-map "\C-s" 'mime-edit-insert-signature)
(define-key mime-edit-mode-entity-map "\C-k" 'mime-edit-insert-key)
(define-key mime-edit-mode-entity-map "t"    'mime-edit-insert-tag)

(define-key mime-edit-mode-entity-map "7" 'mime-edit-set-transfer-level-7bit)
(define-key mime-edit-mode-entity-map "8" 'mime-edit-set-transfer-level-8bit)
(define-key mime-edit-mode-entity-map "/" 'mime-edit-set-split)
(define-key mime-edit-mode-entity-map "s" 'mime-edit-set-sign)
(define-key mime-edit-mode-entity-map "v" 'mime-edit-set-sign)
(define-key mime-edit-mode-entity-map "e" 'mime-edit-set-encrypt)
(define-key mime-edit-mode-entity-map "h" 'mime-edit-set-encrypt)
(define-key mime-edit-mode-entity-map "p" 'mime-edit-preview-message)
(define-key mime-edit-mode-entity-map "\C-z" 'mime-edit-exit)
(define-key mime-edit-mode-entity-map "?" 'mime-edit-help)

(defvar mime-edit-mode-enclosure-prefix "\C-c\C-m"
  "Keymap prefix for MIME-Edit mode commands about enclosure.")
(defvar mime-edit-mode-enclosure-map (make-sparse-keymap)
  "Keymap for MIME-Edit mode commands about enclosure.")

(define-key mime-edit-mode-enclosure-map
  "\C-a" 'mime-edit-enclose-alternative-region)
(define-key mime-edit-mode-enclosure-map
  "\C-p" 'mime-edit-enclose-parallel-region)
(define-key mime-edit-mode-enclosure-map
  "\C-m" 'mime-edit-enclose-mixed-region)
(define-key mime-edit-mode-enclosure-map
  "\C-d" 'mime-edit-enclose-digest-region)
(define-key mime-edit-mode-enclosure-map
  "\C-s" 'mime-edit-enclose-pgp-signed-region)
(define-key mime-edit-mode-enclosure-map
  "\C-e" 'mime-edit-enclose-pgp-encrypted-region)
(define-key mime-edit-mode-enclosure-map
  "s" 'mime-edit-enclose-smime-signed-region)
(define-key mime-edit-mode-enclosure-map
  "e" 'mime-edit-enclose-smime-encrypted-region)
(define-key mime-edit-mode-enclosure-map
  "\C-q" 'mime-edit-enclose-quote-region)

(defvar mime-edit-mode-map (make-sparse-keymap)
  "Keymap for MIME-Edit mode commands.")
(define-key mime-edit-mode-map
  mime-edit-mode-entity-prefix mime-edit-mode-entity-map)
(define-key mime-edit-mode-map
  mime-edit-mode-enclosure-prefix mime-edit-mode-enclosure-map)

(defconst mime-edit-menu-title "MIME-Edit")

(defconst mime-edit-menu-list
  '((mime-help	"Describe MIME editor mode" mime-edit-help)
    (file	"Insert File"		mime-edit-insert-file)
    (file-as-text "Insert File as text"	mime-edit-insert-file-as-text)
    (external	"Insert External"	mime-edit-insert-external)
    (voice	"Insert Voice"		mime-edit-insert-voice)
    (message	"Insert Message"	mime-edit-insert-message)
    (mail	"Insert Mail"		mime-edit-insert-mail)
    (signature	"Insert Signature"	mime-edit-insert-signature)
    (text	"Insert Text"		mime-edit-insert-text)
    (tag	"Insert Tag"		mime-edit-insert-tag)
    (alternative "Enclose as alternative"
		 mime-edit-enclose-alternative-region)
    (parallel	"Enclose as parallel"	mime-edit-enclose-parallel-region)
    (mixed	"Enclose as serial"	mime-edit-enclose-mixed-region)
    (digest	"Enclose as digest"	mime-edit-enclose-digest-region)
    (signed	"Enclose as signed"	mime-edit-enclose-pgp-signed-region)
    (encrypted	"Enclose as encrypted"	mime-edit-enclose-pgp-encrypted-region)
    (quote	"Verbatim region"	mime-edit-enclose-quote-region)
    (key	"Insert Public Key"	mime-edit-insert-key)
    (split	"Set splitting"		mime-edit-set-split)
    (sign	"PGP sign"		mime-edit-set-sign)
    (encrypt	"PGP encrypt"		mime-edit-set-encrypt)
    (preview	"Preview Message"	mime-edit-preview-message)
    (level	"Toggle transfer-level"	mime-edit-toggle-transfer-level))
  "MIME-edit menubar entry.")

(define-key mime-edit-mode-map [menu-bar mime-edit]
  (cons mime-edit-menu-title
	(make-sparse-keymap mime-edit-menu-title)))
(mapc (lambda (item)
	(define-key mime-edit-mode-map
	  (vector 'menu-bar 'mime-edit (car item))
	  (cons (nth 1 item) (nth 2 item))))
      (reverse mime-edit-menu-list))

;;; @ functions
;;;

(defvar mime-edit-touched-flag nil)

;;;###autoload
(defun mime-edit-mode ()
  "MIME minor mode for editing the tagged MIME message.

In this mode, basically, the message is composed in the tagged MIME
format. The message tag looks like:

	--[[text/plain; charset=ISO-2022-JP][7bit]]

The tag specifies the MIME content type, subtype, optional parameters
and transfer encoding of the message following the tag.  Messages
without any tag are treated as `text/plain' by default.  Charset and
transfer encoding are automatically defined unless explicitly
specified.  Binary messages such as audio and image are usually
hidden.  The messages in the tagged MIME format are automatically
translated into a MIME compliant message when exiting this mode.

Available charsets depend on Emacs version being used.  The following
lists the available charsets of each emacs.

Without mule:	US-ASCII and ISO-8859-1 (or other charset) are available.
With mule:	US-ASCII, ISO-8859-* (except for ISO-8859-5), KOI8-R,
		ISO-2022-JP, ISO-2022-JP-2, EUC-KR, CN-GB-2312,
		CN-BIG5 and ISO-2022-INT-1 are available.

ISO-2022-JP-2 and ISO-2022-INT-1 charsets used in mule is expected to
be used to represent multilingual text in intermixed manner.  Any
languages that has no registered charset are represented as either
ISO-2022-JP-2 or ISO-2022-INT-1 in mule.

If you want to use non-ISO-8859-1 charset in Emacs 19 or XEmacs
without mule, please set variable `default-mime-charset'.  This
variable must be symbol of which name is a MIME charset.

If you want to add more charsets in mule, please set variable
`charsets-mime-charset-alist'.  This variable must be alist of which
key is list of charset and value is symbol of MIME charset.  If name
of coding-system is different as MIME charset, please set variable
`mime-charset-coding-system-alist'.  This variable must be alist of
which key is MIME charset and value is coding-system.

Following commands are available in addition to major mode commands:

\[make single part\]
\\[mime-edit-insert-text]	insert a text message.
\\[mime-edit-insert-file]	insert a (binary) file.
\\[mime-eidt-insert-file-as-text] insert a text file.
\\[mime-edit-insert-external]	insert a reference to external body.
\\[mime-edit-insert-voice]	insert a voice message.
\\[mime-edit-insert-message]	insert a mail or news message.
\\[mime-edit-insert-mail]	insert a mail message.
\\[mime-edit-insert-signature]	insert a signature file at end.
\\[mime-edit-insert-key]	insert PGP public key.
\\[mime-edit-insert-tag]	insert a new MIME tag.

\[make enclosure (maybe multipart)\]
\\[mime-edit-enclose-alternative-region]   enclose as multipart/alternative.
\\[mime-edit-enclose-parallel-region]	   enclose as multipart/parallel.
\\[mime-edit-enclose-mixed-region]	   enclose as multipart/mixed.
\\[mime-edit-enclose-digest-region]	   enclose as multipart/digest.
\\[mime-edit-enclose-pgp-signed-region]	   enclose as PGP signed.
\\[mime-edit-enclose-pgp-encrypted-region] enclose as PGP encrypted.
\\[mime-edit-enclose-quote-region]	   enclose as verbose mode
					   (to avoid to expand tags)

\[other commands\]
\\[mime-edit-set-transfer-level-7bit]	set transfer-level as 7.
\\[mime-edit-set-transfer-level-8bit]	set transfer-level as 8.
\\[mime-edit-set-split]			set message splitting mode.
\\[mime-edit-set-sign]			set PGP-sign mode.
\\[mime-edit-set-encrypt]		set PGP-encryption mode.
\\[mime-edit-preview-message]		preview editing MIME message.
\\[mime-edit-exit]			exit and translate into a MIME
					compliant message.
\\[mime-edit-help]			show this help.
\\[mime-edit-maybe-translate]		exit and translate if in MIME mode,
					then split.

Additional commands are available in some major modes:
C-c C-c		exit, translate and run the original command.
C-c C-s		exit, translate and run the original command.

The following is a message example written in the tagged MIME format.
TABs at the beginning of the line are not a part of the message:

	This is a conventional plain text.  It should be translated
	into text/plain.
	--[[text/plain]]
	This is also a plain text.  But, it is explicitly specified as
	is.
	--[[text/plain; charset=ISO-8859-1]]
	This is also a plain text.  But charset is specified as
	iso-8859-1.

	¡Hola!  Buenos días.  ¿Cómo está usted?
	--[[text/enriched]]
	This is a <bold>enriched text</bold>.
	--[[image/gif][base64]]...image encoded in base64 here...
	--[[audio/basic][base64]]...audio encoded in base64 here...

User customizable variables (not documented all of them):
 mime-edit-prefix
    Specifies a key prefix for MIME minor mode commands.

 mime-ignore-preceding-spaces
    Preceding white spaces in a message body are ignored if non-nil.

 mime-ignore-trailing-spaces
    Trailing white spaces in a message body are ignored if non-nil.

 mime-auto-hide-body
    Hide a non-textual body message encoded in base64 after insertion
    if non-nil.

 mime-transfer-level
    A number of network transfer level.  It should be bigger than 7.
    If you are in 8bit-through environment, please set 8.

 mime-edit-voice-recorder
    Specifies a function to record a voice message and encode it.
    The function `mime-edit-voice-recorder-for-sun' is for Sun
    SparcStations.

 mime-edit-mode-hook
    Turning on MIME mode calls the value of mime-edit-mode-hook, if
    it is non-nil.

 mime-edit-translate-hook
    The value of mime-edit-translate-hook is called just before translating
    the tagged MIME format into a MIME compliant message if it is
    non-nil.  If the hook call the function mime-edit-insert-signature,
    the signature file will be inserted automatically.

 mime-edit-exit-hook
    Turning off MIME mode calls the value of mime-edit-exit-hook, if it is
    non-nil."
  (interactive)
  (if mime-edit-mode-flag
      (mime-edit-exit)
    (if mime-edit-touched-flag
	(mime-edit-again)
      (make-local-variable 'mime-edit-touched-flag)
      (setq mime-edit-touched-flag t)
      (turn-on-mime-edit))))


(set-alist 'minor-mode-alist
	   'mime-edit-mode-flag
	   '((" MIME-Edit "  mime-transfer-level-string)))
(set-alist 'minor-mode-map-alist
	   'mime-edit-mode-flag
	   mime-edit-mode-map)


;;;###autoload
(defun turn-on-mime-edit ()
  "Unconditionally turn on MIME-Edit mode."
  (interactive)
  (if mime-edit-mode-flag
      (error "You are already editing a MIME message.")
    (setq mime-edit-mode-flag t)

    ;; Set transfer level into mode line
    ;;
    (setq mime-transfer-level-string
 	  (mime-encoding-name mime-transfer-level 'not-omit))
    (force-mode-line-update)

    (make-local-variable 'paragraph-start)
    (setq paragraph-start
	  (regexp-or mime-edit-single-part-tag-regexp
		     paragraph-start))
    (make-local-variable 'paragraph-separate)
    (setq paragraph-separate
	  (regexp-or mime-edit-single-part-tag-regexp
		     paragraph-separate))
    (run-hooks 'mime-edit-mode-hook)
    (message
     "%s"
     (substitute-command-keys
      "Type \\[mime-edit-exit] to exit MIME mode, and type \\[mime-edit-help] to get help."))))

;;;###autoload
(defalias 'edit-mime 'turn-on-mime-edit) ; for convenience


(defun mime-edit-exit (&optional nomime no-error)
  "Translate the tagged MIME message into a MIME compliant message.
With no argument encode a message in the buffer into MIME, otherwise
just return to previous mode."
  (interactive "P")
  (if (not mime-edit-mode-flag)
      (if (null no-error)
	  (error "You aren't editing a MIME message."))
    (if (not nomime)
	(progn
	  (run-hooks 'mime-edit-translate-hook)
	  (mime-edit-translate-buffer)))
    ;; Restore previous state.
    (setq mime-edit-mode-flag nil)
    (set-buffer-modified-p (buffer-modified-p))
    (run-hooks 'mime-edit-exit-hook)
    (message "Exit MIME editor mode.")))

(defun mime-edit-maybe-translate ()
  (interactive)
  (mime-edit-exit nil t)
  (call-interactively 'mime-edit-maybe-split-and-send))

(defun mime-edit-help ()
  "Show help message about MIME mode."
  (interactive)
  (with-output-to-temp-buffer "*Help*"
    (princ "MIME editor mode:\n")
    (princ (documentation 'mime-edit-mode))
    (help-print-return-message)))

(defun mime-edit-insert-text (&optional subtype)
  "Insert a text message.
Charset is automatically obtained from the `charsets-mime-charset-alist'.
If optional argument SUBTYPE is not nil, text/SUBTYPE tag is inserted."
  (interactive)
  (let ((ret (mime-edit-insert-tag "text" subtype nil)))
    (when ret
      (if (looking-at mime-edit-single-part-tag-regexp)
	  (progn
	    ;; Make a space between the following message.
	    (insert "\n")
	    (forward-char -1)))
      (if (member (cadr ret) '("enriched"))
	  (enriched-mode t)
	(enriched-mode -1)))))

(defun mime-edit-insert-file-filename (file)
  (std11-wrap-as-quoted-string (file-name-nondirectory file)))

(defun mime-edit-insert-file-charset (file &optional verbose)
  (let ((charset (with-temp-buffer
		   (insert-file-contents file)
		   (coding-system-to-mime-charset last-coding-system-used))))
    (when charset
      (setq charset (symbol-name charset)))
    (when verbose
      (setq charset
	    (completing-read
	     (apply 'concat "What charset: "
		    (when charset `("(default " ,charset ") ")))
	     (mapcar (lambda (elt) (cons (symbol-name elt) nil))
		     (mime-charset-list))
	     nil nil nil nil charset)))
    (unless (string= charset "") charset)))

(defun mime-edit-insert-file-parameters (parameters file &optional verbose)
  (let (attribute value strings)
    (while parameters
      (setq attribute (caar parameters)
	    value (cdar parameters))
      (cond
       ((eq value 'file)
	(setq value (mime-edit-insert-file-filename file)))
       ((eq value 'charset)
	(setq value (mime-edit-insert-file-charset file verbose))))
      (when value
	(if (symbolp value) (setq value (symbol-name value)))
	(setq strings (nconc strings (list "; " attribute "=" value))))
      (setq parameters (cdr parameters)))
    (apply 'concat strings)))

(defun mime-edit-insert-file (file &optional verbose)
  "Insert a message from a file."
  (interactive "fInsert file as MIME message: \nP")
  (let*  ((guess (mime-find-file-type file))
	  (type (nth 0 guess))
	  (subtype (nth 1 guess))
	  (parameters (nth 2 guess))
	  (encoding (nth 3 guess))
	  (disposition-type (nth 4 guess))
	  (disposition-params (nth 5 guess)))
    (setq verbose (if (called-interactively-p 'interactive)
		      (null (eq (null verbose)
				(null mime-edit-insert-file-confirm)))
		    verbose))
    (if verbose
	(setq type (mime-prompt-for-type type)
	      subtype (mime-prompt-for-subtype type subtype)
	      encoding (mime-prompt-for-encoding encoding)))
    (setq parameters
	  (concat
	   (when (consp parameters)
	     (mime-edit-insert-file-parameters parameters file verbose))
	   (when disposition-type
	     (concat "\n" "Content-Disposition: " disposition-type
		     (mime-edit-insert-file-parameters
		      disposition-params file verbose)))))
    (mime-edit-insert-tag type subtype parameters)
    (mime-edit-insert-binary-file file encoding)))

(defun mime-edit-insert-file-as-text (file &optional verbose)
  "Insert a text from a file.  This function decodes inserted file and
does not define Content-Transfer-Encoding: header and charset parameter."
  (interactive "fInsert file as text: \nP")
  (let*  ((guess (mime-find-file-type file))
	  (type "text")
	  (subtype (if (equal (nth 0 guess) "text") (nth 1 guess) "plain"))
	  (parameters (nth 2 guess))
	  (disposition-type (nth 4 guess))
	  (disposition-params (nth 5 guess)))
    (setq verbose (if (called-interactively-p 'interactive)
		      (null (eq (null verbose)
				(null mime-edit-insert-file-confirm)))
		    verbose))
    (if verbose
	(setq subtype (mime-prompt-for-subtype type subtype)))
    (setq parameters
	  (concat
	   (when (consp parameters)
	     (mime-edit-insert-file-parameters
	      (remove (assoc "charset" parameters) parameters) file verbose))
	   (when disposition-type
	     (concat
	      "\n" "Content-Disposition: " disposition-type
	      (mime-edit-insert-file-parameters
	       (remove (assoc "charset" disposition-params) disposition-params)
	       file verbose)))))
    (mime-edit-insert-tag type subtype parameters)
    (mime-edit-insert-text-file file)))

(defun mime-edit-insert-external ()
  "Insert a reference to external body."
  (interactive)
  (mime-edit-insert-tag "message" "external-body" nil ";\n\t")
  ;;(forward-char -1)
  ;;(insert "Content-Description: " (read-string "Content-Description: ") "\n")
  ;;(forward-line 1)
  (let* ((pritype (mime-prompt-for-type))
	 (subtype (mime-prompt-for-subtype pritype))
	 (parameters (mime-prompt-for-parameters pritype subtype ";\n\t")))
    (and pritype
	 subtype
	 (insert "Content-Type: "
		 pritype "/" subtype (or parameters "") "\n")))
  (if (and (not (eobp))
	   (not (looking-at mime-edit-single-part-tag-regexp)))
      (insert (mime-make-text-tag) "\n")))

(defun mime-edit-insert-voice ()
  "Insert a voice message."
  (interactive)
  (let ((encoding (mime-prompt-for-encoding)))
    (mime-edit-insert-tag "audio" "basic" nil)
    (mime-edit-define-encoding encoding)
    (save-restriction
      (narrow-to-region (1- (point))(point))
      (unwind-protect
	  (funcall mime-edit-voice-recorder encoding)
	(progn
	  (insert "\n")
	  (invisible-region (point-min)(point-max))
	  (goto-char (point-max)))))))

(autoload 'mime-edit-insert-signature "mime-signature" nil t)


;; Insert a new tag around a point.

(defun mime-edit-insert-tag (&optional pritype subtype parameters delimiter)
  "Insert new MIME tag and return a list of PRITYPE, SUBTYPE, and PARAMETERS.
If nothing is inserted, return nil."
  (interactive)
  (let ((p (point)))
    (mime-edit-goto-tag)
    (if (and (re-search-forward mime-edit-tag-regexp nil t)
	     (< (match-beginning 0) p)
	     (< p (match-end 0)))
	(goto-char (match-beginning 0))
      (goto-char p)))
  (let ((oldtag nil)
	(newtag nil)
	(current (point)))
    (setq pritype
	  (or pritype
	      (mime-prompt-for-type)))
    (setq subtype
	  (or subtype
	      (mime-prompt-for-subtype pritype)))
    (setq parameters
	  (or parameters
	      (mime-prompt-for-parameters pritype subtype delimiter)))
    ;; Make a new MIME tag.
    (setq newtag (mime-make-tag pritype subtype parameters))
    ;; Find an current MIME tag.
    (setq oldtag
	  (save-excursion
	    (if (mime-edit-goto-tag)
		(buffer-substring (match-beginning 0) (match-end 0))
	      ;; Assume content type is 'text/plan'.
	      (mime-make-tag "text" "plain"))))
    ;; We are only interested in TEXT.
    (if (and oldtag
	     (not (mime-test-content-type
		   (mime-edit-get-contype oldtag) "text")))
	(setq oldtag nil))
    ;; Make a new tag.
    (if (or (not oldtag)		;Not text
	    (or mime-ignore-same-text-tag
		(not (string-equal oldtag newtag))))
	(progn
	  ;; Mark the beginning of the tag for convenience.
	  (push-mark (point) 'nomsg)
	  (insert newtag "\n")
	  (list pritype subtype parameters) ;New tag is created.
	  )
      ;; Restore previous point.
      (goto-char current)
      nil				;Nothing is created.
      )))

(defun mime-edit-insert-binary-file (file &optional encoding)
  "Insert binary FILE at point.
Optional argument ENCODING specifies an encoding method such as base64."
  (setq encoding (or encoding "base64"))
  (let* ((tagend (1- (point)))		;End of the tag
	 (hide-p (and mime-auto-hide-body
		      (stringp encoding)
		      (not
		       (let ((en (downcase encoding)))
			 (or (string-equal en "7bit")
			     (string-equal en "8bit")
			     (string-equal en "binary")))))))
    (save-restriction
      (narrow-to-region tagend (point))
      (mime-insert-encoded-file file encoding)
      (if hide-p
	  (progn
	    (invisible-region (point-min) (point-max))
	    (goto-char (point-max)))
	(goto-char (point-max))))
    (or hide-p
	(looking-at mime-edit-tag-regexp)
	(= (point)(point-max))
	(mime-edit-insert-tag "text" "plain"))
    ;; Define encoding even if it is 7bit.
    (if (stringp encoding)
	(save-excursion
	  (goto-char tagend) ; Make sure which line the tag is on.
	  (mime-edit-define-encoding encoding)))))

(defun mime-edit-insert-text-file (file &optional _encoding)
  "Insert text FILE at point.
Optional argument ENCODING is ignored."
  (let ((tagend (1- (point))))		;End of the tag
    (save-restriction
      (narrow-to-region tagend (point))
      (insert-file-contents file)
      (goto-char (point-max)))
    (or (looking-at mime-edit-tag-regexp)
	(= (point)(point-max))
	(mime-edit-insert-tag "text" "plain"))))


;; Commands work on a current message flagment.

(defun mime-edit-goto-tag ()
  "Search for the beginning of the tagged MIME message."
  (let ((current (point)))
    (if (looking-at mime-edit-tag-regexp)
	t
      ;; At first, go to the end.
      (cond ((re-search-forward mime-edit-beginning-tag-regexp nil t)
	     (goto-char (1- (match-beginning 0))) ;For multiline tag
	     )
	    (t
	     (goto-char (point-max))))
      ;; Then search for the beginning.
      (re-search-backward mime-edit-end-tag-regexp nil t)
      (or (looking-at mime-edit-beginning-tag-regexp)
	  ;; Restore previous point.
	  (progn
	    (goto-char current)
	    nil)))))

(defun mime-edit-content-beginning ()
  "Return the point of the beginning of content."
  (save-excursion
    (let ((beg (save-excursion
		 (beginning-of-line) (point))))
      (if (mime-edit-goto-tag)
	  (let ((top (point)))
	    (goto-char (match-end 0))
	    (if (and (= beg top)
		     (= (following-char) ?\^M))
		(point)
	      (forward-line 1)
	      (point)))
	;; Default text/plain tag.
	(goto-char (point-min))
	(re-search-forward
	 (concat "\n" (regexp-quote mail-header-separator)
		 (if mime-ignore-preceding-spaces
		     "[ \t\n]*\n" "\n")) nil 'move)
	(point)))))

(defun mime-edit-content-end ()
  "Return the point of the end of content."
  (save-excursion
    (if (mime-edit-goto-tag)
	(progn
	  (goto-char (match-end 0))
	  (if (invisible-p (point))
	      (next-visible-point (point))
	    ;; Move to the end of this text.
	    (if (re-search-forward mime-edit-tag-regexp nil 'move)
		;; Don't forget a multiline tag.
		(goto-char (match-beginning 0)))
	    (point)))
      ;; Assume the message begins with text/plain.
      (goto-char (mime-edit-content-beginning))
      (if (re-search-forward mime-edit-tag-regexp nil 'move)
	  ;; Don't forget a multiline tag.
	  (goto-char (match-beginning 0)))
      (point))))

(defun mime-edit-define-charset (charset)
  "Set charset of current tag to CHARSET."
  (save-excursion
    (if (mime-edit-goto-tag)
	(let ((tag (buffer-substring (match-beginning 0) (match-end 0))))
	  (delete-region (match-beginning 0) (match-end 0))
	  (insert
	   (mime-create-tag
	    (mime-edit-set-parameter
	     (mime-edit-get-contype tag)
	     "charset"
	     (let ((comment (get charset 'mime-charset-comment)))
	       (if comment
		   (concat (upcase (symbol-name charset)) " (" comment ")")
		 (upcase (symbol-name charset)))))
	    (mime-edit-get-encoding tag)))))))

(defun mime-edit-define-encoding (encoding)
  "Set encoding of current tag to ENCODING."
  (save-excursion
    (if (mime-edit-goto-tag)
	(let ((tag (buffer-substring (match-beginning 0) (match-end 0))))
	  (delete-region (match-beginning 0) (match-end 0))
	  (insert (mime-create-tag (mime-edit-get-contype tag) encoding))))))

(defun mime-edit-choose-charset ()
  "Choose charset of a text following current point."
  (detect-mime-charset-region (point) (mime-edit-content-end)))

(defun mime-make-text-tag (&optional subtype)
  "Make a tag for a text after current point.
Subtype of text type can be specified by an optional argument SUBTYPE.
Otherwise, it is obtained from mime-content-types."
  (let* ((pritype "text")
	 (subtype (or subtype
		      (car (car (cdr (assoc pritype mime-content-types)))))))
    ;; Charset should be defined later.
    (mime-make-tag pritype subtype)))


;; Tag handling functions

(defun mime-make-tag (pritype subtype &optional parameters encoding)
  "Make a tag of MIME message of PRITYPE, SUBTYPE and optional PARAMETERS."
  (mime-create-tag (concat pritype "/" subtype parameters)
		   encoding))

(defun mime-create-tag (contype &optional encoding)
  "Make a tag with CONTENT-TYPE and optional ENCODING."
  (format (if encoding mime-tag-format-with-encoding mime-tag-format)
	  contype encoding))

(defun mime-edit-get-contype (tag)
  "Return Content-Type (including parameters) of TAG."
  (and (stringp tag)
       (or (string-match mime-edit-single-part-tag-regexp tag)
	   (string-match mime-edit-multipart-beginning-regexp tag)
	   (string-match mime-edit-multipart-end-regexp tag))
       (substring tag (match-beginning 1) (match-end 1))))

(defun mime-edit-get-encoding (tag)
  "Return encoding of TAG."
  (and (stringp tag)
       (string-match mime-edit-single-part-tag-regexp tag)
       (match-beginning 3)
       (not (= (match-beginning 3) (match-end 3)))
       (substring tag (match-beginning 3) (match-end 3))))

(defun mime-get-parameter (contype parameter)
  "For given CONTYPE return value for PARAMETER.
Nil if no such parameter."
  (if (string-match
       (concat
	";[ \t\n]*"
	(regexp-quote parameter)
	"[ \t\n]*=[ \t\n]*\\([^\" \t\n;]*\\|\"[^\"]*\"\\)\\([ \t\n]*;\\|$\\)")
       contype)
      (substring contype (match-beginning 1) (match-end 1))
    nil					;No such parameter
    ))

(defun mime-edit-set-parameter (contype parameter value)
  "For given CONTYPE set PARAMETER to VALUE."
  (let (ctype opt-fields)
    (if (string-match "\n[^ \t\n\r]+:" contype)
	(setq ctype (substring contype 0 (match-beginning 0))
	      opt-fields (substring contype (match-beginning 0)))
      (setq ctype contype))
    (if (string-match
	 (concat
	  ";[ \t\n]*\\("
	  (regexp-quote parameter)
	  "[ \t\n]*=[ \t\n]*\\([^\" \t\n;]*\\|\"[^\"]*\"\\)\\)[ \t\n]*\\(;\\|$\\)")
	 ctype)
	;; Change value
	(concat (substring ctype 0 (match-beginning 1))
		parameter "=" value
		(substring ctype (match-end 1))
		opt-fields)
      (concat ctype "; " parameter "=" value opt-fields)
      )))

(defun mime-strip-parameters (contype)
  "Return primary content-type and subtype without parameters for CONTYPE."
  (if (string-match "^[ \t]*\\([^; \t\n]*\\)" contype)
      (substring contype (match-beginning 1) (match-end 1)) nil))

(defun mime-test-content-type (contype type &optional subtype)
  "Test if CONTYPE is a TYPE and an optional SUBTYPE."
  (and (stringp contype)
       (stringp type)
       (string-match
	(concat "^[ \t]*" (downcase type) "/" (downcase (or subtype "")))
	(downcase contype))))


;; Basic functions

(defun mime-find-file-type (file)
  "Guess Content-Type, subtype, and parameters from FILE."
  (let ((guess nil)
	(guesses mime-file-types))
    (while (and (not guess) guesses)
      (if (string-match (car (car guesses)) file)
	  (setq guess (cdr (car guesses))))
      (setq guesses (cdr guesses)))
    guess))

(defun mime-prompt-for-type (&optional default)
  "Ask for Content-type."
  (let (type)
    ;; Repeat until primary content type is specified.
    (while (string=
	    (setq type
		  (completing-read
		   (apply 'concat "What content type: "
			  (when default `("(default " ,default ") ")))
		   mime-content-types
		   nil
		   'require-match ;Type must be specified.
		   nil
		   nil
		   default))
	    ""))
    type))

(defun mime-prompt-for-subtype (type &optional default)
  "Ask for subtype of media-type TYPE."
  (let ((subtypes (cdr (assoc type mime-content-types))))
    (or (and default
	     (assoc default subtypes))
	(setq default (car (car subtypes))))
    ;; default must be non-empty string.
    (completing-read
     (apply 'concat "What content subtype: "
	    (when default `("(default " ,default ") ")))
     subtypes
     nil
     'require-match		;Subtype must be specified.
     nil
     nil
     default)))

(defun mime-prompt-for-parameters (pritype subtype &optional delimiter)
  "Ask for Content-type parameters of Content-Type PRITYPE and SUBTYPE.
Optional DELIMITER specifies parameter delimiter (';' by default)."
  (let* ((delimiter (or delimiter "; "))
	 (parameters
	  (mapconcat
	   (function identity)
	   (delq nil
		 (mime-prompt-for-parameters-1
		  (cdr (assoc subtype
			      (cdr (assoc pritype mime-content-types))))))
	   delimiter)))
    (if (and (stringp parameters)
	     (not (string-equal parameters "")))
	(concat delimiter parameters)
      ""				;"" if no parameters
      )))

(defun mime-prompt-for-parameters-1 (optlist)
  (apply (function append)
	 (mapcar (function mime-prompt-for-parameter) optlist)))

(defun mime-prompt-for-parameter (parameter)
  "Ask for PARAMETER.
Parameter must be '(PROMPT CHOICE1 (CHOICE2...))."
  (let* ((prompt (car parameter))
	 (choices (mapcar (lambda (e)
			    (if (consp e) e (list e)))
			  (cdr parameter)))
	 (default (car (car choices)))
	 (answer nil))
    (setq answer
	  (if choices
	      (completing-read
	       (apply 'concat "What " prompt ": "
		      (unless (string-equal default "")
			`("(default " ,default ") ")))
	       choices nil nil nil nil default)
	    (read-string (concat "What " prompt ": "))))
    (cons (if (and answer
		   (not (string-equal answer "")))
	      (concat prompt "="
		      ;; Note: control characters ignored!
		      (if (string-match mime-tspecials-regexp answer)
			  (concat "\"" answer "\"") answer)))
	  (mime-prompt-for-parameters-1 (cdr (assoc answer (cdr parameter)))))))

(defun mime-prompt-for-encoding (&optional default)
  "Ask for Content-Transfer-Encoding."
  (let (encoding)
    (while (string=
	    (setq encoding
		  (completing-read
		   (apply 'concat "What transfer encoding: "
			  (when default `("(default " ,default ") ")))
		   (mime-encoding-alist)
		   nil
		   t
		   nil
		   nil
		   default))
	    ""))
    encoding))


;;; @ Translate the tagged MIME messages into a MIME compliant message.
;;;

(defvar mime-edit-translate-buffer-hook
  '(mime-edit-pgp-enclose-buffer
    mime-edit-translate-body
    mime-edit-translate-header))

(defun mime-edit-translate-header ()
  "Encode the message header into network representation."
  (mime-encode-header-in-buffer 'code-conversion)
  (run-hooks 'mime-edit-translate-header-hook))

(defun mime-edit-translate-buffer ()
  "Encode the tagged MIME message in current buffer in MIME compliant message."
  (interactive)
  (undo-boundary)
  (let ((modified-p (buffer-modified-p)))
    (condition-case error
	(save-excursion
	  (set-buffer-modified-p nil)
	  (run-hooks 'mime-edit-translate-buffer-hook)
	  (set-buffer-modified-p (or (buffer-modified-p) modified-p)))
      ((error quit)
       (if mime-edit-debug
	   (set-buffer-modified-p (or (buffer-modified-p) modified-p))
	 (when (buffer-modified-p)
	   (condition-case nil
	       (undo)
	     (error nil))
	   (set-buffer-modified-p modified-p)))
       (message "Translation failed")
       (signal (car error) (cdr error))))))

(defun mime-edit-find-inmost ()
  (goto-char (point-min))
  (if (re-search-forward mime-edit-multipart-beginning-regexp nil t)
      (let ((bb (match-beginning 0))
	    (be (match-end 0))
	    (type (buffer-substring (match-beginning 1)(match-end 1)))
	    end-exp eb)
	(setq end-exp (format "--}-<<%s>>\n" type))
	(widen)
	(if (re-search-forward end-exp nil t)
	    (setq eb (match-beginning 0))
	  (setq eb (point-max)))
	(narrow-to-region be eb)
	(goto-char be)
	(if (re-search-forward mime-edit-multipart-beginning-regexp nil t)
	    (progn
	      (narrow-to-region (match-beginning 0)(point-max))
	      (mime-edit-find-inmost))
	  (widen)
	  (list type bb be eb)))))

(defun mime-edit-process-multipart-1 (boundary)
  (let ((ret (mime-edit-find-inmost)))
    (if ret
	(let ((type (car ret))
	      (bb (nth 1 ret))(be (nth 2 ret))
	      (eb (nth 3 ret)))
	  (narrow-to-region bb eb)
	  (delete-region bb be)
	  (setq bb (point-min))
	  (setq eb (point-max))
	  (widen)
	  (goto-char eb)
	  (if (looking-at mime-edit-multipart-end-regexp)
	      (let ((beg (match-beginning 0))
		    (end (match-end 0)))
		(delete-region beg end)
		(or (looking-at mime-edit-beginning-tag-regexp)
		    (looking-at mime-edit-multipart-end-regexp)
		    (eobp)
		    (insert (mime-make-text-tag) "\n"))))
	  (cond ((string-equal type "quote")
		 (mime-edit-enquote-region bb eb))
		((string-equal type "pgp-signed")
		 (mime-edit-sign-pgp-mime bb eb boundary))
		((string-equal type "pgp-encrypted")
		 (mime-edit-encrypt-pgp-mime bb eb boundary))
		((string-equal type "smime-signed")
		 (mime-edit-sign-smime bb eb boundary))
		((string-equal type "smime-encrypted")
		 (mime-edit-encrypt-smime bb eb boundary))
		(t
		 (setq boundary
		       (nth 2 (mime-edit-translate-region bb eb
							    boundary t)))
		 (goto-char bb)
		 (insert
		  (format "--[[multipart/%s;
 boundary=\"%s\"][7bit]]\n"
			  type boundary))))
	  boundary))))

(defun mime-edit-enquote-region (beg end)
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char beg)
      (while (re-search-forward mime-edit-single-part-tag-regexp nil t)
	(let ((tag (buffer-substring (match-beginning 0)(match-end 0))))
	  (replace-match (concat "- " (substring tag 1))))))))

(defun mime-edit-dequote-region (beg end)
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char beg)
      (while (re-search-forward
	      mime-edit-quoted-single-part-tag-regexp nil t)
	(let ((tag (buffer-substring (match-beginning 0)(match-end 0))))
	  (replace-match (concat "-" (substring tag 2))))))))

(defun mime-edit-delete-trailing-whitespace ()
  (save-match-data
    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward "[ \t]+$" nil t)
	(delete-region (match-beginning 0) (match-end 0))))))

(defun mime-edit-pgp-keys-valid-key (key-list usage)
  "Return the first valid key for USAGE from KEY-LIST or nil
if there is no valid key.
KEY-LIST is a list of epg key object.
Secret key list couldn't be evaluated appropriately.
USAGE is a symbol denoting the intended usage."
  (catch 'found
    (while key-list
      (dolist (subkey (epg-key-sub-key-list (car key-list)))
	(when (and (memq usage (epg-sub-key-capability subkey))
		   ;; Validity of a secret key could not be gettable.
		   (epg-sub-key-validity subkey)
		   (not (memq (epg-sub-key-validity subkey)
			      mime-edit-pgp-filtered-validities)))
	  (throw 'found (car key-list))))
      (setq key-list (cdr key-list)))))

(defun mime-edit-pgp-get-signers (context)
  (let ((signer (cadr (std11-extract-address-components
		       (or (save-restriction
			     (widen)
			     (std11-field-body "From" mail-header-separator))
			   ""))))
	keys default-keys)
    (setq signer (and signer (concat "<" signer ">")))
    (if mime-edit-pgp-verbose
	(epa-select-keys
	 context
	 "\
Select keys for signing.
If no one is selected, default secret key is used.  "
	 (delq nil (cons signer mime-edit-pgp-signers))
	 t)
      (setq keys (epg-list-keys context signer))
      (when mime-edit-pgp-signers
	(setq default-keys
	      (apply #'nconc (mapcar (lambda (name)
				       (epg-list-keys context name))
				     mime-edit-pgp-signers)))
	(setq keys
	      (catch 'found
		(mapc (lambda (key)
			(and key
			     (member key keys)
			     (throw 'found (list key))))
		      default-keys)
		(delq nil (nconc keys default-keys)))))
      (list (mime-edit-pgp-keys-valid-key keys 'sign)))))

(unless-broken ccl-usable
(define-ccl-program mime-edit-normalize-eol-crlf
  '(2
    ((r1 = 0)
     (loop (read r0)
	   (if (r0 == ?\n)
	       (if (r1 != ?\r)
		   (write ?\r)))
	   (r1 = r0)
	   (write-repeat r0))))))

(defun mime-edit-sign-pgp-mime (beg end boundary)
  (save-excursion
    (save-restriction
      (let* ((ret (let ((mime-transfer-level 7))
		    (narrow-to-region beg end)
		    (mime-edit-translate-region beg end boundary)))
	     (ctype    (car ret))
	     (encoding (nth 1 ret))
	     (pgp-boundary (concat "pgp-sign-" boundary))
	     (context (epg-make-context))
	     signature micalg)
	(mime-edit-delete-trailing-whitespace) ; RFC3156
	(goto-char beg)
	(insert (format "Content-Type: %s\n" ctype))
	(if encoding
	    (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
	(insert "\n")
	(epg-context-set-armor context t)
	(epg-context-set-textmode context nil)
	(epg-context-set-signers
	 context
	 (mime-edit-pgp-get-signers context))
	(setq signature
	      (epg-sign-string
	       context
	       (if-broken ccl-usable
		   (let ((index (goto-char (point-min)))
			 plain)
		     (while (re-search-forward "\r?\n" nil t)
		       (setq plain (cons "\r\n"
					 (cons (buffer-substring
						index (match-beginning 0))
					       plain))
			     index (match-end 0)))
		     (apply 'concat (nreverse
				     (cons (buffer-substring index (point-max))
					   plain))))
		 (ccl-execute-on-string
		  'mime-edit-normalize-eol-crlf
		  (make-vector 9 0) (buffer-string)))
	       'detached))
	(setq micalg (epg-new-signature-digest-algorithm
		      (car (epg-context-result-for context 'sign))))
	(goto-char beg)
	(insert (format "--[[multipart/signed;
 boundary=\"%s\"%s;
 protocol=\"application/pgp-signature\"][7bit]]
--%s
"
			pgp-boundary
			(if micalg
			    (concat "; micalg=pgp-"
				    (downcase
				     (cdr (assq micalg
						epg-digest-algorithm-alist))))
			  "")
			pgp-boundary))
	(goto-char (point-max))
	(insert (format "\n--%s
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
Content-Description: OpenPGP Digital Signature

" pgp-boundary))
	(insert signature)
	(goto-char (point-max))
	(insert (format "\n--%s--\n" pgp-boundary))))))

(defun mime-edit-text-coding ()
  (save-excursion
    (let* ((tag
	    ;; Get tag string and set point to the beginnig of
	    ;; the content.
	    (or (and (re-search-backward
		      mime-edit-single-part-tag-regexp nil t)
		     (goto-char (match-end 0))
		     (buffer-substring (match-beginning 0) (match-end 0)))
		(progn (goto-char (point-min))
		       (re-search-forward
			(concat "\n" (regexp-quote mail-header-separator)
				(if mime-ignore-preceding-spaces
				    "[ \t\n]*\n" "\n")) nil t)
		       (mime-make-text-tag))))
	   (contype (mime-edit-get-contype tag))
	   (charset (mime-get-parameter contype "charset")))
      (setq charset (if charset (intern (downcase charset))
		      (mime-edit-choose-charset)))
      (mime-charset-to-coding-system charset))))

(defun mime-edit-sign-pgp-nonmime (start end signers mode)
  "Sign the current region between START and END by SIGNERS keys selected.
Appropriate coding system is selected automatically.
When called interactively, current mime part is signed."
  (interactive
   (progn
     (let ((mime-edit-pgp-verbose
	    (or current-prefix-arg mime-edit-pgp-verbose))
	   (context (epg-make-context epa-protocol)))
       (list (mime-edit-content-beginning)
	     (mime-edit-content-end)
	     (mime-edit-pgp-get-signers context)
	     (if mime-edit-pgp-verbose
		 (epa--read-signature-type)
	       'clear)))))
  (setq epa-last-coding-system-specified (mime-edit-text-coding))
  (epa-sign-region start end signers mode))

(defun mime-edit-encrypt-pgp-nonmime (start end recipients sign signers)
  "Encrypt the current region between START and END for RECIPIENTS.
Appropriate coding system is selected automatically.
When called interactively, current mime part is encrypted.
When SIGN is non-nil, also sign by SIGNERS keys selected."
  (interactive
   (let ((mime-edit-pgp-verbose
	  (or current-prefix-arg mime-edit-pgp-verbose))
	 (context (epg-make-context epa-protocol))
	 sign)
     (list (mime-edit-content-beginning)
	   (mime-edit-content-end)
	   (epa-select-keys context
			    "Select recipients for encryption.
If no one is selected, symmetric encryption will be performed.  ")
	   (setq sign (if mime-edit-pgp-verbose (y-or-n-p "Sign? ")))
	   (if sign
	       (epa-select-keys context
				"Select keys for signing.  ")))))
  (setq epa-last-coding-system-specified (mime-edit-text-coding))
  (epa-encrypt-region start end recipients sign signers))

(defvar mime-edit-encrypt-recipient-fields-list '("From" "To" "cc"))

(defun mime-edit-make-encrypt-recipient-header ()
  (let ((config (epg-configuration))
	(field-names (mapcar 'downcase
			     mime-edit-encrypt-recipient-fields-list))
	header recipients name value)
    (save-excursion
      (save-restriction
	(std11-narrow-to-header mail-header-separator)
	(goto-char (point-min))
	(while (re-search-forward
		(concat "^\\(" std11-field-name-regexp "\\):[ \t]*") nil t)
	  (when (member (downcase (match-string 1)) field-names)
	    (setq name (buffer-substring-no-properties
			(match-beginning 1) (match-end 1))
		  value (buffer-substring-no-properties
			 (match-end 0) (std11-field-end)))
	    (when (and (stringp value) (null (string-equal value "")))
	      (setq header (cons (format "%s: %s\n" name value) header))
	      (when (or mime-edit-pgp-encrypt-to-self
			(null (string-equal (downcase name) "from")))
		(setq recipients (cons (mapcar
					'std11-address-string
					(std11-parse-addresses-string value))
				       recipients))))))))
    (cons (apply #'nconc
		 (mapcar (lambda (recipient)
			   (or (epg-expand-group config recipient)
			       (list (concat "<" recipient ">"))))
			 (apply #'nconc recipients)))
	  (apply #'concat (nreverse header)))))

(defcustom mime-edit-encrypt-pgp-ignore-missing-keys 'ask
  "Define the behavior when no available key for recipient was found.
When value is ask, you are prompted whether proceed.
When value is nil, quit encryption and an an error is signaled.
When value is other non-nil, show only message and proceed."
  :group 'mime-edit-pgp
  :type '(choice
	  (const :tag "Ask user" ask)
	  (const :tag "Show message and proceed" t)
	  (const :tag "Stop encryption and raise error" nil)))

(defun mime-edit-encrypt-pgp-recipients-keys (context recipients)
  (delq
   nil
   (mapcar
    (lambda (name)
      (or (mime-edit-pgp-keys-valid-key
	   (epg-list-keys context name) 'encrypt)
	  (cond
	   ((eq mime-edit-encrypt-pgp-ignore-missing-keys 'ask)
	    (unless (y-or-n-p
		     (format
		      "No available encryption key for %s, proceed? " name))
	      (signal 'epg-error '(quit))))
	   (mime-edit-encrypt-pgp-ignore-missing-keys
	    (message "No available encryption key for %s" name)
	    (sit-for 1)
	    nil)
	   (t
	    (error "No available encryption key for %s" name)))))
    recipients)))

(defun mime-edit-encrypt-pgp-mime (beg end boundary)
  (save-excursion
    (save-restriction
      (let* ((ret (mime-edit-make-encrypt-recipient-header))
	     (recipients (car ret))
	     (header (cdr ret)))
        (narrow-to-region beg end)
        (let* ((ret
                (mime-edit-translate-region beg end boundary))
               (ctype    (car ret))
               (encoding (nth 1 ret))
               (pgp-boundary (concat "pgp-" boundary))
	       (context (epg-make-context))
	       cipher)
          (goto-char beg)
          (insert header)
          (insert (format "Content-Type: %s\n" ctype))
          (if encoding
              (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
          (insert "\n")
	  (mime-encode-header-in-buffer)
	  (epg-context-set-armor context t)
	  (setq recipients
		(if mime-edit-pgp-verbose
		    (epa-select-keys context "\
Select recipients for encryption.
If no one is selected, symmetric encryption will be performed.  "
				     recipients)
		  (mime-edit-encrypt-pgp-recipients-keys context recipients)))
	  (setq cipher
		(epg-encrypt-string
		 context
		 (buffer-substring (point-min) (point-max))
		 recipients))
	  (delete-region (point-min)(point-max))
	  (goto-char beg)
	  (insert (format "--[[multipart/encrypted;
 boundary=\"%s\";
 protocol=\"application/pgp-encrypted\"][7bit]]
--%s
Content-Type: application/pgp-encrypted

Version: 1

--%s
Content-Type: application/octet-stream
Content-Transfer-Encoding: 7bit

" pgp-boundary pgp-boundary pgp-boundary))
	  (insert cipher)
	  (goto-char (point-max))
	  (insert (format "\n--%s--\n" pgp-boundary)))))))

(defun mime-edit-convert-lbt-string (string)
  (let (inhibit-eol-conversion)
    (encode-coding-string string 'raw-text-dos)))

(defun mime-edit-sign-smime (beg end boundary)
  (save-excursion
    (save-restriction
      (let* ((from (std11-field-body "From" mail-header-separator))
	     (ret (progn 
		    (narrow-to-region beg end)
		    (mime-edit-translate-region beg end boundary)))
	     (ctype    (car ret))
	     (encoding (nth 1 ret))
	     (smime-boundary (concat "smime-sign-" boundary))
	     (context (epg-make-context 'CMS))
	     signature micalg)
	(goto-char beg)
	(insert (format "Content-Type: %s\n" ctype))
	(if encoding
	    (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
	(insert "\n")
	(epg-context-set-signers
	 context
	 (epa-select-keys
	  context
	  "\
Select keys for signing.
If no one is selected, default secret key is used.  "
	  (if from 
	      (list (nth 1 (std11-extract-address-components from))))
	  t))
	(setq signature
	      (epg-sign-string context
			       (mime-edit-convert-lbt-string
				(buffer-substring (point-min) (point-max)))
			       'detached))
	(setq micalg (epg-new-signature-digest-algorithm
		      (car (epg-context-result-for context 'sign))))
	(goto-char beg)
	(insert (format "--[[multipart/signed;
 boundary=\"%s\"%s;
 protocol=\"application/pkcs7-signature\"][7bit]]
--%s
"
			smime-boundary
			(if micalg
			    (concat "; micalg="
				    (downcase
				     (cdr (assq micalg
						epg-digest-algorithm-alist))))
			  "")
			smime-boundary))
	(goto-char (point-max))
	(insert (format "\n--%s
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s
Content-Description: S/MIME Digital Signature

" smime-boundary)
		(base64-encode-string signature))))))

(defun mime-edit-encrypt-smime (beg end boundary)
  (save-excursion
    (save-restriction
      (let* ((ret (mime-edit-make-encrypt-recipient-header))
	     (recipients (car ret))
	     (header (cdr ret)))
        (narrow-to-region beg end)
        (let* ((ret
                (mime-edit-translate-region beg end boundary))
               (ctype    (car ret))
               (encoding (nth 1 ret))
	       (context (epg-make-context 'CMS))
	       cipher)
          (goto-char beg)
          (insert header)
          (insert (format "Content-Type: %s\n" ctype))
          (if encoding
              (insert (format "Content-Transfer-Encoding: %s\n" encoding)))
          (insert "\n")
	  (mime-encode-header-in-buffer)
	  (setq cipher
		(epg-encrypt-string
		 context
		 (buffer-substring (point-min) (point-max))
		 (epa-select-keys
		  context
		  "\
Select recipients for encryption.
If no one is selected, symmetric encryption will be performed.  "
		  recipients)))
	  (delete-region (point-min)(point-max))
	  (goto-char beg)
	  (insert (format "--[[application/pkcs7-mime;
 smime-type=enveloped-data;
 name=smime.p7m
Content-Disposition: attachment; filename=smime.p7m][base64]]

")
		  (base64-encode-string cipher)))))))

(defsubst replace-space-with-underline (str)
  (mapconcat (lambda (arg)
	       (list
		(if (eq arg ?\ )
		    ?_
		  arg))) str nil))

(defun mime-edit-make-boundary ()
  (concat mime-multipart-boundary "_"
	  (replace-space-with-underline (current-time-string))))

(defun mime-edit-translate-body ()
  "Encode the tagged MIME body in current buffer in MIME compliant message."
  (interactive)
  (save-excursion
    (let ((boundary (mime-edit-make-boundary))
	  (i 1)
	  ret)
      (while (mime-edit-process-multipart-1
	      (format "%s-%d" boundary i))
	(setq i (1+ i)))
      (save-restriction
	;; We are interested in message body.
	(let* ((beg
		(progn
		  (goto-char (point-min))
		  (re-search-forward
		   (concat "\n" (regexp-quote mail-header-separator)
			   (if mime-ignore-preceding-spaces
			       "[ \t\n]*\n" "\n")) nil 'move)
		  (point)))
	       (end
		(progn
		  (goto-char (point-max))
		  (and mime-ignore-trailing-spaces
		       (re-search-backward "[^ \t\n]\n" beg t)
		       (forward-char 1))
		  (point))))
	  (setq ret (mime-edit-translate-region
		     beg end
		     (format "%s-%d" boundary i)))))
      (mime-edit-dequote-region (point-min)(point-max))
      (let ((contype (car ret))		;Content-Type
	    (encoding (nth 1 ret))	;Content-Transfer-Encoding
	    )
	;; Insert User-Agent field
	(and mime-edit-insert-user-agent-field
	     (or (mail-position-on-field "User-Agent")
		 (insert mime-edit-user-agent-value)))
	;; Make primary MIME headers.
	(or (mail-position-on-field "MIME-Version")
	    (insert mime-edit-mime-version-value))
	;; Remove old Content-Type and other fields.
	(save-restriction
	  (goto-char (point-min))
	  (search-forward (concat "\n" mail-header-separator "\n") nil t)
	  (narrow-to-region (point-min) (point))
	  (goto-char (point-min))
	  (mime-delete-field "Content-Type")
	  (mime-delete-field "Content-Transfer-Encoding"))
	;; Then, insert Content-Type and Content-Transfer-Encoding fields.
	(mail-position-on-field "Content-Type")
	(insert contype)
	(if encoding
	    (progn
	      (mail-position-on-field "Content-Transfer-Encoding")
	      (insert encoding)))))))

(defun mime-edit-translate-single-part-tag (boundary &optional prefix)
  "Translate single-part-tag to MIME header."
  (if (re-search-forward mime-edit-single-part-tag-regexp nil t)
      (let* ((beg (match-beginning 0))
	     (end (match-end 0))
	     (tag (buffer-substring beg end)))
	(delete-region beg end)
	(let ((contype (mime-edit-get-contype tag))
	      (encoding (mime-edit-get-encoding tag)))
	  (insert (or prefix "") "--" boundary "\n")
	  (save-restriction
	    (narrow-to-region (point)(point))
	    (insert "Content-Type: " contype "\n")
	    (if encoding
		(insert "Content-Transfer-Encoding: " encoding "\n"))
	    (mime-encode-header-in-buffer))
	  (cons (and contype
		     (downcase contype))
		(and encoding
		     (downcase encoding)))))))

(defun mime-edit-translate-region (beg end &optional boundary multipart)
  (or boundary
      (setq boundary (mime-edit-make-boundary)))
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (let ((tag nil)			;MIME tag
	    (contype nil)		;Content-Type
	    (encoding nil)		;Content-Transfer-Encoding
	    (nparts 0))			;Number of body parts
	;; Normalize the body part by inserting appropriate message
	;; tags for every message contents.
	(mime-edit-normalize-body)
	;; Counting the number of Content-Type.
	(goto-char (point-min))
	(while (re-search-forward mime-edit-single-part-tag-regexp nil t)
	  (setq nparts (1+ nparts)))
	;; Begin translation.
	(cond
	 ((and (<= nparts 1)(not multipart))
	  ;; It's a singular message.
	  (goto-char (point-min))
	  (while (re-search-forward
		  mime-edit-single-part-tag-regexp nil t)
	    (setq tag
		  (buffer-substring (match-beginning 0) (match-end 0)))
	    (delete-region (match-beginning 0) (1+ (match-end 0)))
	    (setq contype (mime-edit-get-contype tag))
	    (setq encoding (mime-edit-get-encoding tag))))
	 (t
	  ;; It's a multipart message.
	  (goto-char (point-min))
	  (let ((prio mime-content-transfer-encoding-priority-list)
		part-info nprio)
	    (when (setq part-info
			(mime-edit-translate-single-part-tag boundary))
	      (and (setq nprio (member (cdr part-info) prio))
		   (setq prio nprio))
	      (while (setq part-info
			   (mime-edit-translate-single-part-tag boundary "\n"))
		(and (setq nprio (member (cdr part-info) prio))
		     (setq prio nprio))))
	    ;; Define Content-Type as "multipart/mixed".
	    (setq contype
		  (concat "multipart/mixed;\n boundary=\"" boundary "\""))
	    (setq encoding (car prio))
	    ;; Insert the trailer.
	    (goto-char (point-max))
	    (insert "\n--" boundary "--\n"))))
	 (list contype encoding boundary nparts)))))

(defun mime-edit-normalize-body ()
  "Normalize the body part by inserting appropriate message tags."
  ;; Insert the first MIME tags if necessary.
  (goto-char (point-min))
  (if (not (looking-at mime-edit-single-part-tag-regexp))
      (insert (mime-make-text-tag) "\n"))
  ;; Check each tag, and add new tag or correct it if necessary.
  (goto-char (point-min))
  (while (re-search-forward mime-edit-single-part-tag-regexp nil t)
    (let* ((tag (buffer-substring (match-beginning 0) (match-end 0)))
	   (contype (mime-edit-get-contype tag))
	   (charset (mime-get-parameter contype "charset"))
	   (encoding (mime-edit-get-encoding tag)))
      ;; Remove extra whitespaces after the tag.
      (if (looking-at "[ \t]+$")
	  (delete-region (match-beginning 0) (match-end 0)))
      (let ((beg (point))
	    (end (mime-edit-content-end)))
	(if (= end (point-max))
	    nil
	  (goto-char end)
	  (or (looking-at mime-edit-beginning-tag-regexp)
	      (eobp)
	      (insert (mime-make-text-tag) "\n")))
	(visible-region beg end)
	(goto-char beg))
      (cond
       ((mime-test-content-type contype "message")
	;; Content-type "message" should be sent as is.
	(forward-line 1))
       ((mime-test-content-type contype "text")
	;; Define charset for text.
	(setq charset
	      (cond
	       ;; charset is explicitly defined.
	       (charset
		(intern (downcase charset)))
	       ;; Encoded (inserted text file).
	       (encoding
		(let* ((string
			(mime-decode-string
			 (buffer-substring (point) (mime-edit-content-end))
			 encoding))
		       (coding (detect-coding-string string t)))
		  (or (coding-system-to-mime-charset coding)
		      (detect-mime-charset-string string))))
	       ;; Inputted directly or reeditting.
	       (t
		(mime-edit-choose-charset))))
	(mime-edit-define-charset charset)
	(cond ((string-equal contype "text/x-rot13-47-48")
	       (save-excursion
		 (forward-line)
		 (mule-caesar-region (point) (mime-edit-content-end))))
	      ((string-equal contype "text/enriched")
	       (save-excursion
		 (let ((beg (progn
			      (forward-line)
			      (point)))
		       (end (mime-edit-content-end)))
		   ;; Patch for hard newlines
                   ;; (save-excursion
                   ;;   (goto-char beg)
                   ;;   (while (search-forward "\n" end t)
                   ;;     (put-text-property (match-beginning 0)
                   ;;                        (point)
                   ;;                        'hard t)))
		   ;; End patch for hard newlines
		   (enriched-encode beg end nil)
		   (goto-char beg)
		   (if (search-forward "\n\n")
		       (delete-region beg (match-end 0)))))))
	;; Point is now on current tag.
	;; Define encoding and encode text if necessary.
	(or encoding	;Encoding is not specified.
	    (let* ((encoding
		    (let (bits conv)
		      (let ((ret (cdr (assq charset mime-charset-type-list))))
			(if ret
			    (setq bits (car ret)
				  conv (nth 1 ret))
			  (setq bits 8
				conv "quoted-printable")))
		      (if (<= bits mime-transfer-level)
			  (mime-encoding-name bits)
			conv)))
		   (beg (mime-edit-content-beginning)))
	      (encode-mime-charset-region beg (mime-edit-content-end)
					  charset)
	      ;; Protect "From " in beginning of line
	      (save-restriction
		(narrow-to-region beg (mime-edit-content-end))
		(goto-char beg)
		(let (case-fold-search)
		  (if (re-search-forward "^From " nil t)
		      (unless encoding
			(if (memq charset '(iso-2022-jp
					    iso-2022-jp-2
					    iso-2022-int-1
					    x-ctext))
			    (while (progn
				     (replace-match "\e(BFrom ")
				     (re-search-forward "^From " nil t)))
			  (setq encoding "quoted-printable"))))))
	      ;; canonicalize line break code
	      (or (member encoding '(nil "7bit" "8bit" "quoted-printable"))
		  (save-restriction
		    (narrow-to-region beg (mime-edit-content-end))
		    (goto-char beg)
		    (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t)
		      ;; In a certain period, `replace-match' with "\\N"
		      ;; converted 8-bit characters into multibyte string,
		      ;; but it has been fixed at 2004-01-15.
		      ;;(replace-match "\\1\r\n"))))
		      (backward-char 1)
		      (insert "\r")
		      (forward-char 1))))
	      (goto-char beg)
	      (mime-encode-region beg (mime-edit-content-end)
				  (or encoding "7bit"))
	      (mime-edit-define-encoding encoding)))
	(goto-char (mime-edit-content-end)))
       ((null encoding)		;Encoding is not specified.
	;; Application, image, audio, video, and any other
	;; unknown content-type without encoding should be
	;; encoded.
	(let* ((encoding "base64")	;Encode in BASE64 by default.
	       (beg (mime-edit-content-beginning))
	       (end (mime-edit-content-end)))
	  (mime-encode-region beg end encoding)
	  (mime-edit-define-encoding encoding))
	(forward-line 1))))))

(defun mime-delete-field (field)
  "Delete header FIELD."
  (let ((regexp (format "^%s:[ \t]*" field)))
    (goto-char (point-min))
    (while (re-search-forward regexp nil t)
      (delete-region (match-beginning 0)
		     (1+ (std11-field-end))))))


;;;
;;; Platform dependent functions
;;;

;; Sun implementations

(defun mime-edit-voice-recorder-for-sun (encoding)
  "Record voice in a buffer using Sun audio device,
and insert data encoded as ENCODING."
  (message "Start the recording on %s.  Type C-g to finish the recording..."
	   (system-name))
  (mime-insert-encoded-file "/dev/audio" encoding))


;;; @ Other useful commands.
;;;

;; Message forwarding commands as content-type "message/rfc822".

(defun mime-edit-insert-message (&optional message)
  (interactive)
  (let ((inserter (cdr (assq major-mode mime-edit-message-inserter-alist))))
    (if (and inserter (fboundp inserter))
	(progn
	  (mime-edit-insert-tag "message" "rfc822")
	  (funcall inserter message))
      (message "Sorry, I don't have message inserter for your MUA."))))

(defun mime-edit-insert-mail (&optional message)
  (interactive)
  (let ((inserter (cdr (assq major-mode mime-edit-mail-inserter-alist))))
    (if (and inserter (fboundp inserter))
	(progn
	  (mime-edit-insert-tag "message" "rfc822")
	  (funcall inserter message))
      (message "Sorry, I don't have mail inserter for your MUA."))))

(defun mime-edit-inserted-message-filter ()
  (save-excursion
    (save-restriction
      (let ((header-start (point))
	    (case-fold-search t)
	    beg end)
	;; for Emacs 18
	;; (if (re-search-forward "^$" (marker-position (mark-marker)))
	(if (re-search-forward "^$" (mark t))
	    (narrow-to-region header-start (match-beginning 0)))
	(goto-char header-start)
	(while (and (re-search-forward
		     mime-edit-yank-ignored-field-regexp nil t)
		    (setq beg (match-beginning 0))
		    (setq end (1+ (std11-field-end))))
	  (delete-region beg end))))))


;;; @ multipart enclosure
;;;

(defun mime-edit-enclose-region-internal (type beg end)
  (save-excursion
    (goto-char beg)
    (save-restriction
      (narrow-to-region beg end)
      (insert (format "--<<%s>>-{\n" type))
      (goto-char (point-max))
      (insert (format "--}-<<%s>>\n" type))
      (goto-char (point-max)))
    (or (looking-at mime-edit-beginning-tag-regexp)
	(eobp)
	(insert (mime-make-text-tag) "\n"))))

(defun mime-edit-enclose-quote-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'quote beg end))

(defun mime-edit-enclose-mixed-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'mixed beg end))

(defun mime-edit-enclose-parallel-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'parallel beg end))

(defun mime-edit-enclose-digest-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'digest beg end))

(defun mime-edit-enclose-alternative-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'alternative beg end))

(defun mime-edit-enclose-pgp-signed-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'pgp-signed beg end))

(defun mime-edit-enclose-pgp-encrypted-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'pgp-encrypted beg end))

(defun mime-edit-enclose-smime-signed-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'smime-signed beg end))

(defun mime-edit-enclose-smime-encrypted-region (beg end)
  (interactive "*r")
  (mime-edit-enclose-region-internal 'smime-encrypted beg end))

(defun mime-edit-insert-key (&optional _arg)
  "Insert a pgp public key."
  (interactive "P")
  (mime-edit-insert-tag "application" "pgp-keys")
  (mime-edit-define-encoding "7bit")
  (let ((context (epg-make-context)))
    (epg-context-set-armor context t)
    (insert (epg-export-keys-to-string
	     context (epa-select-keys context "Select keys for export.  "))))
  (if (and (not (eobp))
	   (not (looking-at mime-edit-single-part-tag-regexp)))
      (insert (mime-make-text-tag) "\n")))


;;; @ flag setting
;;;

(defun mime-edit-set-split (arg)
  (interactive
   (list
    (y-or-n-p "Do you want to enable split? ")))
  (setq mime-edit-split-message arg)
  (if arg
      (message "This message is enabled to split.")
    (message "This message is not enabled to split.")))

(defun mime-edit-toggle-transfer-level (&optional transfer-level)
  "Toggle transfer-level is 7bit or 8bit through.

Optional TRANSFER-LEVEL is a number of transfer-level, 7 or 8."
  (interactive)
  (if (numberp transfer-level)
      (setq mime-transfer-level transfer-level)
    (if (< mime-transfer-level 8)
	(setq mime-transfer-level 8)
      (setq mime-transfer-level 7)))
  (message (format "Current transfer-level is %d bit"
		   mime-transfer-level))
  (setq mime-transfer-level-string
	(mime-encoding-name mime-transfer-level 'not-omit))
  (force-mode-line-update))

(defun mime-edit-set-transfer-level-7bit ()
  (interactive)
  (mime-edit-toggle-transfer-level 7))

(defun mime-edit-set-transfer-level-8bit ()
  (interactive)
  (mime-edit-toggle-transfer-level 8))


;;; @ pgp
;;;

(defvar mime-edit-pgp-processing nil)
(make-variable-buffer-local 'mime-edit-pgp-processing)

(defun mime-edit-set-sign (arg)
  (interactive
   (list
    (y-or-n-p "Do you want to sign? ")))
  (if arg
      (progn
	(or (memq 'sign mime-edit-pgp-processing)
	    (setq mime-edit-pgp-processing 
		  (nconc mime-edit-pgp-processing 
			 (copy-sequence '(sign)))))
	(message "This message will be signed."))
    (setq mime-edit-pgp-processing 
	  (delq 'sign mime-edit-pgp-processing))
    (message "This message will not be signed.")))

(defun mime-edit-set-encrypt (arg)
  (interactive
   (list
    (y-or-n-p "Do you want to encrypt? ")))
  (if arg
      (progn
	(or (memq 'encrypt mime-edit-pgp-processing)
	    (setq mime-edit-pgp-processing 
		  (nconc mime-edit-pgp-processing 
			 (copy-sequence '(encrypt)))))
	(message "This message will be encrypted."))
    (setq mime-edit-pgp-processing
	  (delq 'encrypt mime-edit-pgp-processing))
    (message "This message will not be encrypted.")))

(defun mime-edit-pgp-enclose-buffer ()
  (let ((beg (save-excursion
	       (goto-char (point-min))
	       (if (search-forward (concat "\n" mail-header-separator "\n"))
		   (match-end 0)))))
    (when beg
      (if (memq 'sign mime-edit-pgp-processing)
	  (mime-edit-enclose-pgp-signed-region beg (point-max)))
      (if (memq 'encrypt mime-edit-pgp-processing)
	  (mime-edit-enclose-pgp-encrypted-region beg (point-max))))))

;;; @ split
;;;

(defun mime-edit-insert-partial-header (fields subject
					       id number total separator)
  (insert fields)
  (insert (format "Subject: %s (%d/%d)\n" subject number total))
  (insert mime-edit-mime-version-field-for-message/partial)
  (insert (format "\
Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
		  id number total separator)))

(defun mime-edit-split-and-send
  (&optional cmd lines mime-edit-message-max-length)
  (interactive)
  (or lines
      (setq lines
	    (count-lines (point-min) (point-max))))
  (or mime-edit-message-max-length
      (setq mime-edit-message-max-length
	    (or (cdr (assq major-mode mime-edit-message-max-lines-alist))
		mime-edit-message-default-max-lines)))
  (let ((separator mail-header-separator)
	(id (concat "\""
		    (replace-space-with-underline (current-time-string))
		    "@" (system-name) "\"")))
    (run-hooks 'mime-edit-before-split-hook)
    (let ((the-buf (current-buffer))
	  (copy-buf (get-buffer-create " *Original Message*"))
	  (header (std11-header-string-except
		   mime-edit-split-ignored-field-regexp separator))
	  (subject (mail-fetch-field "subject"))
	  (total (+ (/ lines mime-edit-message-max-length)
		    (if (> (mod lines mime-edit-message-max-length) 0)
			1)))
	  (command
	   (or cmd
	       (cdr
		(assq major-mode
		      mime-edit-split-message-sender-alist))
	       (lambda ()
		 (interactive)
		 (error "Split sender is not specified for `%s'." major-mode))))
	  (mime-edit-partial-number 1)
	  data)
      (with-current-buffer copy-buf
	(erase-buffer)
	(insert-buffer-substring the-buf)
	(goto-char (point-min))
	(save-restriction
	  (if (re-search-forward
	       (concat "^" (regexp-quote separator) "$") nil t)
	      (let ((he (match-beginning 0)))
		(replace-match "")
		(narrow-to-region (point-min) he)))
	  (goto-char (point-min))
	  (while (re-search-forward mime-edit-split-blind-field-regexp nil t)
	    (delete-region (match-beginning 0)
			   (1+ (std11-field-end))))))
      (while (< mime-edit-partial-number total)
	(erase-buffer)
	(with-current-buffer copy-buf
	  (setq data (buffer-substring
		      (point-min)
		      (progn
			(goto-char (point-min))
			(forward-line (1- mime-edit-message-max-length))
			(point))))
	  (delete-region (point-min)(point)))
	(mime-edit-insert-partial-header
	 header subject id mime-edit-partial-number total separator)
	(insert data)
	(save-excursion
	  (message (format "Sending %d/%d..."
			   mime-edit-partial-number total))
	  (call-interactively command)
	  (message (format "Sending %d/%d...done"
			   mime-edit-partial-number total)))
	(setq mime-edit-partial-number
	      (1+ mime-edit-partial-number)))
      (erase-buffer)
      (with-current-buffer copy-buf
	(setq data (buffer-string))
	(erase-buffer))
      (mime-edit-insert-partial-header
       header subject id mime-edit-partial-number total separator)
      (insert data)
      (save-excursion
	(message (format "Sending %d/%d..."
			 mime-edit-partial-number total))
	(message (format "Sending %d/%d...done"
			 mime-edit-partial-number total))))))

(defun mime-edit-maybe-split-and-send (&optional cmd)
  (interactive)
  (run-hooks 'mime-edit-before-send-hook)
  (let ((mime-edit-message-max-length
	 (or (cdr (assq major-mode mime-edit-message-max-lines-alist))
	     mime-edit-message-default-max-lines))
	(lines (count-lines (point-min) (point-max))))
    (if (and (> lines mime-edit-message-max-length)
	     mime-edit-split-message)
	(mime-edit-split-and-send cmd lines mime-edit-message-max-length))))


;;; @ preview message
;;;

(defvar mime-edit-buffer nil) ; buffer local variable
(defvar mime-edit-temp-message-buffer nil) ; buffer local variable

(defun mime-edit-preview-message ()
  "preview editing MIME message."
  (interactive)
  (let* ((str (buffer-string))
	 (separator mail-header-separator)
	 (the-buf (current-buffer))
	 (buf-name (buffer-name))
	 (temp-buf-name (concat "*temp-article:" buf-name "*"))
	 (buf (get-buffer temp-buf-name))
	 (pgp-processing mime-edit-pgp-processing))
    (if buf
	(progn
	  (switch-to-buffer buf)
	  (erase-buffer))
      (setq buf (get-buffer-create temp-buf-name))
      (switch-to-buffer buf))
    (insert str)
    (setq major-mode 'mime-temp-message-mode)
    (make-local-variable 'mail-header-separator)
    (setq mail-header-separator separator)
    (make-local-variable 'mime-edit-buffer)
    (setq mime-edit-buffer the-buf)
    (setq mime-edit-pgp-processing pgp-processing)

    (run-hooks 'mime-edit-translate-hook)
    (condition-case error
	(mime-edit-translate-buffer)
      ((error quit)
       (switch-to-buffer the-buf)
       (unless mime-edit-debug
	 (kill-buffer buf))
       (signal (car error) (cdr error))))
    (goto-char (point-min))
    (if (re-search-forward
	 (concat "^" (regexp-quote separator) "$"))
	(replace-match ""))
    (mime-view-buffer)
    (make-local-variable 'mime-edit-temp-message-buffer)
    (setq mime-edit-temp-message-buffer buf)))

(defun mime-edit-quitting-method ()
  "Quitting method for mime-view."
  (let* ((temp mime-edit-temp-message-buffer)
	 buf)
    (mime-preview-kill-buffer)
    (set-buffer temp)
    (setq buf mime-edit-buffer)
    (kill-buffer temp)
    (switch-to-buffer buf)))

(set-alist 'mime-preview-quitting-method-alist
	   'mime-temp-message-mode
	   #'mime-edit-quitting-method)


;;; @ edit again
;;;

(defvar mime-edit-again-ignored-field-regexp
  (concat "^\\(" "Content-.*\\|Mime-Version"
	  (if mime-edit-insert-user-agent-field "\\|User-Agent")
	  "\\):")
  "Regexp for deleted header fields when `mime-edit-again' is called.")

(defsubst eliminate-top-spaces (string)
  "Eliminate top sequence of space or tab in STRING."
  (if (string-match "^[ \t]+" string)
      (substring string (match-end 0))
    string))

(defun mime-edit-decode-multipart-in-buffer (content-type not-decode-text)
  (let* ((subtype
	  (or
	   (cdr (assoc (mime-content-type-parameter content-type "protocol")
		       '(("application/pgp-encrypted" . pgp-encrypted)
			 ("application/pgp-signature" . pgp-signed))))
	   (mime-content-type-subtype content-type)))
	 (boundary (mime-content-type-parameter content-type "boundary"))
	 (boundary-pat (concat "\n--" (regexp-quote boundary) "[ \t]*\n")))
    (re-search-forward boundary-pat nil t)
    (let ((bb (match-beginning 0)) eb tag)
      (setq tag (format "\n--<<%s>>-{\n" subtype))
      (goto-char bb)
      (insert tag)
      (setq bb (+ bb (length tag)))
      (re-search-forward
       (concat "\n--" (regexp-quote boundary) "--[ \t]*\n")
       nil t)
      (setq eb (match-beginning 0))
      (replace-match (format "--}-<<%s>>\n" subtype))
      (save-restriction
	(narrow-to-region bb eb)
	(goto-char (point-min))
	(while (re-search-forward boundary-pat nil t)
	  (let ((beg (match-beginning 0))
		end)
	    (delete-region beg (match-end 0))
	    (save-excursion
	      (if (re-search-forward boundary-pat nil t)
		  (setq end (match-beginning 0))
		(setq end (point-max)))
	      (save-restriction
		(narrow-to-region beg end)
		(cond
		 ((eq subtype 'pgp-encrypted)
		  (when (progn
			   (goto-char (point-min))
			   (re-search-forward "^-+BEGIN PGP MESSAGE-+$"
					      nil t))
		    (insert (epg-decrypt-string
			     (epg-make-context)
			     (buffer-substring (match-beginning 0)
					       (point-max))))
		    (delete-region (point)(point-max))
		    (mime-edit-decode-message-in-buffer 
		     nil not-decode-text)
		    (delete-region (goto-char (point-min))
				   (if (search-forward "\n\n" nil t)
				       (match-end 0)
				     (point-min)))
		    (goto-char (point-max))))
		 (t 
		  (mime-edit-decode-message-in-buffer
		   (if (eq subtype 'digest)
		       (eval-when-compile
			 (make-mime-content-type 'message 'rfc822)))
		   not-decode-text)
		  (goto-char (point-max))))))))))
    (goto-char (point-min))
    (or (= (point-min) 1)
	(delete-region (point-min)
		       (if (search-forward "\n\n" nil t)
			   (match-end 0)
			 (point-min))))))

(defun mime-edit-decode-single-part-in-buffer
  (content-type not-decode-text &optional content-disposition)
  (let* ((type (mime-content-type-primary-type content-type))
	 (subtype (mime-content-type-subtype content-type))
	 (ctype (format "%s/%s" type subtype))
	 charset
	 (pstr
	  (let ((bytes (+ 14 (length ctype))))
	    (mapconcat
	     (lambda (attr)
	       (if (string= (car attr) "charset")
		   (progn
		     (setq charset (cdr attr))
		     nil)
		 (let*
		     ((str
		       (concat
			(car attr)
			"="
			(if (string= "name"
				     (car attr))
			    (std11-wrap-as-quoted-string
			     (eword-decode-and-unfold-unstructured-field-body
			      (cdr attr)))
			  (cdr attr))))
		      (bs (length str)))
		   (setq bytes (+ bytes bs 2))
		   (if (< bytes 76)
		       (concat "; " str)
		     (setq bytes (+ bs 1))
		     (concat ";\n " str)
		     ))))
	     (mime-content-type-parameters content-type) nil)))
	 encoding
	 encoded
	 (limit (save-excursion
		  (if (search-forward "\n\n" nil t)
		      (1- (point)))))
	 (disposition-type
	  (mime-content-disposition-type content-disposition))
	 (disposition-str
	  (if disposition-type
	      (let ((bytes (+ 21 (length (format "%s" disposition-type)))))
		(mapconcat (lambda (attr)
			     (let* ((str (concat
					  (car attr)
					  "="
					  (if (string-equal "filename"
							    (car attr))
					      (std11-wrap-as-quoted-string
					       (eword-decode-and-unfold-unstructured-field-body
						(cdr attr)))
					    (cdr attr))))
				    (bs (length str)))
			       (setq bytes (+ bytes bs 2))
			       (if (< bytes 76)
				   (concat "; " str)
				 (setq bytes (+ bs 1))
				 (concat ";\n " str)
				 )))
			   (mime-content-disposition-parameters
			    content-disposition)
			   nil)))))
    (if disposition-type
	(setq pstr (format "%s\nContent-Disposition: %s%s"
			   pstr disposition-type disposition-str)))
    (mapc (lambda (field)
	    (save-excursion
	      (when (re-search-forward (concat "^" field ":") limit t)
		(setq pstr (concat
			    pstr "\n" field ": "
			    (eliminate-top-spaces
			     (std11-unfold-string
			      (buffer-substring (match-end 0)
						(std11-field-end limit)))))))))
	  '("Content-Id" "Content-Language" "Content-Translation-Type"))
    (save-excursion
      (if (re-search-forward
	   "^Content-Transfer-Encoding:" limit t)
	  (let ((beg (match-beginning 0))
		(hbeg (match-end 0))
		(end (std11-field-end limit)))
	    (setq encoding
		  (downcase
		   (eliminate-top-spaces
		    (std11-unfold-string
		     (buffer-substring hbeg end)))))
	    (if (or charset (eq type 'text))
		(progn
		  (delete-region beg (1+ end))
		  (goto-char (point-min))
		  (if (search-forward "\n\n" nil t)
		      (progn
			(mime-decode-region
			 (match-end 0)(point-max) encoding)
			(setq encoded t
			      encoding nil))))))))
    (if (and (eq type 'text)
	     (or encoded (not not-decode-text)))
 	(progn
 	  (save-excursion
 	    (goto-char (point-min))
 	    (while (re-search-forward "\r\n" nil t)
 	      (replace-match "\n")))
 	  (decode-mime-charset-region (point-min)(point-max)
 				      (or charset default-mime-charset))))
    (let ((he (if (re-search-forward "^$" nil t)
		  (match-end 0)
		(point-min))))
      (if (and (eq type 'text)
	       (eq subtype 'x-rot13-47-48))
	  (mule-caesar-region he (point-max)))
      (if (= (point-min) 1)
	  (progn
	    (goto-char he)
	    (insert "\n"
		    (mime-create-tag
		     (format "%s/%s%s" type subtype pstr) encoding)))
	(delete-region (point-min) he)
	(insert
	 (mime-create-tag (format "%s/%s%s" type subtype pstr)
			  encoding))))))

;;;###autoload
(defun mime-edit-decode-message-in-buffer (&optional default-content-type
						     not-decode-text)
  (save-excursion
    (goto-char (point-min))
    (let ((ctl (or (mime-read-Content-Type)
		   default-content-type)))
      (if ctl
	  (let ((type (mime-content-type-primary-type ctl)))
	    (cond
	     ((and (eq type 'application)
		   (eq (mime-content-type-subtype ctl) 'pgp-signature))
	      (delete-region (point-min)(point-max)))
	     ((eq type 'multipart)
	      (mime-edit-decode-multipart-in-buffer ctl not-decode-text))
	     (t
	      (mime-edit-decode-single-part-in-buffer
	       ctl not-decode-text (mime-read-Content-Disposition)))))
	(or not-decode-text
	    (decode-mime-charset-region (point-min) (point-max)
					default-mime-charset)))
      (if (= (point-min) 1)
	  (progn
	    (save-restriction
	      (std11-narrow-to-header)
	      (goto-char (point-min))
	      (while (re-search-forward
		      mime-edit-again-ignored-field-regexp nil t)
		(delete-region (match-beginning 0) (1+ (std11-field-end)))))
	    (mime-decode-header-in-buffer (not not-decode-text)))))))

;;;###autoload
(defun mime-edit-again (&optional not-decode-text no-separator not-turn-on)
  "Convert current buffer to MIME-Edit buffer and turn on MIME-Edit mode.
Content-Type and Content-Transfer-Encoding header fields will be
converted to MIME-Edit tags."
  (interactive)
  (goto-char (point-min))
  (if (search-forward
       (concat "\n" (regexp-quote mail-header-separator) "\n")
       nil t)
      (replace-match "\n\n"))
  (mime-edit-decode-message-in-buffer nil not-decode-text)
  (goto-char (point-min))
  (or no-separator
      (and (re-search-forward "^$")
	   (replace-match mail-header-separator)))
  (or not-turn-on
      (turn-on-mime-edit)))


;;; @ end
;;;

(provide 'mime-edit)

(run-hooks 'mime-edit-load-hook)

;;; mime-edit.el ends here
0707010000000F000081A4000003E80000006400000001627140E500001998000000000000000000000000000000000000002C00000000semi-1.14.6+239+gb1c245b81715/mime-image.el;;; mime-image.el --- mime-view filter to display images  -*- lexical-binding: t -*-

;; Copyright (C) 1995,1996,1997,1998 MORIOKA Tomohiko
;; Copyright (C) 1996 Dan Rich

;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;	Dan Rich <drich@morpheus.corp.sgi.com>
;;	Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
;;	Katsumi Yamaoka  <yamaoka@jpl.org>
;; Created: 1995/12/15
;;	Renamed: 1997/2/21 from tm-image.el

;; Keywords: image, picture, X-Face, MIME, multimedia, mail, news

;; This file is part of SEMI (Showy Emacs MIME Interfaces).

;; 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 XEmacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:
;;	If you use this program with MULE, please install
;;	etl8x16-bitmap.bdf font included in tl package.

;;; Code:

(require 'mime-view)
(require 'alist)
(require 'path-util)

(defsubst mime-image-normalize-xbm-buffer ()
  (save-excursion
    (let ((case-fold-search t) width height)
      (goto-char (point-min))
      (or (re-search-forward "_width[\t ]+\\([0-9]+\\)" nil t)
	  (error "!! Illegal xbm file format in the buffer: %s"
		 (current-buffer)))
      (setq width (string-to-number (match-string 1)))
      (goto-char (point-min))
      (or (re-search-forward "_height[\t ]+\\([0-9]+\\)" nil t)
	  (error "!! Illegal xbm file format in the buffer: %s"
		 (current-buffer)))
      (setq height (string-to-number (match-string 1)))
      (goto-char (point-min))
      (re-search-forward "0x[0-9a-f][0-9a-f],")
      (delete-region (point-min) (match-beginning 0))
      (goto-char (point-min))
      (while (re-search-forward "[\n\r\t ,;}]" nil t)
	(replace-match ""))
      (goto-char (point-min))
      (while (re-search-forward "0x" nil t)
	(replace-match "\\x" nil t))
      (goto-char (point-min))
      (insert "(" (number-to-string width) " "
	      (number-to-string height) " \"")
      (goto-char (point-max))
      (insert "\")")
      (goto-char (point-min))
      (read (current-buffer)))))

(defcustom mime-image-max-height nil
  "*Max displayed image height of attachment image to a message.
It has effect only when imagemagick or image scaling support is
available.
When value is floating-point, it indicates ratio
to `(frame-pixel-width)'.
When `mime-image-normalize-xbm' is non-nil, original size is
always used for xbm image."
    :group 'mime-view
    :type '(choice (const :tag "Use original size" nil)
		   (float :tag "Ratio to frame width")
		   (integer :tag "Specify in pixel")))

(defcustom mime-image-max-width nil
  "*Max displayed image width of attachment image to a message.
It has effect only when imagemagick or image scaling support is
available.
When value is floating-point number, it indicates ratio
to `(frame-pixel-height)'.
When `mime-image-normalize-xbm' is non-nil, original size is
always used for xbm image."
  :group 'mime-view
  :type '(choice (const :tag "Use original size" nil)
		 (float :tag "Ratio to frame height")
		 (integer :tag "Specify in pixel")))

(defcustom mime-image-normalize-xbm t
  "*When non-nil, build binary xbm image to display.
Furthermore, image scaling for xbm image is disabled."
  :group 'mime-view
  :type 'boolean)

(defalias 'mime-image-type-available-p 'image-type-available-p)
(defun mime-image-create
    (file-or-data &optional type data-p &rest props)
  (let* ((scale-p (and (fboundp 'image-transforms-p)
		       (memq 'scale (image-transforms-p))))
	 (imagemagick
	  (and (null scale-p)
	       (or mime-image-max-height mime-image-max-width)
	       (image-type-available-p 'imagemagick)
	       (fboundp 'imagemagick-filter-types)
	       (member (downcase (symbol-name type))
		       (mapcar (lambda (e) (downcase (symbol-name e)))
			       (imagemagick-filter-types)))))
	 height width)
    (when (and mime-image-normalize-xbm data-p (eq type 'xbm))
      (with-temp-buffer
	(insert file-or-data)
	(setq file-or-data
	      (mime-image-normalize-xbm-buffer)))
      (setq width (car file-or-data)
	    height (nth 1 file-or-data)
	    file-or-data (nth 2 file-or-data)))
    (setq props
	  (nconc (and width `(:width ,width))
		 (and height `(:height ,height))
		 (and (or scale-p imagemagick)
		      mime-image-max-width
		      `(:max-width
			,(if (integerp mime-image-max-width)
			     mime-image-max-width
			   (floor (* (frame-pixel-width)
				     mime-image-max-width)))))
		 (and (or scale-p imagemagick)
		      mime-image-max-height
		      `(:max-height
			,(if (integerp mime-image-max-height)
			     mime-image-max-height
			   (floor (* (frame-pixel-height)
				     mime-image-max-height)))))
		   props))
    (cond
     (imagemagick
      (apply #'create-image file-or-data 'imagemagick data-p props))
     (t
      (apply #'create-image file-or-data type data-p props)))))
(defalias 'mime-image-insert 'insert-image)

(defvar mime-image-format-alist
  '((image jpeg		jpeg)
    (image gif		gif)
    (image tiff		tiff)
    (image x-tiff	tiff)
    (image xbm		xbm)
    (image x-xbm	xbm)
    (image x-xpixmap	xpm)
    (image png		png)))

(dolist (rule mime-image-format-alist)
  (when (mime-image-type-available-p (nth 2 rule))
    (ctree-set-calist-strictly
     'mime-preview-condition
     (list (cons 'type (car rule))(cons 'subtype (nth 1 rule))
	   '(body . visible)
	   (cons 'body-presentation-method #'mime-display-image)
	   (cons 'image-format (nth 2 rule))))))
    

;;; @ content filter for images
;;;
;;    (for XEmacs 19.12 or later)

(defun mime-display-image (entity situation)
  (message "Decoding image...")
  (condition-case err
      (let ((format (cdr (assq 'image-format situation)))
	    image)
	(setq image
	      (mime-image-create (mime-entity-content entity)
				 format 'data))
	(if (null image)
	    (message "Invalid glyph!")
	  (save-excursion
	    (mime-image-insert image)
	    (insert "\n")
	    (message "Decoding image...done"))))
    (error nil err)))


;;; @ end
;;;

(provide 'mime-image)

;;; mime-image.el ends here
07070100000010000081A4000003E80000006400000001627140E5000006EB000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/mime-mac.el;;; mime-mac.el --- Playback processing module for Mac OS X  -*- lexical-binding: t -*-

;; Copyright (C) 2010 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: MIME, multimedia, mail, news

;; This file is part of SEMI (Secretariat of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'mime-play)

(defun mime-mac-save-and-play-with-open (entity situation)
  (let ((filename
	 (mime-save-content entity situation)))
    (call-process "open" nil nil nil filename)))

(defun mime-mac-save-and-play-with-preview (entity situation)
  (let ((filename
	 (mime-save-content entity situation)))
    (call-process "open" nil nil nil
		  "-a" "/Applications/Preview.app"
		  filename)))

;; (mime-add-condition
;;  'action
;;  '((type . application)
;;    (method . mime-mac-save-and-play-with-open))
;;  'strict)

;; (mime-add-condition
;;  'action
;;  '((type . application)(subtype . pdf)
;;    (method . mime-mac-save-and-play-with-preview))
;;  'strict)


;;; @ end
;;;

(provide 'mime-mac)

;;; mime-mac.el ends here
07070100000011000081A4000003E80000006400000001627140E500000C7B000000000000000000000000000000000000002E00000000semi-1.14.6+239+gb1c245b81715/mime-partial.el;;; mime-partial.el --- Grabbing all MIME "message/partial"s.  -*- lexical-binding: t -*-

;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.

;; Author: OKABE Yasuo @ Kyoto University
;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: message/partial, MIME, multimedia, mail, news

;; This file is part of SEMI (Suite of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'mime-view)
(require 'mime-play)

(defun mime-combine-message/partial-pieces-automatically (entity situation)
  "Internal method for mime-view to combine message/partial messages
automatically."
  (interactive)
  (let* ((id (cdr (assoc "id" situation)))
	 (target (cdr (assq 'major-mode situation)))
	 (subject-buf (eval (cdr (assq 'summary-buffer-exp situation))))
	 (mother (current-buffer))
	 subject-id
	 (root-dir (expand-file-name
		    (concat "m-prts-" (user-login-name))
		    temporary-file-directory))
	 (request-partial-message-method
	  (cdr (assq 'request-partial-message-method situation)))
	 full-file)
    (setq root-dir (concat root-dir "/" (replace-as-filename id)))
    (setq full-file (concat root-dir "/FULL"))
    
    (if (null target)
	(error "%s is not supported. Sorry." target))
    
    ;; if you can't parse the subject line, try simple decoding method
    (if (or (file-exists-p full-file)
	    (not (y-or-n-p "Merge partials?")))
	(mime-store-message/partial-piece entity situation)
      (setq subject-id (mime-entity-read-field entity 'Subject))
      (if (string-match "[0-9\n]+" subject-id)
	  (setq subject-id (substring subject-id 0 (match-beginning 0))))
      ;; Do not use `with-current-buffer'.  Inner save-excursion(),
      ;; the current buffer may be accessed.
      (save-excursion
	(set-buffer subject-buf)
	(while (search-backward subject-id nil t))
	(catch 'tag
	  (while t
	    (let* ((message
		    ;; request message at the cursor in Subject buffer.
		    (save-window-excursion
		      (funcall request-partial-message-method)))
		   (situation (mime-entity-situation message))
		   (the-id (cdr (assoc "id" situation))))
	      (when (string= the-id id)
		(with-current-buffer mother
		  (mime-store-message/partial-piece message situation))
		(if (file-exists-p full-file)
		    (throw 'tag nil)))
	      (if (not (progn
			 (end-of-line)
			 (search-forward subject-id nil t)))
		  (error "not found")))))))))


;;; @ end
;;;

(provide 'mime-partial)

(run-hooks 'mime-partial-load-hook)

;;; mime-partial.el ends here
07070100000012000081A4000003E80000006400000001627140E5000039BF000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/mime-pgp.el;;; mime-pgp.el --- mime-view internal methods for EasyPG.  -*- lexical-binding: t -*-

;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;;	Daiki Ueno <ueno@unixuser.org>
;;	Kazuhiro Ito <kzhr@d1.dion.ne.jp>
;; Created: 1995/12/7
;;	Renamed: 1997/2/27 from tm-pgp.el
;;	Renamed: 2010/11/27 from mime-pgp.el in emiko-epg
;;	Renamed: 2012/10/05 from mime-epg.el
;; Keywords: PGP, security, MIME, multimedia, mail, news

;; This file is part of SEMI (Secure Emacs MIME Interface).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:

;;; Code:

(require 'mime-parse)
(require 'mime-play)
(require 'epg)
(require 'epa)

(eval-when-compile (require 'mmgeneric))

;;; @ Internal functions

(eval-and-compile
  (defun mime-pgp-concurrency-available-p ()
    (and (fboundp 'make-mutex)
	 (fboundp 'with-mutex)
	 (fboundp 'make-thread)
	 (fboundp 'thread-signal)))

  (defcustom mime-pgp-use-concurrency
    (and (mime-pgp-concurrency-available-p)
	 ;; The feature may make Emacs crash on Windows.
	 (null (memq system-type '(windows-nt)))
	 ;; Emacs's concurrency feature seems to be unstable on earlier version.
	 (>= emacs-major-version 28))
    "When non-nil, use concurrency feature for inline verifying if available."
    :group 'mime-view
    :type 'boolean)

  (if (mime-pgp-concurrency-available-p)
      (progn
	(defalias 'mime-pgp-make-mutex 'make-mutex)
	(defalias 'mime-pgp-with-mutex 'with-mutex))
    (defalias 'mime-pgp-make-mutex 'ignore)
    (defmacro mime-pgp-with-mutex (_mutex &rest body)
      `(progn ,@body))
    ))

;; I'm not sure epg-* functions are thread safe.
(defvar mime-pgp-mutex (mime-pgp-make-mutex "MIME-PGP"))

(defun mime-pgp-maybe-remove-cr (string)
  ;; Remove CRs if header contains CR.
  (if (string-match "\\`.*\r\n" string)
      (let (inhibit-eol-conversion)
	(decode-coding-string string 'raw-text-dos))
    string))

(defun mime-pgp-decrypt-string (context cipher)
  (mime-pgp-maybe-remove-cr
   (mime-pgp-with-mutex mime-pgp-mutex
     (epg-decrypt-string context cipher))))

(defun mime-pgp-verify-string (context cipher)
  (mime-pgp-maybe-remove-cr
   (mime-pgp-with-mutex mime-pgp-mutex
     (epg-verify-string context cipher))))

(defun mime-pgp-verify-result-to-string (context)
  (let ((result (epg-context-result-for context 'verify)))
    (unless (stringp result)
      (setq result (epg-verify-result-to-string result)))
    (when (> (length result) 0)
      (unless (string-equal (substring result -1) "\n")
	(setq result (concat result "\n"))))
    result))

(defun mime-pgp-pkcs7-decrypt-enveloped-data (context content)
  (let (result)
    (condition-case error
	(setq result (decode-coding-string
		      (mime-pgp-decrypt-string context content)
		      'raw-text))
      (error (setq result error)))
    result))

(autoload 'mime-edit-make-boundary "mime-edit")

(defun mime-pgp-pkcs7-verify-signed-data (context content)
  (let (result)
    (if (condition-case error
	    (setq result (decode-coding-string
			  (mime-pgp-verify-string context content)
			  'raw-text))
	  (error (setq result error) nil))
	(let ((boundary (concat "PKCS7--" (mime-edit-make-boundary))))
	  (concat "Content-Type: multipart/mixed;\n"
		  " boundary=\"" boundary "\"\n"
		  "Content-Transfer-Encoding: 7bit\n\n"
		  "--" boundary "\n"
		  result
		  "--" boundary "\n"
		  "Content-Type: text/plain; charset=UTF-8\n"
		  "Content-Transfer-Encoding: 8bit\n\n"
		  (encode-coding-string
		   (mime-pgp-verify-result-to-string context) 'utf-8)
		  "--" boundary "--\n"))
      result)))

(defun mime-pgp-smime-type-from-situation (situation)
  (let ((type (cdr (assoc "smime-type" situation))))
    (if type
	(intern (downcase type))
      'enveloped-data)))

(defun mime-pgp-entity-string (entity)
  (with-temp-buffer
    (buffer-disable-undo)
    (set-buffer-multibyte nil)
    (mime-insert-entity entity)
    (buffer-string)))

;;; @ Internal method for multipart/signed

(defun mime-verify-multipart/signed (entity situation)
  "Internal method to verify multipart/signed."
  (mime-play-entity
   (nth 1 (mime-entity-children entity)) ; entity-info of signature
   (list (assq 'mode situation)) ; play-mode
   ))

;;; @ Internal method for multipart/encrypted

(defun mime-display-multipart/pgp-encrypted (entity situation)
  (let ((original-major-mode-cell (assq 'major-mode situation))
	(default-situation
	  (cdr (assq 'childrens-situation situation)))
	child-situation)
    (unless mime-pgp-decrypt-when-preview
      (insert "This part is encrypted.\n"))
    (when original-major-mode-cell
      (setq default-situation
	    (cons original-major-mode-cell default-situation)))
    (mapc
     (lambda (child)
       (setq child-situation
	     (mime-find-entity-preview-situation child default-situation))
       (if (and (eq (cdr (assq 'type child-situation)) 'application)
		(eq (cdr (assq 'subtype child-situation)) 'pgp-encrypted))
	   (mime-display-entity
	    child (put-alist 'body mime-pgp-decrypt-when-preview
			     (copy-alist child-situation)))
	 (when mime-view-multipart/related-show-all-children
	   (mime-display-entity
	    child (put-alist 'body 'invisible (copy-alist child-situation))))))
     (mime-entity-children entity))))

;;; @ Internal method for application/*-signature

(defun mime-verify-application/*-signature-internal (entity _situation)
  (let* ((mother (mime-entity-parent entity))
	 (orig-entity (car (mime-entity-children mother)))
	 (protocol (cdr (assoc "protocol" (mime-entity-parameters mother))))
	 context)
    (if (null protocol)
	"No protocol is specified."
      (setq context
	    (epg-make-context
	     (cond 
	      ((equal protocol "application/pgp-signature")
	       'OpenPGP)
	      ((string-match
		"\\`application/\\(x-\\)?pkcs7-signature\\'" protocol)
	       'CMS))))
      (if (null context)
	  (format "Unknown protocol: %s." protocol)
	(let ((signature (mime-entity-content entity))
	      (text (let (inhibit-eol-conversion)
		      (encode-coding-string
		       (mime-pgp-entity-string orig-entity) 'raw-text-dos))))
	  (mime-pgp-with-mutex mime-pgp-mutex
	    (epg-verify-string context signature text)))
	(epg-context-result-for context 'verify)))))

(defun mime-verify-application/*-signature (entity situation)
  (let ((verify-result
	 (mime-verify-application/*-signature-internal entity situation))
	window)
    (cond
     ((stringp verify-result)
      (mime-show-echo-buffer verify-result))
     ((> (length verify-result) 1)
      (mime-show-echo-buffer (epg-verify-result-to-string verify-result)))
     (verify-result
      (epa-display-info (epg-verify-result-to-string verify-result))
	(when (and epa-popup-info-window
		   (setq window (get-buffer-window epa-info-buffer)))
	  (select-window window))))))

(defun mime-preview-application/*-signature(entity situation)
  (let ((string "Verifying...\n")
	(unique (concat (number-to-string (point))
			"-" (number-to-string (random)))))
    (set-text-properties 0 (length string) `(mime-pgp-entity ,unique) string)
    (insert string)
    (let ((fn
	   `(lambda ()
	      (let ((verify-result
		     (condition-case error
			 (mime-verify-application/*-signature-internal
			  ',entity ',situation)
		       (error (format "Verification failed, %s" error))
		       (quit (format "Verification quitted")))))
		(unless (stringp verify-result)
		  (setq verify-result
			(epg-verify-result-to-string verify-result)))
		(when (> (length verify-result) 0)
		  (unless (string-equal (substring verify-result -1) "\n")
		    (setq verify-result (concat verify-result "\n")))
		  (let ((point (point-min))
			props)
		    (while (and point
				(setq point (next-single-property-change
					     point 'mime-pgp-entity)))
		      (setq props (text-properties-at point))
		      (when (eq (plist-get props 'mime-pgp-entity) ,unique)
			(set-text-properties
			 0 (length verify-result) props verify-result)
			(save-excursion
			  (goto-char point)
			  (let ((inhibit-read-only t))
			    (delete-region
			     point (or (next-single-property-change
					point 'mime-pgp-entity)
				       (point-max)))
			    (insert verify-result)))
			(setq point nil)))))))))
      (if (and mime-pgp-use-concurrency
	       (mime-pgp-concurrency-available-p))
	  (make-thread fn)
	(funcall fn)))))

;;; @ Internal method for application/pgp-encrypted

(defun mime-decrypt-application/pgp-encrypted (entity _situation)
  (let* ((mother (mime-entity-parent entity))
	 (encrypted-entity (nth 1 (mime-entity-children mother)))
	 (p-win (or (get-buffer-window (current-buffer))
		    (get-largest-window)))
	 (new-name
	  (format "%s-%s" (buffer-name) (mime-entity-number entity)))
	 (mother (current-buffer))
	 (preview-buffer (concat "*Preview-" (buffer-name) "*"))
	 representation-type message-buf context plain)
    (set-buffer (setq message-buf (get-buffer-create new-name)))
    (erase-buffer)
    (mime-insert-entity encrypted-entity)
    (goto-char (point-min))
    (setq context (epg-make-context)
	  plain (decode-coding-string
		 (mime-pgp-decrypt-string
		  context
		  (buffer-substring (point-min)(point-max)))
		 'raw-text))
    (delete-region (point-min)(point-max))
    (insert plain)
    (setq representation-type 'binary
	  major-mode 'mime-show-message-mode)
    (save-window-excursion
      (mime-view-buffer nil preview-buffer mother
			nil representation-type)
      (make-local-variable 'mime-view-temp-message-buffer)
      (setq mime-view-temp-message-buffer message-buf))
    (set-window-buffer p-win preview-buffer)))

(defvar mime-pgp-decrypted-buffers nil)

(defun mime-pgp-kill-decrypted-buffers ()
  (mapc (lambda (buffer)
	  (when (bufferp buffer)
	    (kill-buffer buffer)))
	mime-pgp-decrypted-buffers))

(defun mime-pgp-register-decrypted-buffer (buffer)
  (add-hook 'kill-buffer-hook 'mime-pgp-kill-decrypted-buffers nil t)
  (make-local-variable 'mime-pgp-decrypted-buffers)
  (add-to-list 'mime-pgp-decrypted-buffers buffer))

;; Imported and modified from Wanderlust.
(defun mime-preview-application/pgp-encrypted (entity _situation)
  (let (p buffer decrypted-entity result)
    (goto-char (setq p (point-max)))
    (save-restriction
      (narrow-to-region p p)
      (setq buffer (generate-new-buffer (concat mime-temp-buffer-name "PGP*")))
      (if (null (stringp
		 (setq result (mime-pgp-pkcs7-decrypt-enveloped-data
			       (epg-make-context)
			       (mime-pgp-entity-string
				(nth 1 (mime-entity-children
					(mime-entity-parent entity))))))))
	  (insert (format "%s" (cdr result)))
	(with-current-buffer buffer
	  (require 'mmbuffer)
	  (insert result)
	  (setq decrypted-entity
		(mime-parse-message
		 (mm-expand-class-name 'buffer)
		 nil entity (mime-entity-node-id entity))
		buffer-read-only t))
	(mime-pgp-register-decrypted-buffer buffer)
	(mime-display-entity
	 decrypted-entity nil '((header . visible)
				(body . visible)
				(entity-button . invisible)))))))


;;; @ Internal method for application/pgp-keys

(defun mime-add-application/pgp-keys (entity _situation)
  (when (y-or-n-p "Do you want to import PGP keys? ")
    (let ((context (epg-make-context))
	  result window)
      (epg-import-keys-from-string context (mime-entity-content entity))
      (when (setq result (epg-context-result-for context 'import))
	(epa-display-info (epg-import-result-to-string result))
	(when (and epa-popup-info-window
		   (setq window (get-buffer-window epa-info-buffer)))
	  (select-window window))))))


;;; @ Internal method for application/pkcs7-mime

(defun mime-view-application/pkcs7-mime (entity situation)
  (let ((smime-type (mime-pgp-smime-type-from-situation situation))
	(p-win (or (get-buffer-window (current-buffer))
		   (get-largest-window)))
	(new-name
	 (format "%s-%s" (buffer-name) (mime-entity-number entity)))
	(mother (current-buffer))
	(preview-buffer (concat "*Preview-" (buffer-name) "*"))
	(context (epg-make-context 'CMS))
	message-buf result fn)
    (setq fn
	  (cdr
	   (assq smime-type
		 '((signed-data . mime-pgp-pkcs7-verify-signed-data)
		   (enveloped-data . mime-pgp-pkcs7-decrypt-enveloped-data)))))
    (unless fn
      (error "Unsupported smime-type (%s)" smime-type))
    (if (null (stringp (setq result (funcall fn context
					     (mime-entity-content entity)))))
	(signal (car result) (cdr result))
      (set-buffer (setq message-buf (get-buffer-create new-name)))
      (let ((inhibit-read-only t)
	    buffer-read-only)
	(set-buffer-multibyte nil)
	(erase-buffer)
	(insert result)
	(setq major-mode 'mime-show-message-mode)
	(save-window-excursion
	  (mime-view-buffer nil preview-buffer mother nil 'binary)
	  (make-local-variable 'mime-view-temp-message-buffer)
	  (setq mime-view-temp-message-buffer message-buf))
	(set-window-buffer p-win preview-buffer)))))

(defun mime-preview-application/pkcs7-mime (entity situation)
  (let ((smime-type (mime-pgp-smime-type-from-situation situation))
	(context (epg-make-context 'CMS))
	p buffer decrypted-entity result fn)
    (setq fn
	  (cdr
	   (assq smime-type
		 '((signed-data . mime-pgp-pkcs7-verify-signed-data)
		   (enveloped-data . mime-pgp-pkcs7-decrypt-enveloped-data)))))
    (if (null fn)
	(insert "Unsupported smime-type (" smime-type ")\n")
      (goto-char (setq p (point-max)))
      (save-restriction
	(narrow-to-region p p)
	(if (null (stringp (setq result
				 (funcall fn context
					  (mime-entity-content entity)))))
	    (insert (format "%s" (cdr result)))
	  (setq buffer (generate-new-buffer
			(concat mime-temp-buffer-name "PKCS7*")))
	  (with-current-buffer buffer
	    (require 'mmbuffer)
	    (set-buffer-multibyte nil)
	    (insert result)
	    (setq decrypted-entity
		  (mime-parse-message
		   (mm-expand-class-name 'buffer)
		   nil entity (mime-entity-node-id-internal entity))
		  buffer-read-only t))
	  (mime-pgp-register-decrypted-buffer buffer)
	  (mime-display-entity
	   decrypted-entity nil '((header . invisible)
				  (body . visible)
				  (entity-button . invisible))))))))

;;; @ end
;;;

(provide 'mime-pgp)

(run-hooks 'mime-pgp-load-hook)

;;; mime-pgp.el ends here
07070100000013000081A4000003E80000006400000001627140E50000432F000000000000000000000000000000000000002B00000000semi-1.14.6+239+gb1c245b81715/mime-play.el;;; mime-play.el --- Playback processing module for mime-view.el  -*- lexical-binding: t -*-

;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003,
;;   2004, 2010 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Created: 1995/9/26 (separated from tm-view.el)
;;	Renamed: 1997/2/21 from tm-play.el
;; Keywords: MIME, multimedia, mail, news

;; This file is part of SEMI (Secretariat of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'mime-view)
(require 'alist)
(require 'filename)

(defvar bbdb-buffer-name)

(defcustom mime-save-directory "~/"
  "*Name of the directory where MIME entity will be saved in.
If t, it means current directory."
  :group 'mime-view
  :type '(choice (const :tag "Current directory" t)
		 (directory)))

(defcustom mime-play-delete-file-immediately t
  "If non-nil, delete played file immediately."
  :group 'mime-view
  :type 'boolean)

(defvar mime-play-find-every-situations t
  "*Find every available situations if non-nil.")

(defvar mime-play-messages-coding-system nil
  "Coding system to be used for external MIME playback method.")


;;; @ content decoder
;;;

;;;###autoload
(defun mime-preview-play-current-entity (&optional ignore-examples mode)
  "Play current entity.
It decodes current entity to call internal or external method.  The
method is selected from variable `mime-acting-condition'.
If IGNORE-EXAMPLES (C-u prefix) is specified, this function ignores
`mime-acting-situation-example-list'.
If MODE is specified, play as it.  Default MODE is \"play\"."
  (interactive "P")
  (let ((entity (get-text-property (point) 'mime-view-entity)))
    (if entity
	(let ((situation
	       (get-text-property (point) 'mime-view-situation)))
	  (or mode
	      (setq mode "play"))
	  (setq situation 
		(if (assq 'mode situation)
		    (put-alist 'mode mode (copy-alist situation))
		  (cons (cons 'mode mode)
			situation)))
	  (if ignore-examples
	      (setq situation
		    (cons (cons 'ignore-examples ignore-examples)
			  situation)))
	  (mime-play-entity entity situation)))))

;;;###autoload
(defun mime-play-entity (entity &optional situation ignored-method)
  "Play entity specified by ENTITY.
It decodes the entity to call internal or external method.  The method
is selected from variable `mime-acting-condition'.  If MODE is
specified, play as it.  Default MODE is \"play\"."
  (let ((ret
	 (mime-unify-situations (mime-entity-situation entity situation)
				mime-acting-condition
				mime-acting-situation-example-list
				'method ignored-method
				mime-play-find-every-situations))
	method)
    (setq mime-acting-situation-example-list (cdr ret)
	  ret (car ret))
    (cond ((cdr ret)
	   (setq ret (mime-select-menu-alist
		      "Methods"
		      (mapcar (lambda (situation)
				(cons
				 (format "%s"
					 (cdr (assq 'method situation)))
				 situation))
			      ret)))
	   (setq ret (mime-sort-situation ret))
	   (add-to-list 'mime-acting-situation-example-list (cons ret 0)))
	  (t
	   (setq ret (car ret))))
    (setq method (cdr (assq 'method ret)))
    (cond ((and (symbolp method)
		(fboundp method))
	   (funcall method entity ret))
	  ((stringp method)
	   (mime-activate-mailcap-method entity ret))
          ;; ((and (listp method)(stringp (car method)))
          ;;  (mime-activate-external-method entity ret)
          ;;  )
	  (t
	   (mime-show-echo-buffer "No method are specified for %s\n"
				  (mime-type/subtype-string
				   (cdr (assq 'type situation))
				   (cdr (assq 'subtype situation))))
	   (if (y-or-n-p "Do you want to save current entity to disk?")
	       (mime-save-content entity situation))))))


;;; @ external decoder
;;;

(defvar mime-mailcap-method-filename-alist nil)

(defun mime-activate-mailcap-method (entity situation)
  (let ((method (cdr (assoc 'method situation)))
	(name (mime-entity-safe-filename entity)))
    (setq name (expand-file-name (if (and name (not (string= name "")))
				     name
				   (make-temp-name "EMI"))
				 (make-temp-file "EMI" 'directory)))
    (mime-write-entity-content entity name)
    (message "External method is starting...")
    (let ((process
	   (let ((command
		  (mime-format-mailcap-command
		   method
		   (cons (cons 'filename name) situation)))
		 (coding-system-for-read mime-play-messages-coding-system)
		 process-connection-type)
	     (start-process command mime-echo-buffer-name
	      shell-file-name shell-command-switch command))))
      (set-alist 'mime-mailcap-method-filename-alist process name)
      (set-process-sentinel process 'mime-mailcap-method-sentinel))))

(defun mime-mailcap-method-sentinel (process event)
  (when mime-play-delete-file-immediately
    (let ((file (cdr (assq process mime-mailcap-method-filename-alist))))
      (when (file-exists-p file)
	(ignore-errors
	  (delete-file file)
	  (delete-directory (file-name-directory file)))))
    (remove-alist 'mime-mailcap-method-filename-alist process))
  (message "%s %s" process event))

(defun mime-mailcap-delete-played-files ()
  (dolist (elem mime-mailcap-method-filename-alist)
    (when (file-exists-p (cdr elem))
      (ignore-errors
	(delete-file (cdr elem))
	(delete-directory (file-name-directory (cdr elem)))))))

(add-hook 'kill-emacs-hook 'mime-mailcap-delete-played-files)

(defvar mime-echo-window-is-shared-with-bbdb
  (module-installed-p 'bbdb)
  "*If non-nil, mime-echo window is shared with BBDB window.")

(defvar mime-echo-window-height
  (lambda () (/ (window-height) 5))
  "*Size of mime-echo window.
It allows function or integer.  If it is function,
`mime-show-echo-buffer' calls it to get height of mime-echo window.
Otherwise `mime-show-echo-buffer' uses it as height of mime-echo
window.")

(defun mime-show-echo-buffer (&rest forms)
  "Show mime-echo buffer to display MIME-playing information."
  (get-buffer-create mime-echo-buffer-name)
  (let ((the-win (selected-window))
	(win (get-buffer-window mime-echo-buffer-name)))
    (unless win
      (unless (and mime-echo-window-is-shared-with-bbdb
		   (condition-case nil
		       (setq win (get-buffer-window bbdb-buffer-name))
		     (error nil)))
	(select-window (get-buffer-window (or mime-preview-buffer
					      (current-buffer))))
	(setq win (split-window-vertically
		   (- (window-height)
		      (if (functionp mime-echo-window-height)
			  (funcall mime-echo-window-height)
			mime-echo-window-height)))))
      (set-window-buffer win mime-echo-buffer-name))
    (select-window win)
    (goto-char (point-max))
    (if forms
	(let ((buffer-read-only nil))
	  (insert (apply (function format) forms))))
    (select-window the-win)))


;;; @ file name
;;;

(defvar mime-view-file-name-char-regexp "[A-Za-z0-9+_-]")

(defvar mime-view-file-name-regexp-1
  (concat mime-view-file-name-char-regexp "+\\."
	  mime-view-file-name-char-regexp "+"))

(defvar mime-view-file-name-regexp-2
  (concat (regexp-* mime-view-file-name-char-regexp)
	  "\\(\\." mime-view-file-name-char-regexp "+\\)*"))

(defun mime-entity-safe-filename (entity)
  (let ((filename
	 (or (mime-entity-filename entity)
	     (let ((subj
		    (or (mime-entity-read-field entity 'Content-Description)
			(mime-entity-read-field entity 'Subject))))
	       (if (and subj
			(or (string-match mime-view-file-name-regexp-1 subj)
			    (string-match mime-view-file-name-regexp-2 subj)))
		   (substring subj (match-beginning 0)(match-end 0)))))))
    (if filename
	(replace-as-filename filename))))


;;; @ file extraction
;;;

(defun mime-save-content (entity _situation)
  (let ((name (or (mime-entity-safe-filename entity)
		  (format "%s" (mime-entity-media-type entity))))
	(dir (if (eq t mime-save-directory)
		 default-directory
	       mime-save-directory))
	filename)
    (setq filename (read-file-name
		    (concat "File name: (default "
			    (file-name-nondirectory name) ") ")
		    dir
		    (concat (file-name-as-directory dir)
			    (file-name-nondirectory name))))
    (if (file-directory-p filename)
	(setq filename (concat (file-name-as-directory filename)
			       (file-name-nondirectory name))))
    (if (file-exists-p filename)
	(or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
	    (error "")))
    (mime-write-entity-content entity (expand-file-name filename))
    filename))


;;; @ file detection
;;;

(defvar mime-magic-type-alist
  '(("^\377\330\377[\340\356]..JFIF"	image jpeg)
    ("^\211PNG"				image png)
    ("^GIF8[79]"			image gif)
    ("^II\\*\000"			image tiff)
    ("^MM\000\\*"			image tiff)
    ("^MThd"				audio midi)
    ("^\000\000\001\263"		video mpeg))
  "*Alist of regexp about magic-number vs. corresponding media-types.
Each element looks like (REGEXP TYPE SUBTYPE).
REGEXP is a regular expression to match against the beginning of the
content of entity.
TYPE is symbol to indicate primary type of media-type.
SUBTYPE is symbol to indicate subtype of media-type.")

(defun mime-detect-content (entity situation)
  (let (type subtype)
    (let ((mdata (mime-entity-content entity))
	  (rest mime-magic-type-alist))
      (while (not (let ((cell (car rest)))
		    (if cell
			(if (string-match (car cell) mdata)
			    (setq type (nth 1 cell)
				  subtype (nth 2 cell)))
		      t)))
	(setq rest (cdr rest))))
    (setq situation (del-alist 'method (copy-alist situation)))
    (mime-play-entity entity
		      (if type
			  (put-alist 'type type
				     (put-alist 'subtype subtype
						situation))
			situation)
		      'mime-detect-content)))


;;; @ mail/news message
;;;

(defvar mime-view-temp-message-buffer nil) ; buffer local variable

(defun mime-preview-quitting-method-for-mime-show-message-mode ()
  "Quitting method for mime-view.
It is registered to variable `mime-preview-quitting-method-alist'."
  (let ((mother mime-mother-buffer)
	(win-conf mime-preview-original-window-configuration))
    (if (buffer-live-p mime-view-temp-message-buffer)
	(kill-buffer mime-view-temp-message-buffer))
    (mime-preview-kill-buffer)
    (set-window-configuration win-conf)
    (pop-to-buffer mother)))

(defun mime-view-message/rfc822 (entity _situation)
  (let* ((new-name
	  (format "%s-%s" (buffer-name) (mime-entity-number entity)))
	 (mother (current-buffer))
	 (children (car (mime-entity-children entity)))
	 (preview-buffer
	  (mime-display-message
	   children new-name mother nil
	   (cdr (assq 'major-mode
		      (get-text-property (point) 'mime-view-situation))))))
    (or (get-buffer-window preview-buffer)
	(let ((m-win (get-buffer-window mother)))
	  (if m-win
	      (set-window-buffer m-win preview-buffer)
	    (switch-to-buffer preview-buffer))))))


;;; @ message/partial
;;;

(defun mime-require-safe-directory (dir)
  "Create a directory DIR safely.
The permission of the created directory becomes `700' (for the owner only).
If the directory already exists and is writable by other users, an error
occurs."
  (let ((attr (file-attributes dir))
	(orig-modes (default-file-modes)))
    (if (and attr (eq (car attr) t)) ; directory already exists.
	(unless (or (memq system-type '(windows-nt ms-dos OS/2 emx))
		    (and (eq (nth 2 attr) (user-real-uid))
			 (eq (file-modes dir) 448)))
	  (error "Invalid owner or permission for %s" dir))
      (unwind-protect
	  (progn
	    (set-default-file-modes 448)
	    (make-directory dir))
	(set-default-file-modes orig-modes)))))

(defun mime-store-message/partial-piece (entity cal)
  (let ((root-dir
	 (expand-file-name
	  (concat "m-prts-" (user-login-name)) temporary-file-directory))
	(id (cdr (assoc "id" cal)))
	(number (cdr (assoc "number" cal)))
	(total (cdr (assoc "total" cal)))
	file
	(mother (current-buffer))
	(orig-modes (default-file-modes)))
    (mime-require-safe-directory root-dir)
    (or (file-exists-p root-dir)
	(unwind-protect
	    (progn
	      (set-default-file-modes 448)
	      (make-directory root-dir))
	  (set-default-file-modes orig-modes)))
    (setq id (replace-as-filename id))
    (setq root-dir (concat root-dir "/" id))

    (or (file-exists-p root-dir)
	(unwind-protect
	    (progn
	      (set-default-file-modes 448)
	      (make-directory root-dir))
	  (set-default-file-modes orig-modes)))

    (setq file (concat root-dir "/FULL"))
    (if (file-exists-p file)
	(let ((full-buf (get-buffer-create "FULL"))
	      (pwin (or (get-buffer-window mother)
			(get-largest-window)))
	      pbuf)
	  (save-window-excursion
	    (set-buffer full-buf)
	    (erase-buffer)
	    (binary-insert-encoded-file file)
	    (setq major-mode 'mime-show-message-mode)
	    (mime-view-buffer (current-buffer) nil mother)
	    (setq pbuf (current-buffer))
	    (make-local-variable 'mime-view-temp-message-buffer)
	    (setq mime-view-temp-message-buffer full-buf))
	  (set-window-buffer pwin pbuf)
	  (select-window pwin))
      (setq file (concat root-dir "/" number))
      (mime-write-entity-body entity file)
      (let ((total-file (concat root-dir "/CT")))
	(setq total
	      (if total
		  (progn
		    (or (file-exists-p total-file)
			(with-current-buffer
			    (get-buffer-create mime-temp-buffer-name)
			  (erase-buffer)
			  (insert total)
			  (write-region (point-min)(point-max) total-file)
			  (kill-buffer (current-buffer))))
		    (string-to-number total))
		(and (file-exists-p total-file)
		     (with-current-buffer (find-file-noselect total-file)
		       (prog1
			   (and (re-search-forward "[0-9]+" nil t)
				(string-to-number
				 (buffer-substring (match-beginning 0)
						   (match-end 0))))
			 (kill-buffer (current-buffer))))))))
      (if (and total (> total 0)
	       (>= (length (directory-files root-dir nil "^[0-9]+$" t))
		   total))
	  (catch 'tag
	    (with-current-buffer (get-buffer-create mime-temp-buffer-name)
	      (erase-buffer)
	      (let ((i 1))
		(while (<= i total)
		  (setq file (concat root-dir "/" (int-to-string i)))
		  (or (file-exists-p file)
		      (throw 'tag nil))
		  (binary-insert-encoded-file file)
		  (goto-char (point-max))
		  (setq i (1+ i))))
	      (binary-write-decoded-region
	       (point-min)(point-max)
	       (expand-file-name "FULL" root-dir))
	      (let ((i 1))
		(while (<= i total)
		  (let ((file (format "%s/%d" root-dir i)))
		    (and (file-exists-p file)
			 (delete-file file)))
		  (setq i (1+ i))))
	      (let ((file (expand-file-name "CT" root-dir)))
		(and (file-exists-p file)
		     (delete-file file)))
	      (let ((buf (current-buffer))
		    (pwin (or (get-buffer-window mother)
			      (get-largest-window)))
		    (pbuf (mime-display-message
			   (mime-open-entity 'buffer (current-buffer))
			   nil mother nil 'mime-show-message-mode)))
		(with-current-buffer pbuf
		  (make-local-variable 'mime-view-temp-message-buffer)
		  (setq mime-view-temp-message-buffer buf))
		(set-window-buffer pwin pbuf)
		(select-window pwin))))))))


;;; @ message/external-body
;;;

(defvar mime-raw-dired-function
  (if window-system
      (function dired-other-frame)
    (function mime-raw-dired-function-for-one-frame)))

(defun mime-raw-dired-function-for-one-frame (dir)
  (let ((win (or (get-buffer-window mime-preview-buffer)
		 (get-largest-window))))
    (select-window win)
    (dired dir)))

(defun mime-view-message/external-anon-ftp (_entity cal)
  (let* ((site (cdr (assoc "site" cal)))
	 (directory (cdr (assoc "directory" cal)))
	 (name (cdr (assoc "name" cal)))
	 (pathname (concat "/anonymous@" site ":" directory)))
    (message "%s" (concat "Accessing " (expand-file-name name pathname) "..."))
    (funcall mime-raw-dired-function pathname)
    (goto-char (point-min))
    (search-forward name)))

(defvar mime-raw-browse-url-function mime-browse-url-function)

(defun mime-view-message/external-url (_entity cal)
  (let ((url (cdr (assoc "url" cal))))
    (message "%s" (concat "Accessing " url "..."))
    (funcall mime-raw-browse-url-function url)))


;;; @ rot13-47
;;;

(defun mime-view-caesar (entity _situation)
  "Internal method for mime-view to display ROT13-47-48 message."
  (let ((buf (get-buffer-create
	      (format "%s-%s" (buffer-name) (mime-entity-number entity)))))
    (with-current-buffer buf
      (setq buffer-read-only nil)
      (erase-buffer)
      (mime-insert-text-content entity)
      (mule-caesar-region (point-min) (point-max))
      (set-buffer-modified-p nil))
    (let ((win (get-buffer-window (current-buffer))))
      (or (eq (selected-window) win)
	  (select-window (or win (get-largest-window)))))
    (view-buffer buf)
    (goto-char (point-min))))


;;; @ end
;;;

(provide 'mime-play)

;;; mime-play.el ends here
07070100000014000081A4000003E80000006400000001627140E50000056F000000000000000000000000000000000000002C00000000semi-1.14.6+239+gb1c245b81715/mime-setup.el;;; mime-setup.el --- setup file for MIME viewer and composer.  -*- lexical-binding: t -*-

;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: MIME, multimedia, multilingual, mail, news

;; This file is part of SEMI (Setting for Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(load "mail-mime-setup")

(condition-case nil
    (load "gnus-mime-setup")
  (error (message "gnus-mime-setup is not found.")))

(condition-case nil
    (load "emh-setup")
  (error (message "emh-setup is not found.")))


;;; @ end
;;;

(provide 'mime-setup)

(run-hooks 'mime-setup-load-hook)

;;; mime-setup.el ends here
07070100000015000081A4000003E80000006400000001627140E5000009EA000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/mime-shr.el;;; mime-shr.el --- mime-view content filter using shr for html  -*- lexical-binding: t -*-

;; Copyright (C) 2012 Kazuhiro Ito

;; Author: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
;; Keywords: HTML, MIME, multimedia, mail, news

;; This file is part of SEMI (Suite of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(eval-and-compile
  (require 'shr nil t))

(require 'mime)

(defcustom mime-shr-blocked-images "."
  "Images of which URLs match this regexp are blocked.
When nil, it means the value of shr-blocked-images is used."
  :group 'mime-view
  :type '(choice regexp (const nil)))

(defvar mime-shr-root-entity nil)
(make-variable-buffer-local 'mime-shr-root-entity)

(defun mime-shr-preview-text/html (entity _situation)
  (let ((dom (with-temp-buffer
	       (mime-insert-text-content entity)
	       (libxml-parse-html-region (point-min) (point-max))))
	(shr-content-function 'mime-shr-cid-retrieve)
	(shr-blocked-images (or mime-shr-blocked-images
				shr-blocked-images)))
    (setq mime-shr-root-entity (mime-find-root-entity entity))
    (save-restriction
      ;; shr-insert-document may insert document before current point.
      ;; Cf. https://github.com/wanderlust/semi/issues/11
      (narrow-to-region (point-max) (point-max))
      (shr-insert-document dom)))
  ;; Workaround to delete garbage overlay.
  (let ((overlays (overlays-in (point-min) (point-max))))
    (while overlays
      (when (eq (overlay-start (car overlays))
		(overlay-end (car overlays)))
	(delete-overlay (car overlays)))
      (setq overlays (cdr overlays)))))


(defun mime-shr-cid-retrieve (url)
  (let ((entity (mime-find-entity-from-content-id
		 (mime-uri-parse-cid (concat "cid:" url))
		 mime-shr-root-entity)))
    (when entity
      (mime-entity-content entity))))

;;; @ end
;;;

(provide 'mime-shr)

;;; mime-shr.el ends here
07070100000016000081A4000003E80000006400000001627140E500001BE8000000000000000000000000000000000000003000000000semi-1.14.6+239+gb1c245b81715/mime-signature.el;;; mime-signature.el --- signature handling module for mime-edit  -*- lexical-binding: t -*-

;; Copyright (C) 2013 Kazuhiro Ito

;; Author: Kazuhiro Ito <kzhr@d1.dion.ne.jp>

;; Keywords: MIME, mail, news

;; This file is part of SEMI (Showy Emacs MIME Interfaces).

;; 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 XEmacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'mime-edit)

(defcustom mime-edit-signature-separator "\n-- \n"
  "Separator between a message text and a signature.  It should
start and must end with LF."
  :group 'mime-edit
  :type 'string)

(defcustom mime-edit-default-signature
  (or (and (boundp 'signature-file-name)
	   signature-file-name)
      (and (boundp 'mail-signature)
	   (cond ((stringp mail-signature)
		  (list (if (string-match
			     (concat
			      "^\n*"
			      (regexp-quote
			       (if (eq ?\n (string-to-char
					    mime-edit-signature-separator))
				   (substring mime-edit-signature-separator 1)
				 mime-edit-signature-separator)))
			     mail-signature)
			    (substring mail-signature (match-end 0))
			  mail-signature)))
		 ((eq mail-signature t)
		  (and (boundp 'mail-signaute-file)
		       mail-signaute-file))
		 (t (list mail-signature))))
      "~/.signature")
  "Specify default signature.
It is string or list consists of strings and functions.
When it is string, indicate signature file name.
When it is list, each string and function's result are
inserted.  Function is called with no argument and returns string
to be inserted."
  :group 'mime-edit
  :type '(choice (file :tag "Signature file name")
		 (repeat (choice
			  (string :tag "Inserting string")
			  (function :tag "Calling function")))))

(defcustom mime-edit-signature-position 'part
  "Position for signature."
  :group 'mime-edit
  :type '(choice (const :tag "Anywhere" nil)
		 (const :tag "At the end of a part" part)
		 (const :tag "At the end of a message" message)))

(defcustom mime-edit-signature-file-prefix nil
  "String containing optional prefix for the signature file names"
  :group 'mime-edit
  :type '(choice (const :tag "Undefine" nil) (string :tag "Define")))

(defcustom mime-edit-signature-alist nil
  "Alist of the form to define inserted signature:
    (((FIELDS . PATTERN) . SIGNATURE)
     ...)

FILEDS is a string or list of strings for searched field names.

PATTERN is a string or list of string or function.  If any
PATTERN's string matchs with any content of FIELDS, SIGNATURE is
inserted.  When PATTERN is function, it is called with two
arguments, field's content and corresponding SIGNATURE.

SIGNATURE is string or list of strings and functions.
When SIGNATURE is string, it indicate signature file suffix.
Actual file name is generated by concatenating with
`mime-edit-signature-file-prefix'.

When SIGNATURE is list, each string and function's result is
inserted.  Function is called no argument and returns string to
be inserted."
  :group 'mime-edit
  :type '(choice
	  (const :tag "Not define" nil)
	  (repeat :tag "Define"
		  (cons
		   (cons (string :tag "Field name")
			 (choice (function :tag "File name suffix returning function")
				 (regexp :tag "Single regexp")
				 (repeat :tag "Multiple regexp" regexp)))
		   (choice (string :tag "Signature file name suffix")
			   (repeat (choice
				    (string :tag "Inserting string")
				    (function :tag "Calling function"))))))))

(defun mime-edit-signature-guess ()
  ;; Guess signature from current buffer and `mime-edit-signature-alist'.
  ;; return signature to be inserted.
  (save-excursion
    (save-restriction
      (std11-narrow-to-header)
      (let ((alist mime-edit-signature-alist)
	    cell fields value field signature tmp)
	(setq signature
	      (catch 'found
		(while alist
		  (setq cell   (car alist)
			fields (caar cell)
			value  (cdar cell))
		  (when (stringp fields) (setq fields (list fields)))
		  (while fields
		    (setq field (std11-fetch-field (car fields)))
		    (cond
		     ((functionp value)
		      (when (setq tmp (apply value field (cdr cell)))
			(throw 'found tmp)))
		     ((stringp field)
		      (when (stringp value) (setq value (list value)))
		      (setq tmp value)
		      (while tmp
			(when (string-match (car tmp) field)
			  (throw 'found (cdr cell)))
			(setq tmp (cdr tmp)))))
		    (setq fields (cdr fields)))
		  (setq alist (cdr alist)))))
	(or (and (stringp signature)
		 (concat mime-edit-signature-file-prefix signature))
	    signature
	    mime-edit-default-signature)))))

(defun mime-edit-signature-insert-plain (signature)
  (if (stringp signature)
      (insert-file-contents signature)
    (while signature
      (cond
       ((stringp (car signature))
	(insert (car signature)))
       ((functionp (car signature))
	(insert (funcall (car signature)))))
      (setq signature (cdr signature))))
  (unless (eq (preceding-char) ?\n)
    (insert ?\n)))

(defun mime-edit-insert-signature ()
  "Insert a signature."
  (interactive)
  (let ((point (point))
	(signature (mime-edit-signature-guess))
	start end text-part-p plain-signature-p)
    (setq plain-signature-p
	  (or (null (stringp signature))
	      (let ((file-type (mime-find-file-type signature)))
		(and (equal "text" (car file-type))
		     (equal "plain" (cadr file-type))))))
    (when (eq mime-edit-signature-position 'message)
      (goto-char (point-max)))
    (re-search-backward mime-edit-tag-regexp nil 'move)
    (setq start (point)
	  end (if (re-search-forward mime-edit-tag-regexp nil t)
		  (match-beginning 0)
		(point-max)))
    (when (> point end)
      (setq start end
	    end (if (re-search-forward mime-edit-tag-regexp nil t)
		    (match-beginning 0)
		  (point-max))))
    (goto-char start)
    (setq text-part-p
	  (or (null (looking-at mime-edit-single-part-tag-regexp))
	      (string-match "^text/plain" (match-string 1))))
    (goto-char (cond ((eq mime-edit-signature-position 'message)
		      (point-max))
		     ((eq mime-edit-signature-position 'part)
		      end)
		     (t
		      point)))
    (unless (and text-part-p plain-signature-p)
      (unless (eq (preceding-char) ?\n) (insert ?\n))
      (mime-edit-insert-tag "text" "plain"))
    (if plain-signature-p
	(progn
	  (unless (eq (preceding-char) ?\n) (insert ?\n))
	  (when (or mime-edit-signature-position
		    (eq end point))
	    (insert mime-edit-signature-separator))
	  (mime-edit-signature-insert-plain signature))
      (mime-edit-insert-file signature))))

;;; @ end
;;;

(provide 'mime-signature)

;;; mime-signature.el ends here
07070100000017000081A4000003E80000006400000001627140E500008278000000000000000000000000000000000000002B00000000semi-1.14.6+239+gb1c245b81715/mime-tnef.el;;; mime-tnef.el --- mime-view content filter for ms-tnef  -*- lexical-binding: t -*-

;; Copyright (C) 2015 Kazuhiro Ito

;; Author: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
;; Keywords: MIME, multimedia, mail, news

;; This file is part of SEMI (Suite of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:

;; mime-tnef.el can handle an application/ms-tnef attachment, usually
;; named winmail.dat.  At present, mime-tnef.el provides access to
;; only attached files, not text.  Most of algorithms, constants are
;; derived from TNEF, C program available at
;; https://github.com/verdammelt/tnef .


;;; Code:

(require 'mime)
(require 'mime-edit)


;;; Customizable variables

(defcustom mime-tnef-unicode-coding-system
  (catch :found
    (dolist (coding '(utf-16le utf-16-le-no-signature) nil)
      (when (coding-system-p coding)
	(throw :found coding))))
  "Coding system for Windows uniode string."
  :group 'mime-view
  :type 'coding-system)


;;; Internal constants

(defconst mime-tnef-lvl-types-table
  '((1 . message)
    (2 . attachment)))

(defconst mime-tnef-names-table
  '((0 . OWNER) ;; #x0000
    (1 . SENTFOR) ;; #x0001
    (2 . DELEGATE) ;; #x0002
    (6 . DATESTART) ;; #x0006
    (7 . DATEEND) ;; #x0007
    (8 . AIDOWNER) ;; #x0008
    (9 . REQUESTRES) ;; #x0009
    (32768 . FROM) ;; #x8000
    (32772 . SUBJECT) ;; #x8004
    (32773 . DATESENT) ;; #x8005
    (32774 . DATERECD) ;; #x8006
    (32775 . MESSAGESTATUS) ;; #x8007
    (32776 . MESSAGECLASS) ;; #x8008
    (32777 . MESSAGEID) ;; #x8009
    (32778 . PARENTID) ;; #x800a
    (32779 . CONVERSATIONID) ;; #x800b
    (32780 . BODY) ;; #x800c
    (32781 . PRIORITY) ;; #x800d
    (32783 . ATTACHDATA) ;; #x800f
    (32784 . ATTACHTITLE) ;; #x8010
    (32785 . ATTACHMETAFILE) ;; #x8011
    (32786 . ATTACHCREATEDATE) ;; #x8012
    (32787 . ATTACHMODIFYDATE) ;; #x8013
    (32800 . DATEMODIFY) ;; #x8020
    (36865 . ATTACHTRANSPORTFILENAME) ;; #x9001
    (36866 . ATTACHRENDDATA) ;; #x9002
    (36867 . MAPIPROPS) ;; #x9003
    (36868 . RECIPTABLE) ;; #x9004
    (36869 . ATTACHMENT) ;; #x9005
    (36870 . TNEFVERSION) ;; #x9006
    (36871 . OEMCODEPAGE) ;; #x9007
    (36872 . ORIGNINALMESSAGECLASS) ;; #x9008
    ))

(defconst mime-tnef-types-table
  '((0 . TRIPLES) ;; #x0000
    (1 . STRING) ;; #x0001
    (2 . TEXT) ;; #x0002
    (3 . DATE) ;; #x0003
    (4 . SHORT) ;; #x0004
    (5 . LONG) ;; #x0005
    (6 . BYTE) ;; #x0006
    (7 . WORD) ;; #x0007
    (8 . DWORD) ;; #x0008
    (9 . MAX) ;; #x0009
    ))

(defconst mime-tnef-mapi-names-table
  '((1 . ACKNOWLEDGEMENT_MODE) ;; #x0001
    (2 . ALTERNATE_RECIPIENT_ALLOWED) ;; #x0002
    (3 . AUTHORIZING_USERS) ;; #x0003
    (4 . AUTO_FORWARD_COMMENT) ;; #x0004
    (5 . AUTO_FORWARDED) ;; #x0005
    (6 . CONTENT_CONFIDENTIALITY_ALGORITHM_ID) ;; #x0006
    (7 . CONTENT_CORRELATOR) ;; #x0007
    (8 . CONTENT_IDENTIFIER) ;; #x0008
    (9 . CONTENT_LENGTH) ;; #x0009
    (10 . CONTENT_RETURN_REQUESTED) ;; #x000A
    (11 . CONVERSATION_KEY) ;; #x000B
    (12 . CONVERSION_EITS) ;; #x000C
    (13 . CONVERSION_WITH_LOSS_PROHIBITED) ;; #x000D
    (14 . CONVERTED_EITS) ;; #x000E
    (15 . DEFERRED_DELIVERY_TIME) ;; #x000F
    (16 . DELIVER_TIME) ;; #x0010
    (17 . DISCARD_REASON) ;; #x0011
    (18 . DISCLOSURE_OF_RECIPIENTS) ;; #x0012
    (19 . DL_EXPANSION_HISTORY) ;; #x0013
    (20 . DL_EXPANSION_PROHIBITED) ;; #x0014
    (21 . EXPIRY_TIME) ;; #x0015
    (22 . IMPLICIT_CONVERSION_PROHIBITED) ;; #x0016
    (23 . IMPORTANCE) ;; #x0017
    (24 . IPM_ID) ;; #x0018
    (25 . LATEST_DELIVERY_TIME) ;; #x0019
    (26 . MESSAGE_CLASS) ;; #x001A
    (27 . MESSAGE_DELIVERY_ID) ;; #x001B
    (30 . MESSAGE_SECURITY_LABEL) ;; #x001E
    (31 . OBSOLETED_IPMS) ;; #x001F
    (32 . ORIGINALLY_INTENDED_RECIPIENT_NAME) ;; #x0020
    (33 . ORIGINAL_EITS) ;; #x0021
    (34 . ORIGINATOR_CERTIFICATE) ;; #x0022
    (35 . ORIGINATOR_DELIVERY_REPORT_REQUESTED) ;; #x0023
    (36 . ORIGINATOR_RETURN_ADDRESS) ;; #x0024
    (37 . PARENT_KEY) ;; #x0025
    (38 . PRIORITY) ;; #x0026
    (39 . ORIGIN_CHECK) ;; #x0027
    (40 . PROOF_OF_SUBMISSION_REQUESTED) ;; #x0028
    (41 . READ_RECEIPT_REQUESTED) ;; #x0029
    (42 . RECEIPT_TIME) ;; #x002A
    (43 . RECIPIENT_REASSIGNMENT_PROHIBITED) ;; #x002B
    (44 . REDIRECTION_HISTORY) ;; #x002C
    (45 . RELATED_IPMS) ;; #x002D
    (46 . ORIGINAL_SENSITIVITY) ;; #x002E
    (47 . LANGUAGES) ;; #x002F
    (48 . REPLY_TIME) ;; #x0030
    (49 . REPORT_TAG) ;; #x0031
    (50 . REPORT_TIME) ;; #x0032
    (51 . RETURNED_IPM) ;; #x0033
    (52 . SECURITY) ;; #x0034
    (53 . INCOMPLETE_COPY) ;; #x0035
    (54 . SENSITIVITY) ;; #x0036
    (55 . SUBJECT) ;; #x0037
    (56 . SUBJECT_IPM) ;; #x0038
    (57 . CLIENT_SUBMIT_TIME) ;; #x0039
    (58 . REPORT_NAME) ;; #x003A
    (59 . SENT_REPRESENTING_SEARCH_KEY) ;; #x003B
    (60 . X400_CONTENT_TYPE) ;; #x003C
    (61 . SUBJECT_PREFIX) ;; #x003D
    (62 . NON_RECEIPT_REASON) ;; #x003E
    (63 . RECEIVED_BY_ENTRYID) ;; #x003F
    (64 . RECEIVED_BY_NAME) ;; #x0040
    (65 . SENT_REPRESENTING_ENTRYID) ;; #x0041
    (66 . SENT_REPRESENTING_NAME) ;; #x0042
    (67 . RCVD_REPRESENTING_ENTRYID) ;; #x0043
    (68 . RCVD_REPRESENTING_NAME) ;; #x0044
    (69 . REPORT_ENTRYID) ;; #x0045
    (70 . READ_RECEIPT_ENTRYID) ;; #x0046
    (71 . MESSAGE_SUBMISSION_ID) ;; #x0047
    (72 . PROVIDER_SUBMIT_TIME) ;; #x0048
    (73 . ORIGINAL_SUBJECT) ;; #x0049
    (74 . DISC_VAL) ;; #x004A
    (75 . ORIG_MESSAGE_CLASS) ;; #x004B
    (76 . ORIGINAL_AUTHOR_ENTRYID) ;; #x004C
    (77 . ORIGINAL_AUTHOR_NAME) ;; #x004D
    (78 . ORIGINAL_SUBMIT_TIME) ;; #x004E
    (79 . REPLY_RECIPIENT_ENTRIES) ;; #x004F
    (80 . REPLY_RECIPIENT_NAMES) ;; #x0050
    (81 . RECEIVED_BY_SEARCH_KEY) ;; #x0051
    (82 . RCVD_REPRESENTING_SEARCH_KEY) ;; #x0052
    (83 . READ_RECEIPT_SEARCH_KEY) ;; #x0053
    (84 . REPORT_SEARCH_KEY) ;; #x0054
    (85 . ORIGINAL_DELIVERY_TIME) ;; #x0055
    (86 . ORIGINAL_AUTHOR_SEARCH_KEY) ;; #x0056
    (87 . MESSAGE_TO_ME) ;; #x0057
    (88 . MESSAGE_CC_ME) ;; #x0058
    (89 . MESSAGE_RECIP_ME) ;; #x0059
    (90 . ORIGINAL_SENDER_NAME) ;; #x005A
    (91 . ORIGINAL_SENDER_ENTRYID) ;; #x005B
    (92 . ORIGINAL_SENDER_SEARCH_KEY) ;; #x005C
    (93 . ORIGINAL_SENT_REPRESENTING_NAME) ;; #x005D
    (94 . ORIGINAL_SENT_REPRESENTING_ENTRYID) ;; #x005E
    (95 . ORIGINAL_SENT_REPRESENTING_SEARCH_KEY) ;; #x005F
    (96 . START_DATE) ;; #x0060
    (97 . END_DATE) ;; #x0061
    (98 . OWNER_APPT_ID) ;; #x0062
    (99 . RESPONSE_REQUESTED) ;; #x0063
    (100 . SENT_REPRESENTING_ADDRTYPE) ;; #x0064
    (101 . SENT_REPRESENTING_EMAIL_ADDRESS) ;; #x0065
    (102 . ORIGINAL_SENDER_ADDRTYPE) ;; #x0066
    (103 . ORIGINAL_SENDER_EMAIL_ADDRESS) ;; #x0067
    (104 . ORIGINAL_SENT_REPRESENTING_ADDRTYPE) ;; #x0068
    (105 . ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS) ;; #x0069
    (112 . CONVERSATION_TOPIC) ;; #x0070
    (113 . CONVERSATION_INDEX) ;; #x0071
    (114 . ORIGINAL_DISPLAY_BCC) ;; #x0072
    (115 . ORIGINAL_DISPLAY_CC) ;; #x0073
    (116 . ORIGINAL_DISPLAY_TO) ;; #x0074
    (117 . RECEIVED_BY_ADDRTYPE) ;; #x0075
    (118 . RECEIVED_BY_EMAIL_ADDRESS) ;; #x0076
    (119 . RCVD_REPRESENTING_ADDRTYPE) ;; #x0077
    (120 . RCVD_REPRESENTING_EMAIL_ADDRESS) ;; #x0078
    (121 . ORIGINAL_AUTHOR_ADDRTYPE) ;; #x0079
    (122 . ORIGINAL_AUTHOR_EMAIL_ADDRESS) ;; #x007A
    (123 . ORIGINALLY_INTENDED_RECIP_ADDRTYPE) ;; #x007B
    (124 . ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS) ;; #x007C
    (125 . TRANSPORT_MESSAGE_HEADERS) ;; #x007D
    (126 . DELEGATION) ;; #x007E
    (127 . TNEF_CORRELATION_KEY) ;; #x007F
    (4096 . BODY) ;; #x1000
    (4097 . REPORT_TEXT) ;; #x1001
    (4098 . ORIGINATOR_AND_DL_EXPANSION_HISTORY) ;; #x1002
    (4099 . REPORTING_DL_NAME) ;; #x1003
    (4100 . REPORTING_MTA_CERTIFICATE) ;; #x1004
    (4102 . RTF_SYNC_BODY_CRC) ;; #x1006
    (4103 . RTF_SYNC_BODY_COUNT) ;; #x1007
    (4104 . RTF_SYNC_BODY_TAG) ;; #x1008
    (4105 . RTF_COMPRESSED) ;; #x1009
    (4112 . RTF_SYNC_PREFIX_COUNT) ;; #x1010
    (4113 . RTF_SYNC_TRAILING_COUNT) ;; #x1011
    (4114 . ORIGINALLY_INTENDED_RECIP_ENTRYID) ;; #x1012
    (4115 . BODY_HTML) ;; #x1013
    (4149 . SMTP_MESSAGE_ID) ;; #x1035
    (3072 . CONTENT_INTEGRITY_CHECK) ;; #x0C00
    (3073 . EXPLICIT_CONVERSION) ;; #x0C01
    (3074 . IPM_RETURN_REQUESTED) ;; #x0C02
    (3075 . MESSAGE_TOKEN) ;; #x0C03
    (3076 . NDR_REASON_CODE) ;; #x0C04
    (3077 . NDR_DIAG_CODE) ;; #x0C05
    (3078 . NON_RECEIPT_NOTIFICATION_REQUESTED) ;; #x0C06
    (3079 . DELIVERY_POINT) ;; #x0C07
    (3080 . ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED) ;; #x0C08
    (3081 . ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT) ;; #x0C09
    (3082 . PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY) ;; #x0C0A
    (3083 . PHYSICAL_DELIVERY_MODE) ;; #x0C0B
    (3084 . PHYSICAL_DELIVERY_REPORT_REQUEST) ;; #x0C0C
    (3085 . PHYSICAL_FORWARDING_ADDRESS) ;; #x0C0D
    (3086 . PHYSICAL_FORWARDING_ADDRESS_REQUESTED) ;; #x0C0E
    (3087 . PHYSICAL_FORWARDING_PROHIBITED) ;; #x0C0F
    (3088 . PHYSICAL_RENDITION_ATTRIBUTES) ;; #x0C10
    (3089 . PROOF_OF_DELIVERY) ;; #x0C11
    (3090 . PROOF_OF_DELIVERY_REQUESTED) ;; #x0C12
    (3091 . RECIPIENT_CERTIFICATE) ;; #x0C13
    (3092 . RECIPIENT_NUMBER_FOR_ADVICE) ;; #x0C14
    (3093 . RECIPIENT_TYPE) ;; #x0C15
    (3094 . REGISTERED_MAIL_TYPE) ;; #x0C16
    (3095 . REPLY_REQUESTED) ;; #x0C17
    (3096 . REQUESTED_DELIVERY_METHOD) ;; #x0C18
    (3097 . SENDER_ENTRYID) ;; #x0C19
    (3098 . SENDER_NAME) ;; #x0C1A
    (3099 . SUPPLEMENTARY_INFO) ;; #x0C1B
    (3100 . TYPE_OF_MTS_USER) ;; #x0C1C
    (3101 . SENDER_SEARCH_KEY) ;; #x0C1D
    (3102 . SENDER_ADDRTYPE) ;; #x0C1E
    (3103 . SENDER_EMAIL_ADDRESS) ;; #x0C1F
    (3584 . CURRENT_VERSION) ;; #x0E00
    (3585 . DELETE_AFTER_SUBMIT) ;; #x0E01
    (3586 . DISPLAY_BCC) ;; #x0E02
    (3587 . DISPLAY_CC) ;; #x0E03
    (3588 . DISPLAY_TO) ;; #x0E04
    (3589 . PARENT_DISPLAY) ;; #x0E05
    (3590 . MESSAGE_DELIVERY_TIME) ;; #x0E06
    (3591 . MESSAGE_FLAGS) ;; #x0E07
    (3592 . MESSAGE_SIZE) ;; #x0E08
    (3593 . PARENT_ENTRYID) ;; #x0E09
    (3594 . SENTMAIL_ENTRYID) ;; #x0E0A
    (3596 . CORRELATE) ;; #x0E0C
    (3597 . CORRELATE_MTSID) ;; #x0E0D
    (3598 . DISCRETE_VALUES) ;; #x0E0E
    (3599 . RESPONSIBILITY) ;; #x0E0F
    (3600 . SPOOLER_STATUS) ;; #x0E10
    (3601 . TRANSPORT_STATUS) ;; #x0E11
    (3602 . MESSAGE_RECIPIENTS) ;; #x0E12
    (3603 . MESSAGE_ATTACHMENTS) ;; #x0E13
    (3604 . SUBMIT_FLAGS) ;; #x0E14
    (3605 . RECIPIENT_STATUS) ;; #x0E15
    (3606 . TRANSPORT_KEY) ;; #x0E16
    (3607 . MSG_STATUS) ;; #x0E17
    (3608 . MESSAGE_DOWNLOAD_TIME) ;; #x0E18
    (3609 . CREATION_VERSION) ;; #x0E19
    (3610 . MODIFY_VERSION) ;; #x0E1A
    (3611 . HASATTACH) ;; #x0E1B
    (3612 . BODY_CRC) ;; #x0E1C
    (3613 . NORMALIZED_SUBJECT) ;; #x0E1D
    (3615 . RTF_IN_SYNC) ;; #x0E1F
    (3616 . ATTACH_SIZE) ;; #x0E20
    (3617 . ATTACH_NUM) ;; #x0E21
    (3618 . PREPROCESS) ;; #x0E22
    (3621 . ORIGINATING_MTA_CERTIFICATE) ;; #x0E25
    (3622 . PROOF_OF_SUBMISSION) ;; #x0E26
    (4095 . ENTRYID) ;; #x0FFF
    (4094 . OBJECT_TYPE) ;; #x0FFE
    (4093 . ICON) ;; #x0FFD
    (4092 . MINI_ICON) ;; #x0FFC
    (4091 . STORE_ENTRYID) ;; #x0FFB
    (4090 . STORE_RECORD_KEY) ;; #x0FFA
    (4089 . RECORD_KEY) ;; #x0FF9
    (4088 . MAPPING_SIGNATURE) ;; #x0FF8
    (4087 . ACCESS_LEVEL) ;; #x0FF7
    (4086 . INSTANCE_KEY) ;; #x0FF6
    (4085 . ROW_TYPE) ;; #x0FF5
    (4084 . ACCESS) ;; #x0FF4
    (12288 . ROWID) ;; #x3000
    (12289 . DISPLAY_NAME) ;; #x3001
    (12290 . ADDRTYPE) ;; #x3002
    (12291 . EMAIL_ADDRESS) ;; #x3003
    (12292 . COMMENT) ;; #x3004
    (12293 . DEPTH) ;; #x3005
    (12294 . PROVIDER_DISPLAY) ;; #x3006
    (12295 . CREATION_TIME) ;; #x3007
    (12296 . LAST_MODIFICATION_TIME) ;; #x3008
    (12297 . RESOURCE_FLAGS) ;; #x3009
    (12298 . PROVIDER_DLL_NAME) ;; #x300A
    (12299 . SEARCH_KEY) ;; #x300B
    (12300 . PROVIDER_UID) ;; #x300C
    (12301 . PROVIDER_ORDINAL) ;; #x300D
    (13057 . FORM_VERSION) ;; #x3301
    (13058 . FORM_CLSID) ;; #x3302
    (13059 . FORM_CONTACT_NAME) ;; #x3303
    (13060 . FORM_CATEGORY) ;; #x3304
    (13061 . FORM_CATEGORY_SUB) ;; #x3305
    (13062 . FORM_HOST_MAP) ;; #x3306
    (13063 . FORM_HIDDEN) ;; #x3307
    (13064 . FORM_DESIGNER_NAME) ;; #x3308
    (13065 . FORM_DESIGNER_GUID) ;; #x3309
    (13066 . FORM_MESSAGE_BEHAVIOR) ;; #x330A
    (13312 . DEFAULT_STORE) ;; #x3400
    (13325 . STORE_SUPPORT_MASK) ;; #x340D
    (13326 . STORE_STATE) ;; #x340E
    (13328 . IPM_SUBTREE_SEARCH_KEY) ;; #x3410
    (13329 . IPM_OUTBOX_SEARCH_KEY) ;; #x3411
    (13330 . IPM_WASTEBASKET_SEARCH_KEY) ;; #x3412
    (13331 . IPM_SENTMAIL_SEARCH_KEY) ;; #x3413
    (13332 . MDB_PROVIDER) ;; #x3414
    (13333 . RECEIVE_FOLDER_SETTINGS) ;; #x3415
    (13791 . VALID_FOLDER_MASK) ;; #x35DF
    (13792 . IPM_SUBTREE_ENTRYID) ;; #x35E0
    (13794 . IPM_OUTBOX_ENTRYID) ;; #x35E2
    (13795 . IPM_WASTEBASKET_ENTRYID) ;; #x35E3
    (13796 . IPM_SENTMAIL_ENTRYID) ;; #x35E4
    (13797 . VIEWS_ENTRYID) ;; #x35E5
    (13798 . COMMON_VIEWS_ENTRYID) ;; #x35E6
    (13799 . FINDER_ENTRYID) ;; #x35E7
    (13824 . CONTAINER_FLAGS) ;; #x3600
    (13825 . FOLDER_TYPE) ;; #x3601
    (13826 . CONTENT_COUNT) ;; #x3602
    (13827 . CONTENT_UNREAD) ;; #x3603
    (13828 . CREATE_TEMPLATES) ;; #x3604
    (13829 . DETAILS_TABLE) ;; #x3605
    (13831 . SEARCH) ;; #x3607
    (13833 . SELECTABLE) ;; #x3609
    (13834 . SUBFOLDERS) ;; #x360A
    (13835 . STATUS) ;; #x360B
    (13836 . ANR) ;; #x360C
    (13837 . CONTENTS_SORT_ORDER) ;; #x360D
    (13838 . CONTAINER_HIERARCHY) ;; #x360E
    (13839 . CONTAINER_CONTENTS) ;; #x360F
    (13840 . FOLDER_ASSOCIATED_CONTENTS) ;; #x3610
    (13841 . DEF_CREATE_DL) ;; #x3611
    (13842 . DEF_CREATE_MAILUSER) ;; #x3612
    (13843 . CONTAINER_CLASS) ;; #x3613
    (13844 . CONTAINER_MODIFY_VERSION) ;; #x3614
    (13845 . AB_PROVIDER_ID) ;; #x3615
    (13846 . DEFAULT_VIEW_ENTRYID) ;; #x3616
    (13847 . ASSOC_CONTENT_COUNT) ;; #x3617
    (14080 . ATTACHMENT_X400_PARAMETERS) ;; #x3700
    (14081 . ATTACH_DATA_OBJ) ;; #x3701
    (14082 . ATTACH_ENCODING) ;; #x3702
    (14083 . ATTACH_EXTENSION) ;; #x3703
    (14084 . ATTACH_FILENAME) ;; #x3704
    (14085 . ATTACH_METHOD) ;; #x3705
    (14087 . ATTACH_LONG_FILENAME) ;; #x3707
    (14088 . ATTACH_PATHNAME) ;; #x3708
    (14089 . ATTACH_RENDERING) ;; #x3709
    (14090 . ATTACH_TAG) ;; #x370A
    (14091 . RENDERING_POSITION) ;; #x370B
    (14092 . ATTACH_TRANSPORT_NAME) ;; #x370C
    (14093 . ATTACH_LONG_PATHNAME) ;; #x370D
    (14094 . ATTACH_MIME_TAG) ;; #x370E
    (14095 . ATTACH_ADDITIONAL_INFO) ;; #x370F
    (14096 . ATTACH_MIME_SEQUENCE) ;; #x3710
    (14098 . ATTACH_CONTENT_ID) ;; #x3712
    (14099 . ATTACH_CONTENT_LOCATION) ;; #x3713
    (14100 . ATTACH_FLAGS) ;; #x3714
    (14592 . DISPLAY_TYPE) ;; #x3900
    (14594 . TEMPLATEID) ;; #x3902
    (14596 . PRIMARY_CAPABILITY) ;; #x3904
    (14847 . 7BIT_DISPLAY_NAME) ;; #x39FF
    (14848 . ACCOUNT) ;; #x3A00
    (14849 . ALTERNATE_RECIPIENT) ;; #x3A01
    (14850 . CALLBACK_TELEPHONE_NUMBER) ;; #x3A02
    (14851 . CONVERSION_PROHIBITED) ;; #x3A03
    (14852 . DISCLOSE_RECIPIENTS) ;; #x3A04
    (14853 . GENERATION) ;; #x3A05
    (14854 . GIVEN_NAME) ;; #x3A06
    (14855 . GOVERNMENT_ID_NUMBER) ;; #x3A07
    (14856 . BUSINESS_TELEPHONE_NUMBER) ;; #x3A08
    (14857 . HOME_TELEPHONE_NUMBER) ;; #x3A09
    (14858 . INITIALS) ;; #x3A0A
    (14859 . KEYWORD) ;; #x3A0B
    (14860 . LANGUAGE) ;; #x3A0C
    (14861 . LOCATION) ;; #x3A0D
    (14862 . MAIL_PERMISSION) ;; #x3A0E
    (14863 . MHS_COMMON_NAME) ;; #x3A0F
    (14864 . ORGANIZATIONAL_ID_NUMBER) ;; #x3A10
    (14865 . SURNAME) ;; #x3A11
    (14866 . ORIGINAL_ENTRYID) ;; #x3A12
    (14867 . ORIGINAL_DISPLAY_NAME) ;; #x3A13
    (14868 . ORIGINAL_SEARCH_KEY) ;; #x3A14
    (14869 . POSTAL_ADDRESS) ;; #x3A15
    (14870 . COMPANY_NAME) ;; #x3A16
    (14871 . TITLE) ;; #x3A17
    (14872 . DEPARTMENT_NAME) ;; #x3A18
    (14873 . OFFICE_LOCATION) ;; #x3A19
    (14874 . PRIMARY_TELEPHONE_NUMBER) ;; #x3A1A
    (14875 . BUSINESS2_TELEPHONE_NUMBER) ;; #x3A1B
    (14876 . MOBILE_TELEPHONE_NUMBER) ;; #x3A1C
    (14877 . RADIO_TELEPHONE_NUMBER) ;; #x3A1D
    (14878 . CAR_TELEPHONE_NUMBER) ;; #x3A1E
    (14879 . OTHER_TELEPHONE_NUMBER) ;; #x3A1F
    (14880 . TRANSMITABLE_DISPLAY_NAME) ;; #x3A20
    (14881 . PAGER_TELEPHONE_NUMBER) ;; #x3A21
    (14882 . USER_CERTIFICATE) ;; #x3A22
    (14883 . PRIMARY_FAX_NUMBER) ;; #x3A23
    (14884 . BUSINESS_FAX_NUMBER) ;; #x3A24
    (14885 . HOME_FAX_NUMBER) ;; #x3A25
    (14886 . COUNTRY) ;; #x3A26
    (14887 . LOCALITY) ;; #x3A27
    (14888 . STATE_OR_PROVINCE) ;; #x3A28
    (14889 . STREET_ADDRESS) ;; #x3A29
    (14890 . POSTAL_CODE) ;; #x3A2A
    (14891 . POST_OFFICE_BOX) ;; #x3A2B
    (14892 . TELEX_NUMBER) ;; #x3A2C
    (14893 . ISDN_NUMBER) ;; #x3A2D
    (14894 . ASSISTANT_TELEPHONE_NUMBER) ;; #x3A2E
    (14895 . HOME2_TELEPHONE_NUMBER) ;; #x3A2F
    (14896 . ASSISTANT) ;; #x3A30
    (14912 . SEND_RICH_INFO) ;; #x3A40
    (14913 . WEDDING_ANNIVERSARY) ;; #x3A41
    (14914 . BIRTHDAY) ;; #x3A42
    (14915 . HOBBIES) ;; #x3A43
    (14916 . MIDDLE_NAME) ;; #x3A44
    (14917 . DISPLAY_NAME_PREFIX) ;; #x3A45
    (14918 . PROFESSION) ;; #x3A46
    (14919 . PREFERRED_BY_NAME) ;; #x3A47
    (14920 . SPOUSE_NAME) ;; #x3A48
    (14921 . COMPUTER_NETWORK_NAME) ;; #x3A49
    (14922 . CUSTOMER_ID) ;; #x3A4A
    (14923 . TTYTDD_PHONE_NUMBER) ;; #x3A4B
    (14924 . FTP_SITE) ;; #x3A4C
    (14925 . GENDER) ;; #x3A4D
    (14926 . MANAGER_NAME) ;; #x3A4E
    (14927 . NICKNAME) ;; #x3A4F
    (14928 . PERSONAL_HOME_PAGE) ;; #x3A50
    (14929 . BUSINESS_HOME_PAGE) ;; #x3A51
    (14930 . CONTACT_VERSION) ;; #x3A52
    (14931 . CONTACT_ENTRYIDS) ;; #x3A53
    (14932 . CONTACT_ADDRTYPES) ;; #x3A54
    (14933 . CONTACT_DEFAULT_ADDRESS_INDEX) ;; #x3A55
    (14934 . CONTACT_EMAIL_ADDRESSES) ;; #x3A56
    (14935 . COMPANY_MAIN_PHONE_NUMBER) ;; #x3A57
    (14936 . CHILDRENS_NAMES) ;; #x3A58
    (14937 . HOME_ADDRESS_CITY) ;; #x3A59
    (14938 . HOME_ADDRESS_COUNTRY) ;; #x3A5A
    (14939 . HOME_ADDRESS_POSTAL_CODE) ;; #x3A5B
    (14940 . HOME_ADDRESS_STATE_OR_PROVINCE) ;; #x3A5C
    (14941 . HOME_ADDRESS_STREET) ;; #x3A5D
    (14942 . HOME_ADDRESS_POST_OFFICE_BOX) ;; #x3A5E
    (14943 . OTHER_ADDRESS_CITY) ;; #x3A5F
    (14944 . OTHER_ADDRESS_COUNTRY) ;; #x3A60
    (14945 . OTHER_ADDRESS_POSTAL_CODE) ;; #x3A61
    (14946 . OTHER_ADDRESS_STATE_OR_PROVINCE) ;; #x3A62
    (14947 . OTHER_ADDRESS_STREET) ;; #x3A63
    (14948 . OTHER_ADDRESS_POST_OFFICE_BOX) ;; #x3A64
    (15616 . STORE_PROVIDERS) ;; #x3D00
    (15617 . AB_PROVIDERS) ;; #x3D01
    (15618 . TRANSPORT_PROVIDERS) ;; #x3D02
    (15620 . DEFAULT_PROFILE) ;; #x3D04
    (15621 . AB_SEARCH_PATH) ;; #x3D05
    (15622 . AB_DEFAULT_DIR) ;; #x3D06
    (15623 . AB_DEFAULT_PAB) ;; #x3D07
    (15624 . FILTERING_HOOKS) ;; #x3D08
    (15625 . SERVICE_NAME) ;; #x3D09
    (15626 . SERVICE_DLL_NAME) ;; #x3D0A
    (15627 . SERVICE_ENTRY_NAME) ;; #x3D0B
    (15628 . SERVICE_UID) ;; #x3D0C
    (15629 . SERVICE_EXTRA_UIDS) ;; #x3D0D
    (15630 . SERVICES) ;; #x3D0E
    (15631 . SERVICE_SUPPORT_FILES) ;; #x3D0F
    (15632 . SERVICE_DELETE_FILES) ;; #x3D10
    (15633 . AB_SEARCH_PATH_UPDATE) ;; #x3D11
    (15634 . PROFILE_NAME) ;; #x3D12
    (15872 . IDENTITY_DISPLAY) ;; #x3E00
    (15873 . IDENTITY_ENTRYID) ;; #x3E01
    (15874 . RESOURCE_METHODS) ;; #x3E02
    (15875 . RESOURCE_TYPE) ;; #x3E03
    (15876 . STATUS_CODE) ;; #x3E04
    (15877 . IDENTITY_SEARCH_KEY) ;; #x3E05
    (15878 . OWN_STORE_ENTRYID) ;; #x3E06
    (15879 . RESOURCE_PATH) ;; #x3E07
    (15880 . STATUS_STRING) ;; #x3E08
    (15881 . X400_DEFERRED_DELIVERY_CANCEL) ;; #x3E09
    (15882 . HEADER_FOLDER_ENTRYID) ;; #x3E0A
    (15883 . REMOTE_PROGRESS) ;; #x3E0B
    (15884 . REMOTE_PROGRESS_TEXT) ;; #x3E0C
    (15885 . REMOTE_VALIDATE_OK) ;; #x3E0D
    (16128 . CONTROL_FLAGS) ;; #x3F00
    (16129 . CONTROL_STRUCTURE) ;; #x3F01
    (16130 . CONTROL_TYPE) ;; #x3F02
    (16131 . DELTAX) ;; #x3F03
    (16132 . DELTAY) ;; #x3F04
    (16133 . XPOS) ;; #x3F05
    (16134 . YPOS) ;; #x3F06
    (16135 . CONTROL_ID) ;; #x3F07
    (16136 . INITIAL_DETAILS_PANE) ;; #x3F08
    (26608 . ID_SECURE_MIN) ;; #x67F0
    (26623 . ID_SECURE_MAX) ;; #x67FF
    ))

(defconst mime-tnef-mapi-types-table
  '((0 . UNSPECIFIED) ;; #x0000
    (1 . NULL) ;; #x0001
    (2 . SHORT) ;; #x0002
    (3 . INT) ;; #x0003
    (4 . FLOAT) ;; #x0004
    (5 . DOUBLE) ;; #x0005
    (6 . CURRENCY) ;; #x0006
    (7 . APPTIME) ;; #x0007
    (10 . ERROR) ;; #x000a
    (11 . BOOLEAN) ;; #x000b
    (13 . OBJECT) ;; #x000d
    (20 . INT8BYTE) ;; #x0014
    (30 . STRING) ;; #x001e
    (31 . UNICODE_STRING) ;; #x001f
    (64 . SYSTIME) ;; #x0040
    (72 . CLSID) ;; #x0048
    (258 . BINARY) ;; #x0102
    ))


;;; Internal functions

(defmacro mime-tnef-byte (array idx)
  `(logand (aref ,array ,idx) 255))

(defmacro mime-tnef-padded-length (l)
  ;; L must be integer.
  `(* (/ (+ ,l 3) 4) 4))

(eval-and-compile
  (defsubst mime-tnef-2bytes (array idx)
    (+ (mime-tnef-byte array idx)
       (* (mime-tnef-byte array (1+ idx)) 256)))

  (defsubst mime-tnef-4bytes (array idx)
    (+ (mime-tnef-byte array idx)
       (* (mime-tnef-byte array (1+ idx)) 256)
       (* (mime-tnef-byte array (+ idx 2)) 65536)
       (* (mime-tnef-byte array (+ idx 3)) 16777216))))


;;; Debug

(defvar mime-tnef-debug nil)

(defun mime-tnef-debug (string &rest args)
  (when mime-tnef-debug
    (if args (apply #'message string args)
      (message "%s" string))))


;;; TNEF element

(defun mime-tnef-element-start (element)
  (cdr (assq 'start element)))

(defun mime-tnef-element-end (element)
  (cdr (assq 'end element)))

(defun mime-tnef-element-name (element)
  (cdr (assq 'name element)))

(defun mime-tnef-element-type (element)
  (cdr (assq 'type element)))


;;; TNEF

(defun mime-tnef-parse (string)
  (catch :done
    (unless (and (> (length string) 6)
		 (equal (string-make-unibyte (substring string 0 4))
			(string-make-unibyte "\x78\x9f\x3e\x22")))
      (message "Input data does not seem to be MS-TNEF format")
      (throw :done nil))
    (mime-tnef-debug "TNEF Key: %04x\n" (mime-tnef-2bytes string 4))
    (let ((length (length string))
	  (read 6)
	  result object
	  lvl-type name type
	  sum
	  start end data-length)
      (while (< read length)
	(setq lvl-type (mime-tnef-byte string read)
	      name (mime-tnef-2bytes string (1+ read))
	      type (mime-tnef-2bytes string (+ read 3))
	      data-length (mime-tnef-4bytes string (+ read 5))
	      start (+ read 9)
	      end (+ start data-length)
	      object `(
		       (lvl-type . ,(or (cdr (assq lvl-type
		       				   mime-tnef-lvl-types-table))
					lvl-type))
		       (name . ,(or (cdr (assq name mime-tnef-names-table))
				    name))
		       (type . ,(or (cdr (assq type mime-tnef-types-table))
				    type))
		       (start . ,start)
		       (end . ,end)
		       ;; (length . ,(mime-tnef-4bytes string (+ read 5)))
		       )
	      read (+ read data-length 9 2)
	      sum 0)
	(dotimes (i data-length)
	  (setq sum (+ sum (mime-tnef-byte string (- read 3 i)))))
	(unless (eq (mime-tnef-2bytes string (- read 2)) (% sum 65536))
	  (message "Checksum mismatch, TNEF may be corrupted"))
	(setq result (cons object result)))
      (cons (nreverse result) string))))

(defun mime-tnef-codepage (tnef)
  (let ((elements (car tnef))
	codepage)
    (while elements
      (if (eq (mime-tnef-element-name (car elements)) 'OEMCODEPAGE)
	  (setq codepage (mime-tnef-4bytes
			  (cdr tnef) (mime-tnef-element-start (car elements)))
		elements nil)
	(setq elements (cdr elements))))
    (mime-tnef-debug "TNEF codepage is %d" codepage)
    codepage))

(defun mime-tnef-coding-system (tnef)
  (intern (format "cp%d" (mime-tnef-codepage tnef))))

(defun mime-tnef-decode-string (string tnef)
  (let ((coding (mime-tnef-coding-system tnef)))
    (decode-coding-string string
			  (if (coding-system-p coding)
			      coding
			    (detect-coding-string string t)))))

(defun mime-tnef-decode-unicode-string (string)
  (decode-coding-string string (and mime-tnef-unicode-coding-system
				    (detect-coding-string string t))))


;;; MAPI

(defun mime-tnef-mapi-parse (element tnef)
  (catch :done
    (let* ((raw (cdr tnef))
	   (read (mime-tnef-element-start element))
	   (count (mime-tnef-4bytes raw read))
	   result)
      (setq read (+ read 4))
      (mime-tnef-debug "MAPI count is %d" count)
      (dotimes (_i count)
	(let ((type (mime-tnef-2bytes raw read))
	      (name (mime-tnef-2bytes raw (+ read 2)))
	      (multi 1))
	  (setq read (+ read 4))
	  (when (> (logand name 32768) 0) ;; #x8000
	    (mime-tnef-debug "MAPI element have GUID")
	    (let ((num (mime-tnef-4bytes raw (+ read 16))))
	      (mime-tnef-debug "MAPI number of GUID names is %d" num)
	      (if (zerop num)
		  (setq name (mime-tnef-2bytes raw (+ read 20))
			read (+ read 24))
		(setq read (+ read 20))
		(dotimes (_i num)
		  (setq read (+ read 4
				(mime-tnef-padded-length
				 (mime-tnef-4bytes raw (+ read)))))))))
	  (when (or (> (logand type 4096) 0) ;; #x1000
		    (memq (cdr (assq type mime-tnef-mapi-types-table))
			  '(STRING UNICODE_STRING OBJECT BINARY)))
	    (mime-tnef-debug "MAPI element have multi-values")
	    (setq multi (prog1 (mime-tnef-4bytes raw read)
			  (setq read (+ read 4)))
		  type (logand type 61439))) ;; #xefff
	  (setq type (or (cdr (assq type mime-tnef-mapi-types-table)) type)
		name (or (cdr (assq name mime-tnef-mapi-names-table)) name))
	  (mime-tnef-debug
	   "MAPI %s (type %s), number of values is %d"
	   (if (integerp name) (format "%x" name) name) type multi)
	  (let (values)
	    (dotimes (_i multi)
	      (cond
	       ((memq type '(SHORT BOOLEAN))
		(setq values (cons (mime-tnef-2bytes raw read) values)
		      ;; Padding 2 bytes.
		      read (+ read 4)))
	       ((memq type '(INT FLOAT))
		(setq values (cons (substring raw read (+ read 4)) values)
		      read (+ read 4)))
	       ((memq type '(SYSTIME DOUBLE APPTIME CURRENCY INT8BYTE))
		(setq values (cons (cons read (+ read 8)) values)
		      read (+ read 8)))
	       ((eq type 'CLSID)
		(setq values (cons (cons read (+ read 16)) values)
		      read (+ read 16)))
	       ((memq type '(STRING UNICODE_STRING OBJECT BINARY))
		(let ((length (mime-tnef-4bytes raw read)))
		  (unless (zerop length)
		    (setq values
			  (cons (cons
				 (+ read 4)
				 (+ read 4 length
				    (or (cdr (assq type
						   '((STRING . -1)
						     (UNICODE_STRING . -2))))
					0)))
				values)))
		  (setq read (+ read 4 (mime-tnef-padded-length length)))))
	       (t
		(message "TNEF may be corrupted!!")
		(throw :done (nreverse result)))))
	    (setq result
		  (cons `((name . ,name) (type . ,type) (values . ,values))
			result)))))
      (nreverse result))))

(defun mime-tnef-mapi-string (mapi-element tnef)
  (let* ((value (cadr (assq 'values mapi-element)))
	 (string (substring (cdr tnef) (car value) (cdr value))))
    (if (eq (cdr (assq 'type mapi-element)) 'UNICODE_STRING)
	(mime-tnef-decode-unicode-string string)
      (mime-tnef-decode-string string tnef))))


;;; files

(defun mime-tnef-files (tnef)
  (let ((elements (car tnef))
	files file type)
    (while elements
      (setq type (mime-tnef-element-name (car elements)))
      (cond
       ((eq type 'ATTACHRENDDATA)
	(when file
	  (setq files (cons file files)
		file nil)))
       ((eq type 'ATTACHDATA)
	(when (assq 'start file)
	  (mime-tnef-debug "Multiple ATTACHDATA for single ATTACHRENDDATA"))
	(setq file (append
		    `(,(assq 'start (car elements))
		      ,(assq 'end (car elements)))
		    (delq (assq 'start file)
			  (delq (assq 'end file) file)))))
       ((eq type 'ATTACHTITLE)
	(unless (assq 'name file)
	  (let ((start (mime-tnef-element-start (car elements)))
		(end (mime-tnef-element-end (car elements))))
	    (setq file
		  (cons `(name . ,(mime-tnef-decode-string
				   (substring (cdr tnef) start end) tnef))
			file)))))
       ((eq type 'ATTACHMENT)
	(let ((mapi (mime-tnef-mapi-parse (car elements) tnef)))
	  (while mapi
	    (let* ((elt (car mapi))
		   (name (cdr (assq 'name elt))))
	      (cond
	       ((eq name 'ATTACH_LONG_FILENAME)
		(setq file (append `((name . ,(mime-tnef-mapi-string elt tnef))
				    (longname . t))
				  (delq (assq 'longname file)
					(delq (assq 'name file) file)))))
	       ((eq name 'DISPLAY_NAME)
		;; ATTACH_LONG_FILENAME is preferred.
		(unless (assq 'longname file)
		  (setq file (cons `(name . ,(mime-tnef-mapi-string elt tnef))
				   (delq (assq 'name file) file)))))))
	    (setq mapi (cdr mapi))))))
      (setq elements (cdr elements)))
    (delq nil (nreverse (cons file files)))))


;;; MIME-view

(defun mime-tnef-insert-file-parameters (params file data)
  (let (charset
	result)
    (dolist (elt params)
      (setq result
	    (cons
	     (cons
	      (car elt)
	      (if (eq (cdr elt) 'charset)
		  (or charset
		      (let ((codings (detect-coding-string data)))
			(while (and (null charset) codings)
			  (setq charset (coding-system-to-mime-charset
					 (car codings)))
			  (when charset
			    (setq charset (symbol-name charset)))
			  (setq codings (cdr codings)))
			charset))
		(cdr elt)))
	     result)))
    (mime-edit-insert-file-parameters (nreverse result) file)))

(defun mime-tnef-insert-file (file data)
  (let*  ((guess (mime-find-file-type file))
	  (type (nth 0 guess))
	  (subtype (nth 1 guess))
	  (parameters (nth 2 guess))
	  (encoding "8bit")
	  (disposition-type (nth 4 guess))
	  (disposition-params (nth 5 guess)))
    (setq parameters
	  (concat
	   (when (consp parameters)
	     (mime-tnef-insert-file-parameters parameters file data))
	   (when disposition-type
	     (concat "\n" "Content-Disposition: " disposition-type
		     (mime-edit-insert-file-parameters
		      disposition-params file)))))
    (insert
     ;; multibyte buffer is needed for non-ASCII filename.
     (with-temp-buffer
       (mime-edit-insert-tag type subtype parameters)
       (mime-edit-define-encoding encoding)
       (goto-char (point-min))
       (mime-tnef-translate-single-part-tag)
       (buffer-string)))
    (insert data "\n")))

(defun mime-tnef-translate-single-part-tag ()
  (if (re-search-forward mime-edit-single-part-tag-regexp nil t)
      (let* ((beg (match-beginning 0))
	     (end (match-end 0))
	     (tag (buffer-substring beg end)))
	(delete-region beg end)
	(let ((contype (mime-edit-get-contype tag))
	      (encoding (mime-edit-get-encoding tag)))
	  (save-restriction
	    (narrow-to-region (point)(point))
	    (insert "Content-Type: " contype "\n")
	    (if encoding
		(insert "Content-Transfer-Encoding: " encoding "\n"))
	    (mime-encode-header-in-buffer))
	  (cons (and contype
		     (downcase contype))
		(and encoding
		     (downcase encoding)))))))

(defvar mime-tnef-buffers nil)

(defun mime-tnef-kill-buffers ()
  (mapc (lambda (buffer)
	  (when (bufferp buffer)
	    (kill-buffer buffer)))
	mime-tnef-buffers))

(eval-when-compile (require 'mmgeneric))

(defun mime-display-application/ms-tnef (entity _situation)
  (let ((tnef (mime-tnef-parse (mime-entity-content entity)))
	files p buffer tnef-entity)
    (setq files (and (car tnef) (mime-tnef-files tnef)))
    (if (null files)
	(insert (if (car tnef)
		    "No attachment.\n"
		  "Data may be corrupted.\n"))
      (goto-char (setq p (point-max)))
      (save-restriction
      	(narrow-to-region p p)
      	(setq buffer (generate-new-buffer
		      (concat mime-temp-buffer-name "TNEF*")))
      	(with-current-buffer buffer
	  (require 'mmbuffer)
	  (set-buffer-multibyte nil)
	  (let ((boundary (concat "TNEF-" (mime-edit-make-boundary))))
	    (insert "Content-Type: multipart/mixed;\n"
		    " boundary=\"" boundary "\"\n"
		    "Content-Transfer-Encoding: 7bit\n\n")
	    ;; (mime-encode-header-in-buffer)
	    ;; (goto-char (point-max))
	    (while files
	      (narrow-to-region (point) (point))
	      (insert "--" boundary "\n")
	      (mime-tnef-insert-file (cdr (assq 'name (car files)))
				     (substring
				      (cdr tnef)
				      (cdr (assq 'start (car files)))
				      (cdr (assq 'end (car files)))))
	      (goto-char (point-max))
	      (setq files (cdr files)))
	    (widen)
	    (insert "--" boundary "--" "\n")
	    (setq tnef-entity
	 	  (mime-parse-message
      	 	   (mm-expand-class-name 'buffer)
      	 	   nil entity (mime-entity-node-id entity))
      	 	  buffer-read-only t)))
	(add-hook 'kill-buffer-hook 'mime-tnef-kill-buffers nil t)
	(make-local-variable 'mime-tnef-buffers)
	(add-to-list 'mime-tnef-buffers buffer)
	(mime-display-entity
	 tnef-entity nil '((header . invisible)
			   (body . visible)
			   (entity-button . invisible)))))))

;;; @ end
;;;

(provide 'mime-tnef)

;;; mime-tnef.el ends here
07070100000018000081A4000003E80000006400000001627140E5000050FD000000000000000000000000000000000000002E00000000semi-1.14.6+239+gb1c245b81715/mime-ui-en.texi\input texinfo.tex
@setfilename mime-ui-en.info
@settitle SEMI-EPG 1.14 Manual
@documentlanguage en

@dircategory GNU Emacs Lisp
@direntry
* SEMI-EPG (en): (mime-ui-en).      MIME user interface.
@end direntry

@titlepage
@title SEMI-EPG 1.14 Manual
@author MORIOKA Tomohiko <morioka@@jaist.ac.jp>
@author Kazuhiro Ito
@subtitle 2020/09/17
@end titlepage
@node Top, Introduction, (dir), (dir)
@top SEMI-EPG 1.14 Manual

@ifinfo

This file documents SEMI, a MIME user interface for GNU Emacs.
@end ifinfo

@menu
* Introduction::                What is SEMI-EPG?
* MIME-View::                   MIME message viewing
* MIME-Edit::                   MIME message editing
* Various::                     Miscellaneous
* Concept Index::               
* Function Index::              
* Variable Index::              
@end menu

@node Introduction, MIME-View, Top, Top
@chapter What is SEMI-EPG?

SEMI is a package for GNU Emacs to provide features related with MIME
user interface.  SEMI-EPG is a variant of SEMI, which
features supports to EasyPG and latest Emacs.@refill

SEMI provides two user interfaces: MIME-View and MIME-Edit.@refill


MIME-View is a kernel of user interface to display or operate MIME
messages, STD 11 messages or ``localized RFC 822'' messages.@refill

MIME-Edit is a user interface to compose MIME messages.@refill

Each MUA can use powerful MIME features to combine these features.


@node MIME-View, MIME-Edit, Introduction, Top
@chapter MIME message viewing

MIME-View is a MIME viewer for wide use that runs on GNU Emacs.@refill

MIME-View is the kernel of the user interface for browsing MIME
messages. You can start some presentation-method which is a program for
creating some representation, or some acting-method which is a program
for processing the entity. Then you can deal with a variety of entities.


@menu
* Overview of MIME-View::       Basic design
* MIME-Preview::                Presentation of mime-preview-buffer
* mime-view-mode::              Operation in mime-preview-buffer
@end menu

@node Overview of MIME-View, MIME-Preview, MIME-View, MIME-View
@section Basic design

The representation form of the internet messages in electric letters
or in net news is based on STD 11. The STD 11 message body is a plain
text which consists of lines as its only structure, and the character
code is fixed as us-ascii. Actually, there are ``localized STD 11''
messages that use some character code in their linguistic range
instead of using us-ascii. Even in that case, the character code in
the message is single. Therefore, Message User Agents have considered
(byte row) = (us-ascii string), or (byte row) = (string in the
character code in the linguistic range).@refill

Although, the MIME message has the tree structure in entity unit.
And one message can contain multiple character codes. The content of
an entity can be not only a letter or an image that can be displayed
simply, but also can be a voice or an animation that are played for
some time interval, a data for some specific application, a source
code of some program, or an external reference that consists of
the usage of ftp or mail service, or some URL. Therefore the simple
extension of STD 11 user interface, which only consider displaying
the message, cannot treat all of the MIME functionalities.
Then it is not sufficient to decode message along its MIME type, but
it is also required to consider a playback processing through some
dialogue with the user. The format of MIME messages is designed
to easily be passed to automatic processing. But some contents in the
MIME message should not be passed to automatic processing for security
reasons. So it should be designed to ask user in such cases.
After all, in order to deal with MIME message, it is required to
distinguish the representation for information exchange which is
written in STD 11 or MIME construction, and its result
after some interpretation which is a display screen or a playback
process. It is also needed to converse with user for playback
processing.@refill

Therefore, MIME-View uses two buffers for one document, one is the
mime-raw-buffer that stores the representation for information exchange,
and the other is the mime-preview-buffer that stores the representation
for displaying.@refill

MIME-View provides a mode in the mime-preview-buffer for reading MIME
message, which is called as mime-view-mode. User can manipulate each
entity there.


@node MIME-Preview, mime-view-mode, Overview of MIME-View, MIME-View
@section Presentation of mime-preview-buffer

mime-view-mode displays information about each entity as@refill

@example
	[entity-button]
	(header)
	
	(body)
	(separator)
@end example

@noindent
You can change their design or inhibit showing some of them, according
to some condition.

See following example


@example
From: morioka@@jaist.ac.jp (MORIOKA Tomohiko)
Subject: Re: question?
Newsgroups: zxr.message.mime
Date: 22 Oct 93 11:02:44
Mime-Version: 1.0
Organization: Japan Advanced Institute of Science and Technology,
        Ishikawa, Japan

[1  (text/plain)]
  How to compose MIME message in MIME-Edit mode.

  C-c C-x ? shows its help.

C-c C-x C-t	insert a text message.
C-c C-x TAB	insert a (binary) file.
C-c C-x C-e	insert a reference to external body.
C-c C-x C-v	insert a voice message.
C-c C-x C-y	insert a mail or news message.
C-c C-x RET	insert a mail message.
C-c C-x C-s	insert a signature file at end.
C-c C-x t	insert a new MIME tag.
C-c C-m C-a	enclose as multipart/alternative.
C-c C-m C-p	enclose as multipart/parallel.
C-c C-m C-m	enclose as multipart/mixed.
C-c C-m C-d	enclose as multipart/digest.
C-c C-m C-s	enclose as PGP signed.
C-c C-m C-e	enclose as PGP encrypted.
C-c C-x C-k	insert PGP public key.
C-c C-x p	preview editing MIME message.
...

therefore, you should type C-c C-x C-i and specify the binary file
which you want to insert.

  You should select Base64 as MIME encoding for binary file.

[2  (image/gif)]

[3  (text/plain)]

  Like above, you can compose the message with image.

==================== Take A Cup Of Russian Tea  ======================
=========  ** Not With Jam Nor Marmalade But With Honey **  ==========
=========                 MORIOKA TOMOHIKO                  ==========
==============  Internet E-mail: <morioka@@jaist.ac.jp>  ==============
@end example



@menu
* entity-button::               
* entity-header::               
* entity-body::                 
@end menu

@node entity-button, entity-header, MIME-Preview, MIME-Preview
@subsection entity-button
@cindex entity-number
@cindex entity-button

@strong{entity-button} is a tag on the top of the entity
which shows brief information of the part.@refill

Normally, it appears as

@example
        [1.3 test (text/plain)]
@end example

@noindent

The number on the head describes the place of the entity in the
message (like the section number) and it is called as
@strong{entity-number}.@refill

The string in the next describes its title. This information is
taken from

@enumerate
@item
Title described in Content-Description field or Subject field

@item
File name specified by filename parameter in Content-Disposition field

@item
File name specified by name parameter in Content-Type field

@item
File name for uuencode'ing
@end enumerate

@noindent
If none of them are specified, displays a blank.

The 3rd item in the parenthesis describes media-type/subtype of
the entity. If it is is not MIME entity, it displays @code{nil}.
@refill

This entity-button plays a role like icon that symbolically
shows the content of the entity. For example, push @kbd{v} on

@example
        [2  (image/gif)]
@end example

@noindent
shows up the image contained there.

If the mouse operation is possible, you can display the image
by pushing 2nd button (the middle button for 3 button mouse) too.


@node entity-header, entity-body, entity-button, MIME-Preview
@subsection entity-header
@cindex entity-header

@strong{entity-header} is the header of the entity.
(Don't blame me as ``You say nothing more than as it is'',
It is no more than that.)

@node entity-body,  , entity-header, MIME-Preview
@subsection entity-body
@cindex entity-body

@strong{entity-body} is the content of the part.@refill

Sophistication does not seem enough here also, but it is really such
a thing.@refill

Though, it actually be twisted a little.@refill

The text entity is passed to code conversion according to its charset,
and the image entity should be converted on XEmacs.@refill

Details will be described later.


@node mime-view-mode,  , MIME-Preview, MIME-View
@section Operation in mime-preview-buffer

mime-preview-buffer posesses following functionalities.@refill

@table @kbd
@item @key{u}
go back to upper part (in the first part of the message,
go back to the Summary mode (*1))

@item @key{p}
go to previous part

@item @key{M-TAB}
go to previous part

@item @key{n}
go to next part

@item @key{TAB}
go to next part

@item @key{SPC}
scroll up

@item @key{M-SPC}
scroll down

@item @key{DEL}
scroll down

@item @key{RET}
go to next line

@item @key{M-RET}
go to previous line

@item @key{v}
play current part (*2)

@item @key{e}
extract file from current part (*2)

@item @key{C-c C-p}
print current part (*2)

@item @key{mouse-button-2}
start the mouse button in preview-buffer

on content-button, play current part (*2)@refill

on URL-button, start WWW browser@refill

@end table

@noindent
@strong{[Notice]}
@quotation

(*1) Do not go back to Summary mode unless appropriately
configured for mime-view in the MUA.@refill

(*2) actual behavior depends on the associated method
@end quotation



@node MIME-Edit, Various, MIME-View, Top
@chapter MIME message editing
@cindex MIME-Edit

@strong{MIME-Edit} is a general MIME composer for GNU Emacs.


@menu
* mime-edit-mode::              Minor-mode to edit MIME message
* single-part tags::            Operations for single-part
* enclosure tags::              Operations for enclosure
* other MIME-Edit operations::  Other operations
* file-type specification::     How to detect tag for inserted file
* transfer level::              
* message/partial sending::     Splitting
@end menu

@node mime-edit-mode, single-part tags, MIME-Edit, MIME-Edit
@section Minor-mode to edit MIME message
@cindex enclosure
@cindex multi-part ending tag
@cindex multi-part beginning tag
@cindex tag
@cindex mime-edit-mode

@strong{mime-edit-mode} is a minor mode to compose MIME message.  In
this mode, @strong{tag} represents various kinds of data, so you can
edit multi part message consists of various kinds of data, such as text,
image, audio, etc.@refill

There are 2 kinds of tags:

@itemize @bullet
@item
 single-part tag

@item
 multi-part tag
@end itemize

single-part tag represents single part, this form is following:@refill

@example
        --[[TYPE/SUBTYPE;PARAMETERS][ENCODING]
        OPTIONAL-FIELDS]
@end example

TYPE/SUBTYPE and PARAMETERS indicates type/subtype and parameters of
Content-Type (@ref{Content-Type,,, mime-en, FLIM Manual}) field.
TYPE/SUBTYPE is required, PARAMETERS is optional.@refill

ENCODING indicates Content-Transfer-Encoding
(@ref{Content-Transfer-Encoding,,, mime-en, FLIM Manual}) field.  It
is optional too.@refill

OPTIONAL-FIELDS is to represent another fields except Content-Type field
and Content-Transfer-Encoding field.@refill

multi-part tags represent multi part.  They
consist of a pair of @strong{multi-part beginning tag} and
@strong{multi-part ending tag}.@refill

multi-part beginning tag's form is following:

@example
        --<<TYPE>>-@{
@end example

multi-part ending tag's form is following:

@example
        --@}-<<TYPE>>
@end example

A region from multi-part beginning tag to multi-part ending tag is
called as @strong{enclosure}.


@node single-part tags, enclosure tags, mime-edit-mode, MIME-Edit
@section Operations for single-part

Operations to make single-part are following:

@table @kbd
@item @key{C-c C-x C-t}
Insert single-part tag indicates text part.

@item @key{C-c C-x C-i}
Insert file as a MIME attachment.  If @kbd{C-u} is followed by it, it
asks media-type, subtype or encoding even if their default values are
specified. (cf. @ref{file-type specification})

@item @key{C-c C-x C-e}
Insert external part.

@item @key{C-c C-x C-v}
Record audio input until @kbd{C-g} is pressed, and insert as a
audio part. (It requires /dev/audio in default.)

@item @key{C-c C-x C-y}
Insert current (mail or news) message. (It is MUA depended.)

@item @key{C-c C-x C-m}
Insert mail message. (It is MUA depended.)

@item @key{C-c C-x C-w}, @key{C-c C-x C-s}
Insert signature.

@item @key{C-c C-x C-k}
Insert PGP (@ref{PGP}) public key. (It requires Mailcrypt package.)

@item @key{C-c C-x t}
Insert any single-part tag.

@end table



@node enclosure tags, other MIME-Edit operations, single-part tags, MIME-Edit
@section Operations for enclosure

Operations to make enclosure are following:

@table @kbd
@item @key{C-c C-m C-a}
Enclose specified region as multipart/alternative.

@item @key{C-c C-m C-p}
Enclose specified region as multipart/parallel.

@item @key{C-c C-m C-m}
Enclose specified region as multipart/mixed.

@item @key{C-c C-m C-d}
Enclose specified region as multipart/digest.

@item @key{C-c C-m C-s}
Digital-sign to specified region. (cf. @ref{PGP})

@item @key{C-c C-m C-e}
Encrypt to specified region. (cf. @ref{PGP})

@item @key{C-c C-m C-q}
avoid to encode tags in specified region.  In other words, tags is
interpreted as such string.  (In current version, it may be
incomplete.  Maybe PGP-signature does not work for this enclosure.)

@end table



@node other MIME-Edit operations, file-type specification, enclosure tags, MIME-Edit
@section Other operations

There are another operations in mime-edit-mode.

@table @kbd
@item @key{C-c C-c}
Send current editing message.

@item @key{C-c C-x p}
Preview current editing message. (cf. @ref{MIME-View})

@item @key{C-c C-x C-z}
Exit mime-edit-mode without sending.

@item @key{C-c C-x /}
Set current editing message to enable automatic splitting or not.
Form of automatic split messages is message/partial.

@item @key{C-c C-x 7}
Set 7bit (@ref{7bit,,, mime-en, FLIM Manual}) to transfer level
(@ref{transfer level}).

@item @key{C-c C-x 8}
Set 8bit (@ref{8bit,,, mime-en, FLIM Manual}) to transfer level
(@ref{transfer level}).

@item @key{C-c C-x v}
Set current editing message to digital-sign or not. (cf. @ref{PGP})

@item @key{C-c C-x h}
Set current editing message to encrypt or not. (cf. @ref{PGP})

@item @key{C-c C-x ?}
Display help message.

@end table



@node file-type specification, transfer level, other MIME-Edit operations, MIME-Edit
@section How to detect tag for inserted file

When @kbd{C-c C-x C-i} (@code{mime-edit-insert-file}) is pressed, tag
parameters for inserted file, such as media-type or encoding, are
detected by variable @code{mime-file-types}.@refill

When @kbd{C-u} is followed by it or parameter is not found from the
variable, it asks from user.  (When @kbd{C-u} is followed by it,
detected value is used as default value)@refill

If you want to change default value for file names, please change
variable @code{mime-file-types}.

@defvar mime-file-types

Specification of default value of tag for file name of inserted
file.@refill

It is a list of following list:

@lisp
	(FILE_PAT TYPE SUBTYPE PARAMS ENCODING
	 DISPOSITION_TYPE DISPOSITION_PARAMS)
@end lisp


Each element of the list is following:

@table @samp
@item FILE_PAT
regular expression of file name

@item TYPE
primary-type of media-type

@item SUBTYPE
subtype of media-type

@item PARAMS
parameters of Content-Type field

@item ENCODING
Content-Transfer-Encoding

@item DISPOSITION_TYPE
disposition-type

@item DISPOSITION_PARAMS
parameters of Content-Disposition field

@end table

@noindent
Example: Specify application/rtf as default media type for
@file{*.rtf}

@lisp
(eval-after-load
    "mime-edit"
  '(set-alist 'mime-file-types
	      "\\.rtf$"
	      '("application" "rtf" nil nil
		"attachment" (("filename" . file)))
	      ))
@end lisp
@end defvar



@node transfer level, message/partial sending, file-type specification, MIME-Edit
@section transfer level
@cindex transfer level

Each content inserted in a message is represented by 7bit
(@ref{7bit,,, mime-en, FLIM Manual}), 8bit (@ref{8bit,,, mime-en, FLIM
Manual}) or binary (@ref{binary,,, mime-en, FLIM Manual}).@refill

If a message is translated by 7bit-through MTA (@ref{MTA,,, mime-en,
FLIM Manual}), there is no need to encode 7bit data, but 8bit and
binary data must be encoded to 7bit data.@refill

Similarly, if a message is translated by 8bit-through MTA, there is no
need to encode 7bit or 8bit data, but binary data must be encoded to
7bit or 8bit data.@refill

@noindent
@strong{[Memo]}
@quotation
EBCDIC MTA breaks 7bit data, so in this case, 7bit data must be
encoded by base64.  But I don't know EBCDIC. (^_^;

Similarly, I wish ASCII-printable only MTA and code-conversion MTA
disappeared. (^_^;@refill

Maybe there are binary-through MTA, but I think it is not major.
@end quotation

@strong{transfer level} represents how range data are
available.  mime-edit has a variable @code{mime-transfer-level}
to represent transfer level.


@defvar mime-transfer-level

transfer level.@refill

If transfer level of a data is over it, a data is encoded to
7bit.@refill

Currently, 7 or 8 is available.  Default value is 7.@refill

In extension plan, EBCDIC will be 5, ASCII printable only will be 6,
binary will be 9.  But it will not be implemented.
@end defvar



@noindent
@strong{[Memo]}
@quotation
transfer level is only for body, not for message header
(@ref{entity-header}).  MIME extends RFC 822 (@ref{RFC 822,,, mime-en,
FLIM Manual}) to use 8bit data in body, but it requires to use
us-ascii (@ref{us-ascii,,, mime-en, FLIM Manual}) in header.
@end quotation



@node message/partial sending,  , transfer level, MIME-Edit
@section Splitting

@defvar mime-edit-split-message

Split large message if it is non-nil.
@end defvar


@defvar mime-edit-message-default-max-lines

Default maximum lines of a message.
@end defvar


@defvar mime-edit-message-max-lines-alist

Alist of major-mode vs maximum lines of a message.@refill

If it is not specified for a major-mode,
@code{mime-edit-message-default-max-lines} is used.
@end defvar


@defvar mime-edit-split-blind-field-regexp

Regular expression to match field-name to be ignored when split sending.
@end defvar



@node Various, Concept Index, MIME-Edit, Top
@chapter Miscellaneous


@menu
* PGP::                         Encryption, Sign
* Buttons::                     Mouse button
* Acting-condition configuration::  Utility for configuration
@end menu

@node PGP, Buttons, Various, Various
@section PGP
@cindex PGP/MIME

mime-edit provides PGP encryption, signature and inserting public-key
features based on @strong{PGP/MIME} (RFC 3156) by using EasyPG.@refill

@defvar mime-edit-pgp-verbose
When non-nil, ask the user about the current operation more verbosely.
@end defvar

@defvar mime-edit-pgp-signers
A list of your own key ID which will be preferredly used to sign a message.
@end defvar

@defvar mime-edit-pgp-encrypt-to-self
When non-nil, add sender's key ID to recipient list when encryption.
When nil, sender can't decrypt encrypted content in general.
@end defvar

@defvar mime-edit-pgp-filtered-validities
A list of keys's validities which are used for neither signing nor encrypting.
@end defvar


@node Buttons, Acting-condition configuration, PGP, Various
@section Mouse button

@defvar mime-button-face

Face used for content-button or URL-button of MIME-Preview buffer.
@end defvar


@defvar mime-button-mouse-face

Face used for MIME-preview buffer mouse highlighting.
@end defvar


@defvar mime-browse-url-function

Function to browse URL.
@end defvar



@node Acting-condition configuration,  , Buttons, Various
@section Utility for configuration

@defun mime-add-condition target-type condition  &optional  mode file

Add @var{condition} to database specified by @var{target-type}.@refill

@var{target-type} must be @code{preview} or @code{action}.@refill

If optional argument @var{mode} is @code{strict} or @code{nil}
(omitted), @var{condition} is added strictly.@refill

If optional argument @var{mode} is @code{with-default}, @var{condition}
is added with default rule.@refill

If optional argument @var{file} is specified, it is loaded when
@var{condition} is activate.
@end defun



@node Concept Index, Function Index, Various, Top
@chapter Concept Index

@printindex cp

@node Function Index, Variable Index, Concept Index, Top
@chapter Function Index

@printindex fn

@node Variable Index,  , Function Index, Top
@chapter Variable Index

@printindex vr
@bye
07070100000019000081A4000003E80000006400000001627140E500005FBE000000000000000000000000000000000000002E00000000semi-1.14.6+239+gb1c245b81715/mime-ui-ja.texi\input texinfo-ja @c -*-texinfo -*- coding: utf-8 -*-
@setfilename mime-ui-ja.info
@documentencoding utf-8
@documentlanguage ja

@dircategory GNU Emacs Lisp
@direntry
* SEMI-EPG (ja): (mime-ui-ja).      MIME user interface.
@end direntry

@settitle SEMI-EPG 1.14 説明曞
@titlepage
@title SEMI-EPG 1.14 説明曞
@author 守岡 知圊 <morioka@@jaist.ac.jp>
@author 䌊藀 和博
@subtitle 2020/09/17
@end titlepage
@node Top, Introduction, (dir), (dir)
@top SEMI-EPG 1.14 説明曞

@ifinfo

This file documents SEMI-EPG, a MIME user interface for GNU
Emacs.@refill

GNU Emacs 甚の MIME user interface である SEMI-EPG に぀いお説明したす。
@end ifinfo

@menu
* Introduction::                SEMI-EPG っお䜕
* MIME-View::                   MIME message の閲芧
* MIME-Edit::                   MIME message の線集
* Various::                     その他
* Concept Index::               抂念玢匕
* Function Index::              関数玢匕
* Variable Index::              倉数玢匕
@end menu

@node Introduction, MIME-View, Top, Top
@chapter SEMI-EPG っお䜕

SEMI は GNU Emacs 甚の MIME user interface を提䟛する package です。
SEMI-EPG は SEMI のバリアントの䞀぀で、
EasyPG や最新バヌゞョンの Emacs ぞの察応などを特城ずしたす。
@refill

SEMI が提䟛する MIME user interface は MIME-View ず MIME-Edit からなりた
す。@refill

 
MIME-View は MIME や STD 11 および『地域化された RFC 822』message を衚瀺
したり、操䜜したりするための user interface の䞭栞です。@refill

MIME-Edit は MIME message を生成するための user interface です。@refill

各 MUA でこれらの機胜を利甚するこずにより、高床な MIME 機胜を利甚するこ
ずができたす。


@node MIME-View, MIME-Edit, Introduction, Top
@chapter MIME message の閲芧

MIME-View は GNU Emacs で動䜜する汎甚的な MIME viewer です。@refill

MIME-View は MIME message を閲芧するための利甚者界面 (user interface) 
の栞であり、この䞊で presentation-method ず呌ばれる衚瀺を䜜るプログラム
を動かしたり、acting-method ず呌ばれる entity の凊理プログラムを動かす
こずが可胜で、さたざたな皮類の entity を扱う事ができるようになっおいたす。


@menu
* Overview of MIME-View::       MIME-View 抂説
* MIME-Preview::                mime-preview-buffer の画面構成
* mime-view-mode::              mime-preview-buffer での操䜜
@end menu

@node Overview of MIME-View, MIME-Preview, MIME-View, MIME-View
@section MIME-View 抂説

Internet の電子曞簡・ネットニュヌスなどの曞面 (message) の衚珟圢匏は STD
11 に基づいおいたす。STD 11 の曞面本䜓 (message body) は行を唯䞀の構造ず
する簡易文面 (plain text) であり、文字笊号も us-ascii ず定められおいたす。
実際には、文字笊号を us-ascii の代わりにその蚀語圏で甚いられる文字笊号ず
した『地域化された STD 11』曞面も甚いられおきたしたが、この堎合も曞面の
文字笊号は぀です。このため、利甚者界面 (Message User Agent) は、しばし
ば、byte 列 = us-ascii 文字列、ないしは、byte 列 = その蚀語圏で甚いる文
字笊号の文字列のように芋倣しおきたした。@refill

しかしながら、MIME では曞面は entity を単䜍ずする朚構造になり、たた、
぀の曞面で耇数の文字笊号を甚いるこずができたす。たた、entity の内容は文
面や絵のような単玔に衚瀺可胜なものだけでなく、音声や動画などの䞀定時間再
生されるようなものや特定のアプリケヌションのデヌタやプログラムの゜ヌス、
あるいは、ftp や mail service の利甚法や URL ずいった圢で衚された倖郚参
照などのさたざたなものが考えらたす。このため、衚瀺だけを考えおいた STD
11 における利甚者界面の単玔な延長では MIME の党おの機胜を扱うこずはでき
たせん。぀たり、MIME の圢匏に合わせお埩号するだけでは䞍十分であり、利甚
者ずの察話的な再生凊理を考慮する必芁がありたす。MIME 曞面の圢匏は自動凊
理がしやすく蚭蚈されおいたすが、MIME 曞面に含たれる内容の䞭にはセキュリ
ティヌ䞊の問題から自動凊理をするべきでないものがあり、こういったものの再
生に関しおは利甚者の刀断を仰ぐように蚭蚈されるべきでしょう。結局、MIME 
曞面を扱うためには STD 11 および MIME の構文で蚘述されたメッセヌゞの情報
亀換甚衚珟ずその解釈結果である衚瀺画面や再生等の凊理を区別しお考える必芁
がありたす。たた、利甚者ずの察話的な再生凊理が必芁です。@refill

このため、MIME-View は぀の曞面に察しお、情報亀換甚衚珟を栌玍する 
mime-raw-buffer ず衚瀺甚衚珟を栌玍する mime-preview-buffer の぀の 
buffer を甚いたす。@refill

MIME-View は mime-preview-buffer に察しお mime-view-mode ずいう MIME
message を閲芧するための mode を提䟛したす。利甚者はここで各 entity に
察しお操䜜を行うこずができたす。


@node MIME-Preview, mime-view-mode, Overview of MIME-View, MIME-View
@section mime-preview-buffer の画面構成

mime-view-mode では各 entity に察しお@refill

@example
	[entity-button]
	(header)
	
	(body)
	(separator)
@end example

@noindent
ずいう情報を衚瀺したす。これらは条件に埓っお design を倉曎したり、衚瀺
を抑制するこずもできたす。

以䞋に、衚瀺䟋を瀺したす。


@example
From: morioka@@jaist.ac.jp (守岡 知圊 / MORIOKA Tomohiko)
Subject: Re: 質問
Newsgroups: zxr.message.mime
Date: 22 Oct 93 11:02:44
Mime-Version: 1.0
Organization: Japan Advanced Institute of Science and Technology,
        Ishikawa, Japan

[1  (text/plain)]
  MIME-Edit mode における、MIME message の䜜り方。

  C-c C-x ? を抌すず help が出おくる。

C-c C-x C-t	insert a text message.
C-c C-x TAB	insert a (binary) file.
C-c C-x C-e	insert a reference to external body.
C-c C-x C-v	insert a voice message.
C-c C-x C-y	insert a mail or news message.
C-c C-x RET	insert a mail message.
C-c C-x C-s	insert a signature file at end.
C-c C-x t	insert a new MIME tag.
C-c C-m C-a	enclose as multipart/alternative.
C-c C-m C-p	enclose as multipart/parallel.
C-c C-m C-m	enclose as multipart/mixed.
C-c C-m C-d	enclose as multipart/digest.
C-c C-m C-s	enclose as PGP signed.
C-c C-m C-e	enclose as PGP encrypted.
C-c C-x C-k	insert PGP public key.
C-c C-x p	preview editing MIME message.
...

っお蚳で、C-c C-x C-i を抌しお、挿入したい binary file を指定したす。

  binary file の MIME encoding には、普通、Base64 を指定したす。

[2  (image/gif)]

[3  (text/plain)]

  こんな颚に、絵入り message のでき䞊がり。

〓〓〓〓〓〓〓〓〓〓〓 ロシアン・ティヌを䞀杯。 〓〓〓〓〓〓〓〓〓〓〓
〓〓〓〓〓  ☆ ゞャムではなくマヌマレヌドでもなく蜂蜜で ☆  〓〓〓〓〓
〓〓〓〓〓         МОРいОКА  ТОМОХИКО         〓〓〓〓〓
〓〓〓〓〓〓〓  Internet E-mail: <morioka@@jaist.ac.jp>  〓〓〓〓〓〓〓
@end example



@menu
* entity-button::               
* entity-header::               
* entity-body::                 
@end menu

@node entity-button, entity-header, MIME-Preview, MIME-Preview
@subsection entity-button
@cindex entity-number
@cindex entity-button

@strong{entity-button} は entity の先頭にあっお、その entity に関する倧
たかな情報を衚瀺する郚分です。@refill

暙準では

@example
        [1.3 test (text/plain)]
@end example

@noindent
のような感じに衚瀺されたす。

最初の数字は message 䞭のこの entity の䜍眮を節番号のように衚したもので、
@strong{entity-number} ず呌びたす。@refill

番目の文字列は衚題を衚したす。この情報は、

@enumerate
@item
Content-Description field もしくは Subject field に曞かれた衚題

@item
Content-Disposition field の filename parameter に曞かれた file 名

@item
Content-Type field の name parameter に曞かれた file 名

@item
 uuencode の堎合の file 名
@end enumerate

@noindent
から䜜りたす。どれも存圚しない堎合は空癜が衚瀺されたす。

番目の括匧の䞭の情報はその entity の media-type/subtype を衚したす。非 
MIME entity の堎合、@code{nil} が衚瀺されたす。@refill

この entity-button は entity の内容を象城する icon のような圹割を果た
したす。䟋えば、

@example
        [2  (image/gif)]
@end example

@noindent
の䞊で @kbd{v} を抌せばここに入っおいる絵が衚瀺されたす。

たた、mouse 操䜜が可胜な堎合、entity-button を第ボタン3 button
mouse の堎合、䞭倮のボタンで抌せば、同様にその絵が衚瀺されたす。


@node entity-header, entity-body, entity-button, MIME-Preview
@subsection entity-header
@cindex entity-header

@strong{entity-header} はある entity の header を衚瀺する郚
分です「そのたたやんけ」っお怒らないで。そういうもんなんです。


@node entity-body,  , entity-header, MIME-Preview
@subsection entity-body
@cindex entity-body

@strong{entity-body} は part の内容を衚瀺する郚分です。@refill

これもひねりが足りないですが、たあ、そういうもんです。@refill

ずはいえ、実際には少しひねっおたす。@refill

text entity の堎合は charset に応じお code 倉換したりしたすし、XEmacs で
は image entity を倉換しないずいけないし。@refill

詳しくはたた埌で。


@node mime-view-mode,  , MIME-Preview, MIME-View
@section mime-preview-buffer での操䜜

mime-preview-buffer には以䞋の機胜がありたす。@refill

@table @kbd
@item @key{u}
䞊の part に戻るmessage の䞀番䞊の part でこれを行なうず Summary
mode に戻る (*1)

@item @key{p}
前の part に移動する

@item @key{M-TAB}
前の part に移動する

@item @key{n}
次の part に移動する

@item @key{TAB}
次の part に移動する

@item @key{SPC}
scroll up する

@item @key{M-SPC}
scroll down する

@item @key{DEL}
scroll down する

@item @key{RET}
次の行に移動する

@item @key{M-RET}
前の行に移動する

@item @key{v}
part を再生する (*2)

@item @key{e}
part から file を取り出す (*2)

@item @key{C-c C-p}
part を印刷する (*2)

@item @key{mouse-button-2}
preview-buffer 䞭の mouse button を起動する

content-button を抌せば、その part が再生される(*2)@refill

URL-button を抌せば、その WWW browser が起動される@refill

@end table

@noindent
@strong{[泚意]}
@quotation

(*1) MUA で mime-view の蚭定をしおいない堎合、Summary mode には戻りたせ
ん。@refill

(*2) 実際の動䜜は察応する method に䟝りたす。
@end quotation



@node MIME-Edit, Various, MIME-View, Top
@chapter MIME message の線集
@cindex MIME-Edit

@strong{MIME-Edit} は GNU Emacs で動䜜する汎甚的な MIME
composer です。


@menu
* mime-edit-mode::              MIME message を線集するための minor-mode
* single-part tags::            single-part に察する操䜜
* enclosure tags::              enclosure に察する操䜜
* other MIME-Edit operations::  mime-edit-mode におけるその他の操䜜
* file-type specification::     挿入される file に察する tag の決定
* transfer level::              
* message/partial sending::     Splitting
@end menu

@node mime-edit-mode, single-part tags, MIME-Edit, MIME-Edit
@section MIME message を線集するための minor-mode
@cindex enclosure
@cindex multi-part 終了 tag
@cindex multi-part 開始 tag
@cindex tag
@cindex mime-edit-mode

@strong{mime-edit-mode} は MIME message を䜜成するための minor-mode です。
この mode では @strong{tag} を䜿っおさたざたな皮類の data を衚珟し、さた
ざたな皮類の data からなる耇数の郚分からなる message を線集するこずを可
胜にしおいたす。@refill

tag には

@itemize @bullet
@item
 single-part tag

@item
 multi-part tag
@end itemize

@noindent
の぀がありたす。

single-part tag は single part を衚珟するための tag で、@refill

@example
        --[[TYPE/SUBTYPE;PARAMETERS][ENCODING]
        OPTIONAL-FIELDS]
@end example

@noindent
ずいうような圢をしおいたす。

TYPE/SUBTYPE および PARAMETERS は Content-Type (@ref{Content-Type,,,
mime-ja, FLIM 説明曞}) 欄の type/subtype および parameters を衚したす。
TYPE/SUBTYPE は必須であり、PARAMETERS は省略可です。@refill

ENCODING は Content-Transfer-Encoding
(@ref{Content-Transfer-Encoding,,, mime-ja, FLIM 説明曞}) 欄を衚した
す。これも省略可です。@refill

OPTIONAL-FIELDS は Content-Type, Content-Transfer-Encoding 以倖の field 
を曞くための郚分で、省略可です。@refill

multi-part tag は multi part を衚珟するための 
tag で、@refill

@example
        --<<TYPE>>-@@@{
@end example

@noindent
ずいう圢の @strong{multi-part 開始 tag} ず呌ばれる multi
part の開始を瀺す tag ず

@example
        --@@@}-<<TYPE>>
@end example

@noindent
ずいう圢の @strong{multi-part 終了 tag} ず呌ばれる multi
part の終了を瀺す tag がありたす。

たた、multi-part 開始 tag ず multi-part 終了 tag で囲たれた郚分を 
@strong{enclosure} ず呌びたす。


@node single-part tags, enclosure tags, mime-edit-mode, MIME-Edit
@section single-part に察する操䜜

single-part を䜜るための操䜜には以䞋のようなものがありたす。

@table @kbd
@item @key{C-c C-x C-t}
text part を衚す single-part tag を挿入したす。

@item @key{C-c C-x C-i}
file を MIME part ずしお添付したす。前に @kbd{C-u} を付けた堎合、垞に 
media-type, subtype 等を聞いお来たす。(cf. @ref{file-type specification})

@item @key{C-c C-x C-e}
external part を挿入したす。

@item @key{C-c C-x C-v}
@kbd{C-g} が抌されるたで録音を行い、音声 part を挿入したす。䜿
甚できない堎合がありたす

@item @key{C-c C-x C-y}
珟圚衚瀺䞭の (mail or news) message を挿入したす。実際の動䜜は䜿甚し
おいる MUA に䟝存したす

@item @key{C-c C-x C-m}
mail message を挿入したす。

@item @key{C-c C-x C-w}, @key{C-c C-x C-s}
signature を挿入したす。

@item @key{C-c C-x C-k}
PGP (@ref{PGP}) の公開鍵を挿入したす。

@item @key{C-c C-x t}
任意の single-part tag を挿入したす。

@end table



@node enclosure tags, other MIME-Edit operations, single-part tags, MIME-Edit
@section enclosure に察する操䜜

enclosure を䜜るための操䜜ずしおは以䞋のようなものがありたす。

@table @kbd
@item @key{C-c C-m C-a}
指定した region を multipart/alternative ずしお囲みたす。

@item @key{C-c C-m C-p}
指定した region を multipart/parallel ずしお囲みたす。

@item @key{C-c C-m C-m}
指定した region を multipart/mixed ずしお囲みたす。

@item @key{C-c C-m C-d}
指定した region を multipart/digest ずしお囲みたす。

@item @key{C-c C-m C-s}
指定した region に電子眲名を行いたす。(cf. @ref{PGP})

@item @key{C-c C-m C-e}
指定した region を暗号化したす。(cf. @ref{PGP})

@item @key{C-c C-m C-q}
指定した region 内の tag を無効にし、その tag を文字列ずしお利甚できる
ようにしたす。珟圚の版ではうたく働かないこずがありたす。たた、電子眲
名ずの䜵甚に関しおも䞍完党です

@end table



@node other MIME-Edit operations, file-type specification, enclosure tags, MIME-Edit
@section mime-edit-mode におけるその他の操䜜

mime-edit-mode におけるその他の操䜜を説明したす。

@table @kbd
@item @key{C-c C-c}
線集䞭の message を送信したす。

@item @key{C-c C-x p}
線集䞭の message を preview したす。(cf. @ref{MIME-View})

@item @key{C-c C-x C-z}
線集䞭の message を送信するこずなく、mime-edit-mode を終了したす。

@item @key{C-c C-x /}
倧きな message を送信する堎合に message/partial 圢匏に自動分割可胜ずす
るかどうかを決めたす。

@item @key{C-c C-x 7}
transfer level (@ref{transfer level}) を 7bit (@ref{7bit,,, mime-ja,
FLIM 説明曞}) にしたす。

@item @key{C-c C-x 8}
transfer level (@ref{transfer level}) を 8bit (@ref{8bit,,, mime-ja,
FLIM 説明曞}) にしたす。

@item @key{C-c C-x v}
message 党䜓を電子眲名するかどうかを決めたす。(cf. @ref{PGP})

@item @key{C-c C-x h}
message 党䜓を暗号化するかどうかを決めたす。(cf. @ref{PGP})

@item @key{C-c C-x ?}
help message を衚瀺したす。

@end table



@node file-type specification, transfer level, other MIME-Edit operations, MIME-Edit
@section 挿入される file に察する tag の決定

@kbd{C-c C-x C-i} (@code{mime-edit-insert-file}) を実行した時、挿入され
る file に察する media-type や encoding などの tag の情報は倉数 
@code{mime-file-types} によっお file 名から掚枬されたす。@refill

前に @kbd{C-u} を付けた時、および、適圓な倀が芋付からなかった堎合、user 
に察しお倀の入力を促したす。前に @kbd{C-u} を付けた時、掚枬された倀が
既定倀ずしお甚いられたす@refill

file 名に察する既定倀を倉えたい堎合は倉数 @code{mime-file-types}
を蚭定しお䞋さい。

@defvar mime-file-types

挿入される file の file 名に察する tag の既定倀を䞎える。@refill

この倉数は

@lisp
	(FILE_PAT TYPE SUBTYPE PARAMS ENCODING
	 DISPOSITION_TYPE DISPOSITION_PARAMS)
@end lisp


ずいう list の list で、各芁玠は以䞋の通りである

@table @samp
@item FILE_PAT
file 名を衚す正芏衚珟

@item TYPE
media type

@item SUBTYPE
media subtype

@item PARAMS
Content-Type field の parameter

@item ENCODING
Content-Transfer-Encoding

@item DISPOSITION_TYPE
disposition-type

@item DISPOSITION_PARAMS
Content-Disposition field の parameter

@end table

@noindent
蚭定䟋 @file{*.rtf} に察する media type を application/rtf に
する堎合

@lisp
(eval-after-load
    "mime-edit"
  '(set-alist 'mime-file-types
	      "\\.rtf$"
	      '("application" "rtf" nil nil
		"attachment" (("filename" . file)))
	      ))
@end lisp
@end defvar



@node transfer level, message/partial sending, file-type specification, MIME-Edit
@section transfer level
@cindex transfer level

message に挿入する data は 7bit (@ref{7bit,,, mime-ja, FLIM 説明曞})
ないし 8bit (@ref{8bit,,, mime-ja, FLIM 説明曞}) もしくは binary
(@ref{binary,,, mime-ja, FLIM 説明曞}) で衚珟するこずができたす。
@refill

よっお、7bit しか通さない MTA (@ref{MTA,,, mime-ja, FLIM 説明曞}) を経
由する堎合、7bit の data はそのたたで送れたすが、8bit や binary の
data は 7bit に倉換しなければなりたせん。@refill

同様に、8bit しか通さない MTA を経由する堎合、7bit や 8bit の data はそ
のたたで送れたすが、binary の data は 7bit か 8bit に倉換しなければなり
たせん。@refill

@noindent
@strong{[Memo]}
@quotation
EBCDIC しか通さない MTA を経由する堎合、7bit の data も base64 等で倉
換しないず送れたせんが、私は EBCDIC のこずたでは知りたせん。(^_^;

同様に、制埡文字を通さない MTA のこずや code 倉換を行なう MTA も消えおな
くなっお欲しいです。(^_^;@refill

binary も通す MTA も存圚するんでしょうが、今のずころあたり䞀般的ずはいえ
ないでしょう。
@end quotation

@strong{transfer level} ずいうのはどの範囲の data たで送れるか
ずいうこずを衚すものです。mime-edit は 
@code{mime-transfer-level} ずいう倉数を持っおおり、これで 
transfer level を衚珟したす。


@defvar mime-transfer-level

transfer level を衚す。@refill

ある data の transfer level がこの倀を越える堎合、7bit data ぞの倉換が行
われる。@refill

珟圚のずころ、7 か 8 が有効である。既定倀は 7 である。@refill

EBCDIC を 5, ASCII printable のみを 6, binary を 9 ずするこずを蚈画しお
いるが、実装の予定はない。
@end defvar



@noindent
@strong{[Memo]}
@quotation
transfer level は message header (@ref{entity-header}) には関係しない。
MIME は body においお、8bit の data を䜿えるように STD 11 (@ref{STD
11,,, mime-ja, FLIM 説明曞}) を拡匵しおいるが、message header では
us-ascii (@ref{us-ascii,,, mime-ja, FLIM 説明曞}) のみを甚いるこずを求
めおいる。
@end quotation



@node message/partial sending,  , transfer level, MIME-Edit
@section Splitting

@defvar mime-edit-split-message

Non-nil ならば倧きなメッセヌゞを分割しお送信したす。
@end defvar


@defvar mime-edit-message-default-max-lines

メッセヌゞの最倧行数のデフォルト倀です。
@end defvar


@defvar mime-edit-message-max-lines-alist

メゞャヌモヌド察メッセヌゞの最倧行数から成る連想リストです。@refill

メゞャヌモヌドがここで指定されおない堎合には
@code{mime-edit-message-default-max-lines} を甚いたす。
@end defvar


@defvar mime-edit-split-blind-field-regexp

分割送信の際に無芖されるフィヌルド名にマッチする正芏衚珟です。
@end defvar



@node Various, Concept Index, MIME-Edit, Top
@chapter その他


@menu
* PGP::                         暗号化、眲名
* Buttons::                     抌释
* Acting-condition configuration::  実行条件の蚭定
@end menu

@node PGP, Buttons, Various, Various
@section PGP
@cindex PGP/MIME

mime-edit では EasyPG を利甚した @strong{PGP/MIME} (RFC 3156) による暗
号化・電子眲名・公開鍵の挿入機胜を利甚するこずができたす。@refill

@defvar mime-edit-pgp-verbose
When non-nil, ask the user about the current operation more verbosely.
@end defvar

@defvar mime-edit-pgp-signers
眲名時に優先的に䜿甚する鍵 ID のリストです。
@end defvar

@defvar mime-edit-pgp-encrypt-to-self
non-nilの堎合、暗号化の際に送信者の鍵 ID を recipient に含めたす。
nilの堎合、送信者は暗号化した内容を通垞は埩号できたせん。
@end defvar

@defvar mime-edit-pgp-filtered-validities
A list of keys's validities which are used for neither signing nor encrypting.
@end defvar


@node Buttons, Acting-condition configuration, PGP, Various
@section 抌释

@defvar mime-button-face

MIME-Preview バッファで  content-button もしくは URL-button  に甚いる
face です。
@end defvar


@defvar mime-button-mouse-face

MIME-preview バッファでマりスをハむラむトする際に甚いる face です。
@end defvar


@defvar mime-browse-url-function

URL をブラりズする関数です。
@end defvar



@node Acting-condition configuration,  , Buttons, Various
@section 実行条件の蚭定

@defun mime-add-condition target-type condition  &optional  mode file

Add @var{condition} to database specified by @var{target-type}.@refill

@var{target-type} must be @code{preview} or @code{action}.@refill

If optional argument @var{mode} is @code{strict} or @code{nil}
(omitted), @var{condition} is added strictly.@refill

If optional argument @var{mode} is @code{with-default}, @var{condition}
is added with default rule.@refill

If optional argument @var{file} is specified, it is loaded when
@var{condition} is activate.
@end defun



@node Concept Index, Function Index, Various, Top
@chapter 抂念玢匕

@printindex cp

@node Function Index, Variable Index, Concept Index, Top
@chapter 関数玢匕

@printindex fn

@node Variable Index,  , Function Index, Top
@chapter 倉数玢匕

@printindex vr
@bye
0707010000001A000081A4000003E80000006400000001627140E500000672000000000000000000000000000000000000002C00000000semi-1.14.6+239+gb1c245b81715/mime-vcard.el;;; mime-vcard.el --- mime-view content filter for vCard.  -*- lexical-binding: t -*-

;; Copyright (C) 2000 Free Software Foundation, Inc.

;; Author: Daiki Ueno <ueno@unixuser.org>
;; Keywords: vCard, MIME, multimedia, mail, news

;; This file is part of SEMI (Sample of Elastic MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.


;;; Commentary:
;; 

;;; Code:

;; bbdb-vcard-vcard21.el is available in MELPA's bbdb-vcard package.
(require 'bbdb-vcard-vcard21)

(defvar mime-display-text/vcard-hook nil)

(defun mime-display-text/vcard (entity _situation)
  (save-restriction
    (narrow-to-region (point-max)(point-max))
    (insert
     (string-as-multibyte
      (vcard-pretty-print
       (vcard-parse-string
	(mime-entity-content entity)
	#'vcard-standard-filter))))
    (if (/= (preceding-char) ?\n)
        (insert "\n"))
    (mime-add-url-buttons)
    (run-hooks 'mime-display-text/vcard-hook)))

(provide 'mime-vcard)

;;; mime-vcard.el ends here
0707010000001B000081A4000003E80000006400000001627140E500011A29000000000000000000000000000000000000002B00000000semi-1.14.6+239+gb1c245b81715/mime-view.el;;; mime-view.el --- interactive MIME viewer for GNU Emacs  -*- lexical-binding: t -*-

;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Created: 1994/07/13
;;	Renamed: 1994/08/31 from tm-body.el
;;	Renamed: 1997/02/19 from tm-view.el
;; Keywords: MIME, multimedia, mail, news

;; This file is part of SEMI (Sample of Elastic MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'mime)
(require 'semi-def)
(require 'calist)
(require 'alist)
(require 'mime-conf)
(require 'path-util)

(eval-when-compile (require 'static))


;;; @ version
;;;

(defconst mime-view-version
  (concat (mime-product-name mime-user-interface-product) " MIME-View "
	  (mapconcat #'number-to-string
		     (mime-product-version mime-user-interface-product) ".")
	  " (" (mime-product-code-name mime-user-interface-product) ")"))


;;; @ variables
;;;

(defgroup mime-view nil
  "MIME view mode"
  :group 'mime)

(defcustom mime-situation-examples-file "~/.mime-example"
  "*File name of situation-examples demonstrated by user."
  :group 'mime-view
  :type 'file)

(defcustom mime-preview-move-scroll nil
  "*Decides whether to scroll when moving to next entity.
When t, scroll the buffer. Non-nil but not t means scroll when
the next entity is within next-screen-context-lines from top or
buttom. Nil means don't scroll at all."
  :group 'mime-view
  :type '(choice (const :tag "Off" nil)
		 (const :tag "On" t)
		 (sexp :tag "Situation" 1)))

(defcustom mime-view-mailcap-files
  '("~/.mailcap" "/usr/etc/mailcap" "/etc/mailcap")
  "List of mailcap files."
  :group 'mime-view
  :type '(repeat file))

(defcustom mime-view-buttons-visible t
  "Toggle visibility of MIME buttons."
  :group 'mime-view
  :type 'boolean)

(defcustom mime-view-nobreak-char-display nil
  "Override `nobreak-char-display' in preview buffer.
See `nobreak-char-display' for details."
  :type '(choice (const :tag "Use harcoded face" t)
		 (const :tag "Use escape glyph" 'escape)
		 (const :tag "No special handling" nil))
  :group 'mime-view)

(defcustom mime-view-multipart/related-show-all-children t
  "When non-nil, do not hide child entities."
  :group 'mime-view
  :type 'boolean)

(defcustom mime-view-multipart/alternative-show-all-children t
  "When non-nil, show hidden descendant entities's buttons in
multipart/alternative entities."
  :group 'mime-view
  :type 'boolean)

(defvar mime-display-multipart/multilingual-unknown-translation-type
  "(unknown)")

(defcustom mime-display-multipart/multilingual-prefered-languages
  (mapcar (lambda (lang)
	    (format "^%s\\(-.+\\)?" (regexp-quote (symbol-name lang))))
	  (let ((result (get-language-info
			 current-language-environment 'iso639-language)))
	    (if (eq result 'en)
		(list result)
	      (cons result '(en)))))
  "Specify language automatically choiced for
multipart/multilingual entities. See docstring of
`mime-display-multipart/multilingual' for details."
  :group 'mime-view
  :type '(repeat regexp))

(defcustom mime-display-multipart/multilingual-translation-type-score
  `(("original" . 2)
    ("human" . 1)
    ("automated" . -1)
    (,mime-display-multipart/multilingual-unknown-translation-type . 0))
  "Specify scores Content-Translation-Type: header fields.  When
score is negative value, corresponding entity is not displayed
automatically.  If field calue is missing or field does not
exist, field value is treated as \"(unknown)\".  See docstring of
`mime-display-multipart/multilingual' for details."
  :group 'mime-view
  :type '(repeat (cons string integer)))

(defcustom mime-display-multipart/multilingual-interactive nil
  "When non-nil, you are asked which language entity should be
displayed for multipart/multilingual entity."
  :group 'mime-view
  :type 'boolean)

(defcustom mime-view-text/html-score 3
  "Score for text/html entity when previewer is available."
  :group 'mime-view
  :type 'integer)

(defcustom mime-view-text/html-previewer-alist
  (delq nil `((w3m mime-w3m-preview-text/html mime-w3m)
	      ,(and (fboundp 'libxml-parse-html-region)
		    '(shr mime-shr-preview-text/html mime-shr))
	      (w3 mime-preview-text/html mime-w3)))
  "Alist for text/html entity previewer.
Each element is a list consists of required module, previewer
function and required feature for previewer function."
  :group 'mime-view
  :type '(repeat (list (symbol :tag "Module")
		       (symbol :tag "Function")
		       (symbol :tag "Feature"))))

(defcustom mime-view-text/html-previewer
  (let ((alist mime-view-text/html-previewer-alist))
    (while (and alist (null (module-installed-p (caar alist))))
      (setq alist (cdr alist)))
    (caar alist))
  "Indicate text/html entity previewer.  Possible vaules are each
car of `mime-view-text/html-previewer-alist' element or nil.
When this value is nil or previewer is not available, text/html
entity is displayed as if text/plain part."
  :group 'mime-view
  :type `(choice ,@(mapcar (lambda (elt) (list 'const (car elt)))
			   mime-view-text/html-previewer-alist)
		 (const :tag "Disable previewer" nil)))

(defcustom mime-display-text/plain-flowed-fill-column nil
  "Fill column for formatting flowed text."
  :group 'mime-view
  :type '(choice (integer :tag "Fixed value")
		 (number :tag "ratio to window's width")
		 (sexp :tag "S-expression")
		 (const nil :tag "Use fill-column's value")))

(defcustom mime-pgp-verify-when-preview t
  "When non-nil, verify signed part while viewing."
  :group 'mime-view
  :type 'boolean)

(defcustom mime-pgp-decrypt-when-preview nil
  "When non-nil, decrypt encrypted part while viewing."
  :group 'mime-view
  :type 'boolean)

;;; @ in raw-buffer (representation space)
;;;

(defvar mime-preview-buffer nil
  "MIME-preview buffer corresponding with the (raw) buffer.")
(make-variable-buffer-local 'mime-preview-buffer)


(defvar mime-raw-representation-type-alist
  '((mime-show-message-mode     . binary)
    (mime-temp-message-mode     . binary)
    (t                          . cooked))
  "Alist of major-mode vs. representation-type of mime-raw-buffer.
Each element looks like (SYMBOL . REPRESENTATION-TYPE).  SYMBOL is
major-mode or t.  t means default.  REPRESENTATION-TYPE must be
`binary' or `cooked'.")


;;; @ in preview-buffer (presentation space)
;;;

(defvar mime-mother-buffer nil
  "Mother buffer corresponding with the (MIME-preview) buffer.
If current MIME-preview buffer is generated by other buffer, such as
message/partial, it is called `mother-buffer'.")
(make-variable-buffer-local 'mime-mother-buffer)

;; (defvar mime-raw-buffer nil
;;   "Raw buffer corresponding with the (MIME-preview) buffer.")
;; (make-variable-buffer-local 'mime-raw-buffer)

(defvar mime-preview-original-window-configuration nil
  "Window-configuration before mime-view-mode is called.")
(make-variable-buffer-local 'mime-preview-original-window-configuration)

(defun mime-preview-original-major-mode (&optional recursive point)
  "Return major-mode of original buffer.
If optional argument RECURSIVE is non-nil and current buffer has
mime-mother-buffer, it returns original major-mode of the
mother-buffer."
  (if (and recursive mime-mother-buffer)
      (with-current-buffer mime-mother-buffer
	(mime-preview-original-major-mode recursive))
    (cdr (assq 'major-mode
	       (get-text-property (or point
				      (if (> (point) (buffer-size))
					  (max (1- (point-max)) (point-min))
					(point)))
				  'mime-view-situation)))))


;;; @ entity information
;;;

(defun mime-entity-situation (entity &optional situation)
  "Return situation of ENTITY."
  (let (rest param name)
    ;; Content-Type
    (unless (assq 'type situation)
      (setq rest (or (mime-entity-content-type entity)
		     (make-mime-content-type 'text 'plain))
	    situation (cons (car rest) situation)
	    rest (cdr rest)))
    (unless (assq 'subtype situation)
      (or rest
	  (setq rest (or (cdr (mime-entity-content-type entity))
			 '((subtype . plain)))))
      (setq situation (cons (car rest) situation)
	    rest (cdr rest)))
    (while rest
      (setq param (car rest))
      (or (assoc (car param) situation)
	  (setq situation (cons param situation)))
      (setq rest (cdr rest)))
    
    ;; Content-Disposition
    (setq rest nil)
    (unless (assq 'disposition-type situation)
      (setq rest (mime-entity-content-disposition entity))
      (if rest
	  (setq situation (cons (cons 'disposition-type
				      (mime-content-disposition-type rest))
				situation)
		rest (mime-content-disposition-parameters rest))))
    (while rest
      (setq param (car rest)
	    name (car param))
      (if (cond ((string= name "filename")
		 (if (assq 'filename situation)
		     nil
		   (setq name 'filename)))
		((string= name "creation-date")
		 (if (assq 'creation-date situation)
		     nil
		   (setq name 'creation-date)))
		((string= name "modification-date")
		 (if (assq 'modification-date situation)
		     nil
		   (setq name 'modification-date)))
		((string= name "read-date")
		 (if (assq 'read-date situation)
		     nil
		   (setq name 'read-date)))
		((string= name "size")
		 (if (assq 'size situation)
		     nil
		   (setq name 'size)))
		(t (setq name (cons 'disposition name))
		   (if (assoc name situation)
		       nil
		     name)))
	  (setq situation
		(cons (cons name (cdr param))
		      situation)))
      (setq rest (cdr rest)))
    
    ;; Content-Transfer-Encoding
    (or (assq 'encoding situation)
	(setq situation
	      (cons (cons 'encoding (or (mime-entity-encoding entity)
					"7bit"))
		    situation)))
    
    situation))

(defsubst mime-delq-null-situation (situations field
					       &rest ignored-values)
  (let (dest)
    (while situations
      (let* ((situation (car situations))
	     (cell (assq field situation)))
	(if cell
	    (or (memq (cdr cell) ignored-values)
		(setq dest (cons situation dest)))))
      (setq situations (cdr situations)))
    dest))

(defun mime-compare-situation-with-example (situation example)
  (let ((example (copy-alist example))
	(match 0))
    (while situation
      (let* ((cell (car situation))
	     (key (car cell))
	     (ecell (assoc key example)))
	(when ecell
	  (if (equal cell ecell)
	      (setq match (1+ match))
	    (setq example (delq ecell example)))))
      (setq situation (cdr situation)))
    (cons match example)))

(defun mime-sort-situation (situation)
  (sort situation
	#'(lambda (a b)
	    (let ((a-t (car a))
		  (b-t (car b))
		  (order '((type . 1)
			   (subtype . 2)
			   (mode . 3)
			   (method . 4)
			   (major-mode . 5)
			   (disposition-type . 6)))
		  a-order b-order)
	      (if (symbolp a-t)
		  (let ((ret (assq a-t order)))
		    (if ret
			(setq a-order (cdr ret))
		      (setq a-order 7)))
		(setq a-order 8))
	      (if (symbolp b-t)
		  (let ((ret (assq b-t order)))
		    (if ret
			(setq b-order (cdr ret))
		      (setq b-order 7)))
		(setq b-order 8))
	      (if (= a-order b-order)
		  (string< (format "%s" a-t)(format "%s" b-t))
		(< a-order b-order))))))

(defun mime-unify-situations (entity-situation
			      condition situation-examples
			      &optional required-name ignored-value
			      every-situations)
  (let (ret)
    (in-calist-package 'mime-view)
    (setq ret
	  (ctree-find-calist condition entity-situation
			     every-situations))
    (if required-name
	(setq ret (mime-delq-null-situation ret required-name
					    ignored-value t)))
    (or (assq 'ignore-examples entity-situation)
	(if (cdr ret)
	    (let ((rest ret)
		  (max-score 0)
		  (max-escore 0)
		  max-examples
		  max-situations)
	      (while rest
		(let ((situation (car rest))
		      (examples situation-examples))
		  (while examples
		    (let* ((ret
			    (mime-compare-situation-with-example
			     situation (caar examples)))
			   (ret-score (car ret)))
		      (cond ((> ret-score max-score)
			     (setq max-score ret-score
				   max-escore (cdar examples)
				   max-examples (list (cdr ret))
				   max-situations (list situation)))
			    ((= ret-score max-score)
			     (cond ((> (cdar examples) max-escore)
				    (setq max-escore (cdar examples)
					  max-examples (list (cdr ret))
					  max-situations (list situation)))
				   ((= (cdar examples) max-escore)
				    (setq max-examples
					  (cons (cdr ret) max-examples))
				    (or (member situation max-situations)
					(setq max-situations
					      (cons situation max-situations))))))))
		    (setq examples (cdr examples))))
		(setq rest (cdr rest)))
	      (when max-situations
		(setq ret max-situations)
		(while max-examples
		  (let* ((example (car max-examples))
			 (cell
			  (assoc example situation-examples)))
		    (if cell
			(setcdr cell (1+ (cdr cell)))
		      (setq situation-examples
			    (cons (cons example 0)
				  situation-examples))))
		  (setq max-examples (cdr max-examples)))))))
    (cons ret situation-examples)
    ;; ret: list of situations
    ;; situation-examples: new examples (notoce that contents of
    ;;                     argument `situation-examples' has bees modified)
    ))

(defun mime-view-entity-title (entity)
  (or (mime-entity-read-field entity 'Content-Description)
      (mime-entity-filename entity)
      (mime-entity-read-field entity 'Subject)
      ""))

(defvar mime-preview-situation-example-list nil)
(defvar mime-preview-situation-example-list-max-size 16)
;; (defvar mime-preview-situation-example-condition nil)

(defvar mime-preview-condition nil
  "Condition-tree about how to display entity.")

(defun mime-find-entity-preview-situation (entity
					   &optional default-situation)
  (or (let ((ret
	     (mime-unify-situations
	      (append (mime-entity-situation entity)
		      default-situation)
	      mime-preview-condition
	      mime-preview-situation-example-list)))
	(setq mime-preview-situation-example-list
	      (cdr ret))
	(caar ret))
      default-situation))

  
(defvar mime-acting-situation-example-list nil)
(defvar mime-acting-situation-example-list-max-size 16)
(defvar mime-situation-examples-file-coding-system nil)

(defun mime-view-read-situation-examples-file (&optional file)
  (or file
      (setq file mime-situation-examples-file))
  (if (and file
	   (file-readable-p file))
      (with-temp-buffer
	(insert-file-contents file)
	(setq mime-situation-examples-file-coding-system
	      buffer-file-coding-system)
	(condition-case error
	    (eval-buffer)
	  (error (message "%s is broken: %s" file (cdr error))))
	;; format check
	(condition-case nil
	    (let ((i 0))
	      (while (and (> (length mime-preview-situation-example-list)
			     mime-preview-situation-example-list-max-size)
			  (< i 16))
		(setq mime-preview-situation-example-list
		      (mime-reduce-situation-examples
		       mime-preview-situation-example-list))
		(setq i (1+ i))))
	  (error (setq mime-preview-situation-example-list nil)))
	;; (let ((rest mime-preview-situation-example-list))
	;;   (while rest
	;;     (ctree-set-calist-strictly 'mime-preview-condition
	;;                                (caar rest))
	;;     (setq rest (cdr rest))))
	(condition-case nil
	    (let ((i 0))
	      (while (and (> (length mime-acting-situation-example-list)
			     mime-acting-situation-example-list-max-size)
			  (< i 16))
		(setq mime-acting-situation-example-list
		      (mime-reduce-situation-examples
		       mime-acting-situation-example-list))
		(setq i (1+ i))))
	  (error (setq mime-acting-situation-example-list nil))))))

(defun mime-save-situation-examples ()
  (if (or mime-preview-situation-example-list
	  mime-acting-situation-example-list)
      (let ((file mime-situation-examples-file)
	    print-length print-level)
        (when file
          (with-temp-buffer
            (insert ";;; " (file-name-nondirectory file) "\n")
            (insert "\n;; This file is generated automatically by "
                    mime-view-version "\n\n")
            (insert ";;; Code:\n\n")
            (if mime-preview-situation-example-list
                (pp `(setq mime-preview-situation-example-list
                           ',mime-preview-situation-example-list)
                    (current-buffer)))
            (if mime-acting-situation-example-list
                (pp `(setq mime-acting-situation-example-list
                           ',mime-acting-situation-example-list)
                    (current-buffer)))
            (insert "\n;;; "
                    (file-name-nondirectory file)
                    " ends here.\n")
            (setq buffer-file-coding-system
                  mime-situation-examples-file-coding-system)
            (setq buffer-file-name file)
            (save-buffer))))))

(add-hook 'kill-emacs-hook 'mime-save-situation-examples)

(defun mime-reduce-situation-examples (situation-examples)
  (let ((len (length situation-examples))
	i ir ic j jr jc ret
	dest d-i d-j
	(max-sim 0) sim
	min-det-ret det-ret
	min-det-org det-org
	min-freq freq)
    (setq i 0
	  ir situation-examples)
    (while (< i len)
      (setq ic (car ir)
	    j 0
	    jr situation-examples)
      (while (< j len)
	(unless (= i j)
	  (setq jc (car jr))
	  (setq ret (mime-compare-situation-with-example (car ic)(car jc))
		sim (car ret)
		det-ret (+ (length (car ic))(length (car jc)))
		det-org (length (cdr ret))
		freq (+ (cdr ic)(cdr jc)))
	  (cond ((< max-sim sim)
		 (setq max-sim sim
		       min-det-ret det-ret
		       min-det-org det-org
		       min-freq freq
		       d-i i
		       d-j j
		       dest (cons (cdr ret) freq)))
		((= max-sim sim)
		 (cond ((> min-det-ret det-ret)
			(setq min-det-ret det-ret
			      min-det-org det-org
			      min-freq freq
			      d-i i
			      d-j j
			      dest (cons (cdr ret) freq)))
		       ((= min-det-ret det-ret)
			(cond ((> min-det-org det-org)
			       (setq min-det-org det-org
				     min-freq freq
				     d-i i
				     d-j j
				     dest (cons (cdr ret) freq)))
			      ((= min-det-org det-org)
			       (cond ((> min-freq freq)
				      (setq min-freq freq
					    d-i i
					    d-j j
					    dest (cons (cdr ret) freq)))))))))))
	(setq jr (cdr jr)
	      j (1+ j)))
      (setq ir (cdr ir)
	    i (1+ i)))
    (if (> d-i d-j)
	(setq i d-i
	      d-i d-j
	      d-j i))
    (setq jr (nthcdr (1- d-j) situation-examples))
    (setcdr jr (cddr jr))
    (if (= d-i 0)
	(setq situation-examples
	      (cdr situation-examples))
      (setq ir (nthcdr (1- d-i) situation-examples))
      (setcdr ir (cddr ir)))
    (if (setq ir (assoc (car dest) situation-examples))
	(progn
	  (setcdr ir (+ (cdr ir)(cdr dest)))
	  situation-examples)
      (cons dest situation-examples)
      ;; situation-examples may be modified.
      )))


;;; @ presentation of preview
;;;

;;; @@ entity-button
;;;

;;; @@@ predicate function
;;;

;; (defun mime-view-entity-button-visible-p (entity)
;;   "Return non-nil if header of ENTITY is visible.
;; Please redefine this function if you want to change default setting."
;;   (let ((media-type (mime-entity-media-type entity))
;;         (media-subtype (mime-entity-media-subtype entity)))
;;     (or (not (eq media-type 'application))
;;         (and (not (eq media-subtype 'x-selection))
;;              (or (not (eq media-subtype 'octet-stream))
;;                  (let ((mother-entity (mime-entity-parent entity)))
;;                    (or (not (eq (mime-entity-media-type mother-entity)
;;                                 'multipart))
;;                        (not (eq (mime-entity-media-subtype mother-entity)
;;                                 'encrypted)))
;;                    )
;;                  )))))

;;; @@@ entity button generator
;;;

(defun mime-view-insert-entity-button (entity)
  "Insert entity-button of ENTITY."
  (let ((entity-node-id (mime-entity-node-id entity))
	(params (mime-entity-parameters entity))
	(subject (mime-view-entity-title entity)))
    (mime-insert-button
     (let ((access-type (assoc "access-type" params))
	   (num (or (cdr (assoc "x-part-number" params))
		    (if (consp entity-node-id)
			(mapconcat (function
				    (lambda (num)
				      (format "%s" (1+ num))))
				   (reverse entity-node-id) ".")
		      "0"))))
       (cond (access-type
	      (let ((server (assoc "server" params)))
		(setq access-type (cdr access-type))
		(if server
		    (format "%s %s ([%s] %s)"
			    num subject access-type (cdr server))
		(let ((site (cdr (assoc "site" params)))
		      (dir (cdr (assoc "directory" params)))
		      (url (cdr (assoc "url" params))))
		  (if url
		      (format "%s %s ([%s] %s)"
			      num subject access-type url)
		    (format "%s %s ([%s] %s:%s)"
			    num subject access-type site dir))))))
	   (t
	    (let* ((charset (cdr (assoc "charset" params)))
		   (encoding (mime-entity-encoding entity))
		   (language (mime-entity-read-field
			      entity "Content-Language"))
		   (rest (format " <%s/%s%s%s%s>"
				 (mime-entity-media-type entity)
				 (mime-entity-media-subtype entity)
				 (if language
				     (concat " (" language ")")
				   "")
				 (if charset
				     (concat "; " charset)
				   "")
				 (if encoding
				     (concat " (" encoding ")")
				   ""))))
	      (concat
	       num " " subject
	       (if (>= (+ (current-column)(length rest))(window-width))
		   "\n\t")
	       rest)))))
     (function mime-preview-play-current-entity))))


;;; @@ entity-header
;;;

(defvar mime-header-presentation-method-alist nil
  "Alist of major mode vs. corresponding header-presentation-method functions.
Each element looks like (SYMBOL . FUNCTION).
SYMBOL must be major mode in raw-buffer or t.  t means default.
Interface of FUNCTION must be (ENTITY SITUATION).")

(defvar mime-view-ignored-field-list
  '(".*Received:" ".*Path:" ".*Id:" "^References:"
    "^Replied:" "^Errors-To:"
    "^Lines:" "^Sender:" ".*Host:" "^Xref:"
    "^Content-Type:" "^Precedence:"
    "^Status:" "^X-VM-.*:")
  "All fields that match this list will be hidden in MIME preview buffer.
Each elements are regexp of field-name.")

(defvar mime-view-visible-field-list '("^Dnas.*:" "^Message-Id:")
  "All fields that match this list will be displayed in MIME preview buffer.
Each elements are regexp of field-name.")


;;; @@ entity-body
;;;

;;; @@@ predicate function
;;;

(in-calist-package 'mime-view)

(defun mime-calist::field-match-method-as-default-rule (calist
							field-type field-value)
  (let ((s-field (assq field-type calist)))
    (cond ((null s-field)
	   (cons (cons field-type field-value) calist))
	  (t calist))))

(define-calist-field-match-method
  'header #'mime-calist::field-match-method-as-default-rule)

(define-calist-field-match-method
  'body #'mime-calist::field-match-method-as-default-rule)

(defun mime-calist::field-match-method-ignore-case (calist
						    field-type field-value)
  (let ((s-field (assoc field-type calist)))
    (cond ((null s-field)
	   (cons (cons field-type field-value) calist))
	  ((eq field-value t)
	   calist)
	  ((string= (downcase (cdr s-field)) (downcase field-value))
	   calist))))

(define-calist-field-match-method
  'access-type #'mime-calist::field-match-method-ignore-case)


(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . octet-stream)
			   (encoding . nil)
			   (body . visible)))
(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . octet-stream)
			   (encoding . "7bit")
			   (body . visible)))
(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . octet-stream)
			   (encoding . "8bit")
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . pgp)
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . x-latex)
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . x-selection)
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition '((type . application)(subtype . x-comment)
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition '((type . message)(subtype . delivery-status)
			   (body . visible)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((body . visible)
   (body-presentation-method . mime-display-text/plain)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . nil)
   (body . visible)
   (body-presentation-method . mime-display-text/plain)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . text)(subtype . enriched)
   (body . visible)
   (body-presentation-method . mime-display-text/enriched)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . text)(subtype . richtext)
   (body . visible)
   (body-presentation-method . mime-display-text/richtext)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . text)(subtype . html)
   (body . visible)
   (body-presentation-method . mime-display-text/html)))

(autoload 'mime-display-application/x-postpet "postpet")

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . application)(subtype . x-postpet)
   (body . visible)
   (body-presentation-method . mime-display-application/x-postpet)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . text)(subtype . t)
   (body . visible)
   (body-presentation-method . mime-display-text/plain)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . multipart)(subtype . alternative)
   (body . visible)
   (body-presentation-method . mime-display-multipart/alternative)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . multipart)(subtype . related)
   (body . visible)
   (body-presentation-method . mime-display-multipart/related)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . multipart)(subtype . multilingual)
   (body . visible)
   (body-presentation-method . mime-display-multipart/multilingual)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . multipart)(subtype . t)
   (body . visible)
   (body-presentation-method . mime-display-multipart/mixed)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . message)(subtype . partial)
   (body . visible)
   (body-presentation-method . mime-display-message/partial-button)))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . message)(subtype . rfc822)
   (body . visible)
   (body-presentation-method . mime-display-message/rfc822)
   (childrens-situation (header . visible))))

(ctree-set-calist-strictly
 'mime-preview-condition
 '((type . message)(subtype . news)
   (body . visible)
   (body-presentation-method . mime-display-message/rfc822)
   (childrens-situation (header . visible))))


;;; @@@ entity presentation
;;;

(defun mime-display-insert-text-content (entity)
  (condition-case signal
      (progn (mime-insert-text-content entity)
	     (run-hooks 'mime-text-decode-hook)
	     t)
    (error   (let ((point (point)))
	       (insert (format "This entity can't be decoded.  %s"
			       (or (cadr signal) "")))
	       (add-text-properties point (point) '(face highlight)))
	     (insert "\nHere is original data.\n\n")
	     (mime-insert-entity-body entity)
	     nil)))

(defun mime-display-text/plain-flowed-parse-line ()
  (cons (point)
	(cond
	 ;; End of buffer
	 ((eobp) nil)
	 ;; Signature separator line
	 ((looking-at "\\(>+\\)? ?\\(-- \\)$")
	  (list (length (match-string 1)) 'hard (match-beginning 2)))
	 ;; Quoted line
	 ((looking-at "\\(>+\\) ?\\(.*?\\)\\( ?\\)$")
	  (list (length (match-string 1))
		(if (zerop (length (match-string 3))) t nil)
		(match-beginning 2)))
	 ;; Stuffed or normal line
	 ((looking-at " ?\\(.*?\\)\\( ?\\)$")
	  (list 0 (if (zerop (length (match-string 2))) t nil)
		(match-beginning 1))))))

(defun mime-display-text/plain-flowed (&optional buffer delete-space)
  (with-current-buffer (or buffer (current-buffer))
    (goto-char (point-min))
    (let ((fill-column
	   (cond
	    ((and (integerp mime-display-text/plain-flowed-fill-column)
		  (< mime-display-text/plain-flowed-fill-column 1))
	     (+ (window-width) mime-display-text/plain-flowed-fill-column))
	    ((integerp mime-display-text/plain-flowed-fill-column)
	     mime-display-text/plain-flowed-fill-column)
	    ((numberp mime-display-text/plain-flowed-fill-column)
	     (floor
	      (* (window-width) mime-display-text/plain-flowed-fill-column)))
	    (mime-display-text/plain-flowed-fill-column
	     (eval mime-display-text/plain-flowed-fill-column))
	    (t fill-column)))
	  (line (mime-display-text/plain-flowed-parse-line))
	  beg-flow depth next point fill-prefix adaptive-fill-mode)
      (setq delete-space (if delete-space -2 -1))
      (while (cdr line)
	(unless (eq (point) (car line))
	  (setcar (cdr (cddr line)) (+ (nth 3 line) (- (point) (car line))))
	  (setcar line (point)))
	(forward-line)
	(setq next (mime-display-text/plain-flowed-parse-line))
	(when (or (null (cdr next))
		  (null (eq (nth 1 line) (nth 1 next)))
		  (eq (nth 2 next) 'hard))
	  (setcar (cddr line) t))
	(if beg-flow
	    ;; Following flowed line.
	    (progn
	      (delete-region (+ (car line) delete-space) (nth 3 line))
	      (when (nth 2 line)
		;; Fixed line
		(setq fill-prefix (unless (zerop depth)
				    (concat (make-string depth ?>) " ")))
		(fill-region beg-flow (point) 'left t)
		(setq beg-flow nil)))
	  ;; Following fixed line.
	  (if (zerop (nth 1 line))
	      ;; Remove stuffed space
	      (delete-region (car line) (nth 3 line))
	    (when (eq (+ (car line) (nth 1 line)) (nth 3 line))
	      ;; Insert stuffing space for quoted text
	      (setq point (point))
	      (goto-char (nth 3 line))
	      (insert 32)
	      (goto-char (1+ point))))
	  (unless (nth 2 line)
	    ;; Beginnig of flowed text
	    (setq beg-flow (car line)
		  depth (nth 1 line))))
	(setq line next)))))

(defun mime-display-text/plain (entity situation)
  (save-restriction
    (narrow-to-region (point-max)(point-max))
    (when (mime-display-insert-text-content entity)
      (when (null (eq (char-before (point-max)) ?\n))
	(goto-char (point-max))
	(insert "\n"))
      (when (equal (downcase (or (cdr (assoc "format" situation)) ""))
		   "flowed")
	(mime-display-text/plain-flowed
	 nil (equal (downcase (or (cdr (assoc "delsp" situation)) ""))
		    "yes")))
      (mime-add-url-buttons)
      (run-hooks 'mime-display-text/plain-hook))))

(autoload 'richtext-decode "richtext")

(defun mime-display-text/richtext (entity _situation)
  (save-restriction
    (narrow-to-region (point-max)(point-max))
    (when (mime-display-insert-text-content entity)
      (remove-text-properties (point-min) (point-max) '(face nil))
      (richtext-decode (point-min) (point-max)))))

(defun mime-display-text/enriched (entity _situation)
  (save-restriction
    (narrow-to-region (point-max)(point-max))
    (when (mime-display-insert-text-content entity)
      (remove-text-properties (point-min) (point-max) '(face nil))
      (enriched-decode (point-min) (point-max)))))

(defun mime-display-text/html-previewer-params ()
  (and mime-view-text/html-previewer
       (or (assq mime-view-text/html-previewer
		 mime-view-text/html-previewer-alist)
	   ;; For compatibility with mime-setup-enable-inline-html.
	   (assq 'w3 mime-view-text/html-previewer-alist))))

(defun mime-display-text/html (entity situation)
  (let ((list (mime-display-text/html-previewer-params)))
    (if (and list
	     (require (nth 2 list) nil t)
	     (fboundp (nth 1 list)))
	(funcall (nth 1 list) entity situation)
      ;; text/html entity previewer is not available.
      (mime-display-text/plain entity situation))))


(defvar mime-view-announcement-for-message/partial
  (when window-system
    "\
\[[ This is message/partial style split message. ]]
\[[ Please press `v' key in this buffer          ]]
\[[ or click here by mouse button-2.             ]]"
    "\
\[[ This is message/partial style split message. ]]
\[[ Please press `v' key in this buffer.         ]]"))

(defun mime-display-message/partial-button (&optional _entity _situation)
  (save-restriction
    (goto-char (point-max))
    (if (not (search-backward "\n\n" nil t))
	(insert "\n"))
    (goto-char (point-max))
    (narrow-to-region (point-max)(point-max))
    (insert mime-view-announcement-for-message/partial)
    (mime-add-button (point-min)(point-max)
		     #'mime-preview-play-current-entity)))

(defun mime-display-message/rfc822 (entity situation)
  (let ((child (car (mime-entity-children entity)))
	(default-situation
	  (copy-alist
	   (delq nil (cons (assq 'major-mode situation)
			   (cdr (assq 'childrens-situation situation)))))))
    (mime-display-entity
     child nil
     (if (memq (mime-entity-media-type child)
	       '(text multipart nil))
	 (put-alist 'entity-button 'invisible default-situation)
       (put-alist 'button-position 'after default-situation)))))

(defun mime-display-multipart/mixed (entity situation)
  (let ((children (mime-entity-children entity))
	(original-major-mode-cell (assq 'major-mode situation))
	(default-situation
	  (cdr (assq 'childrens-situation situation))))
    (if original-major-mode-cell
	(setq default-situation
	      (cons original-major-mode-cell default-situation)))
    (while children
      (mime-display-entity (car children) nil default-situation)
      (setq children (cdr children)))))

(defvar mime-view-entity-lowest-score -1)

(defcustom mime-view-type-subtype-score-alist
  '(((text . enriched) . 3)
    ((text . richtext) . 2)
    ((text . plain)    . 1)
    ((text . html)     . mime-view-text/html-entity-score)
    (multipart . mime-view-multipart-entity-score))
  "Alist MEDIA-TYPE vs corresponding score.
MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t.  t means default.

If MEDIA-TYPE does not have corresponding score,
`mime-view-entity-lowest-score' is used.
Score is integer or function or variable.  The function receives
entity and returns integer."
  :group 'mime-view
  :type '(repeat (cons (choice :tag "Media-Type"
			       (cons :tag "Type/Subtype"
				     (symbol :tag "Primary-type")
				     (symbol :tag "Subtype"))
			       (symbol :tag "Type")
			       (const :tag "Default" t))
		       (choice (integer :tag "score")
			       (function :tag "function")
			       (variable :tag "variable")))))

(defun mime-view-entity-score (entity &optional situation)
  (or situation (setq situation (mime-entity-situation entity)))
  (let ((score
	 (cdr
	  (or (assoc (cons (cdr (assq 'type situation))
			   (cdr (assq 'subtype situation)))
		     mime-view-type-subtype-score-alist)
	      (assq (cdr (assq 'type situation))
		    mime-view-type-subtype-score-alist)
	      (assq t mime-view-type-subtype-score-alist)))))
    (cond
     ((functionp score)
      (setq score (funcall score entity)))
     ((and (symbolp score) (boundp score))
      (setq score (symbol-value score))))
    (if (numberp score)
	score
      mime-view-entity-lowest-score)))

(defun mime-view-multipart-entity-score (entity)
  (apply 'max (or (mapcar 'mime-view-entity-score
			  (mime-entity-children entity))
		  (list (or (assq t mime-view-type-subtype-score-alist)
			    mime-view-entity-lowest-score)))))

(defun mime-view-text/html-entity-score (_entity)
  ;; Module loading is done in mime-display-text/html.
  ;; So, availability is not checked here.
  (if (mime-display-text/html-previewer-params)
      mime-view-text/html-score
    mime-view-entity-lowest-score))

(defun mime-view-multipart-descendant-button (entity situation)
  (let ((default-situation
	  (delq nil (cons (assq 'major-mode situation)
			  (cdr (assq 'childrens-situation situation))))))
    (mapc
     (lambda (child)
       (setq situation (copy-alist (mime-find-entity-preview-situation
				    child default-situation)))
       (mime-display-entity
	child nil (if (eq (cdr (assq 'type situation)) 'multipart)
		      (put-alist 'body-presentation-method
				 'mime-view-multipart-descendant-button
				 situation)
		    (put-alist 'body 'invisible situation))))
     (mime-entity-children entity))))

(defun mime-display-multipart/alternative (entity situation)
  (let ((original-major-mode-cell (assq 'major-mode situation))
	(default-situation
	  (cdr (assq 'childrens-situation situation)))
	(max-score 0)
	p pairs
	child-situation score)
    (when original-major-mode-cell
      (setq default-situation
	    (cons original-major-mode-cell default-situation)))
    (setq pairs
	  (mapcar
	   (lambda (child)
	     (setq child-situation
		   (mime-find-entity-preview-situation
		    child default-situation))
	     (when (cdr (assq 'body-presentation-method child-situation))
	       (setq score (mime-view-entity-score child child-situation))
	       (when (>= score max-score)
		 (setq p child
		       max-score score)))
	     (cons child child-situation))
	   (mime-entity-children entity)))
    (or p (setq p (caar pairs)))
    (mapc (lambda (pair)
	    (mime-display-entity
	     (car pair) nil
	     (cond
	      ((eq p (car pair))
	       (cdr pair))
	      ((and mime-view-multipart/alternative-show-all-children
		    (eq (cdr (assq 'type (cdr pair))) 'multipart))
	       (put-alist 'body-presentation-method
			  'mime-view-multipart-descendant-button
			  (copy-alist (cdr pair))))
	      (t (put-alist 'body 'invisible (copy-alist (cdr pair)))))))
	  pairs)))

(defun mime-display-multipart/related (entity situation)
  (let* ((param-start (mime-parse-msg-id
		       (std11-lexical-analyze
			(cdr (assoc "start"
				    (mime-content-type-parameters
				     (mime-entity-content-type entity)))))))
	 (start (or (and param-start (mime-find-entity-from-content-id
				      param-start
				      entity))
		    (car (mime-entity-children entity))))
	 (original-major-mode-cell (assq 'major-mode situation))
	 (default-situation (cdr (assq 'childrens-situation situation))))
    (if original-major-mode-cell
	(setq default-situation
	      (cons original-major-mode-cell default-situation)))
    (mapc
     (lambda (child)
       (cond
	((eq start child)
	 (mime-display-entity start nil default-situation))
	(mime-view-multipart/related-show-all-children
	 (let ((child-situation (copy-alist (mime-find-entity-preview-situation
					     child default-situation))))
	   (mime-display-entity
	    child nil
	    (if (eq (mime-entity-media-type child) 'multipart)
		(put-alist 'body-presentation-method
			   'mime-view-multipart-descendant-button
			   child-situation)
	      (put-alist 'body 'invisible child-situation)))))))
     (mime-entity-children entity))))

(defun mime-display-multipart/multilingual-select-interactively (pairs)
  (let (count counts result elt)
    (setq pairs
	  (dolist (pair pairs (nreverse result))
	    (when (caar pair)
	      (setq elt (format "%s/%s"
				(or (caar pair) "")
				(or (cdar pair)
				    mime-display-multipart/multilingual-unknown-translation-type)))
	      (if (setq count (assoc elt counts))
		  (setq elt
			(format "%s:%d" elt (setcdr count (1+ (cdr count)))))
		(setq counts (cons (cons elt 1) counts)))
	      (setq result (cons (cons elt (cdr pair)) result)))))
    (when (> (length pairs) 0)
      (cdr (assoc
	    (completing-read
	     "Which language is displayed for this multilingual message? "
	     (mapcar 'car pairs) nil t nil nil (caar pairs))
	    pairs)))))

(defun mime-display-multipart/multilingual-select-automatically (pairs)
  (let ((max-score '(0 . 0))
	(case-fold-search t)
	score choice first zxx)
    (dolist (pair pairs)
      (when (caar pair)
	(unless first
	  ;; The first language message part
	  (setq first (cdr pair)))
	(when (string-match "^zxx$" (caar pair))
	  ;; The language-independent message part
	  (setq zxx (cdr pair)))
	(setq score
	      (cons
	       (let ((langs
		      mime-display-multipart/multilingual-prefered-languages))
		 (catch 'done
		   (while langs
		     (when (string-match (car langs) (caar pair))
		       (throw 'done (length langs)))
		     (setq langs (cdr langs)))
		   -1))
	       (or
		(cdr
		 (assoc
		  (or (cdar pair)
		      mime-display-multipart/multilingual-unknown-translation-type)
		  mime-display-multipart/multilingual-translation-type-score))
		-1)))
	(when (or (> (cdr score) (cdr max-score))
		  (and (eq (cdr score) (cdr max-score))
		       (> (car score) (car max-score))))
	  (setq max-score score)
	  (setq choice (cdr pair)))))
    (or choice zxx first)))

(defun mime-display-multipart/multilingual (entity situation)
  "MIME-View mode preview method for multipart/multilingual entity.
When `mime-display-multipart/multilingual-interactive' is nil,
select child entity to display automatically.
Automatic selection algorithm is below.

1. Select highest score entity calculated from
Content-Translation-Type: field and
`mime-display-multipart/multilingual-translation-type-score'.
But if score is negative, never selected.
2. If there are multiple highest score entities, select entities
whose Content-Language: field values matches former element of
`mime-display-multipart/multilingual-prefered-languages'.  If not
matched, never selected.
3. If no entity is selected, select the language-independent
part (if exist) or the first language message part."
  (let ((default-situation
	  (delq nil (cons (assq 'major-mode situation)
			  (cdr (assq 'childrens-situation situation)))))
	choice pairs)
    (setq pairs
	  (mapcar
	   (lambda (child)
	     (cons (cons
		    (cdr (assq 'atom
			       (std11-lexical-analyze
				(mime-entity-read-field
				 child "Content-Language"))))
		    (cdr (assq 'atom
			       (std11-lexical-analyze
				(mime-entity-fetch-field
				 child "Content-Translation-Type")))))
		   child))
	   (mime-entity-children entity)))
    (setq choice
	  (if mime-display-multipart/multilingual-interactive
	      (mime-display-multipart/multilingual-select-interactively pairs)
	    (mime-display-multipart/multilingual-select-automatically pairs)))
    (mapc (lambda (child)
	    (mime-display-entity
	     child nil
	     (if (eq choice child)
		 default-situation
	       (put-alist 'body 'invisible
			  (copy-alist (mime-find-entity-preview-situation
				       child default-situation))))))
	  (mime-entity-children entity))))

;;; @ acting-condition
;;;

(defvar mime-acting-condition nil
  "Condition-tree about how to process entity.")

(defun mime-view-read-mailcap-files (&optional files)
  (or files
      (setq files
	    (if mime-mailcap-file
		(cons mime-mailcap-file
		      (remove mime-mailcap-file mime-view-mailcap-files))
	      mime-view-mailcap-files)))
  (let (entries file)
    (while files
      (setq file (car files))
      (if (file-readable-p file)
	  (setq entries (append entries (mime-parse-mailcap-file file))))
      (setq files (cdr files)))
    (while entries
      (let ((entry (car entries))
	    view print shared)
	(while entry
	  (let* ((field (car entry))
		 (field-type (car field)))
	    (cond ((eq field-type 'view)  (setq view field))
		  ((eq field-type 'print) (setq print field))
		  ((memq field-type '(compose composetyped edit)))
		  (t (setq shared (cons field shared)))))
	  (setq entry (cdr entry)))
	(setq shared (nreverse shared))
	(ctree-set-calist-with-default
	 'mime-acting-condition
	 (append shared (list '(mode . "play")(cons 'method (cdr view)))))
	(if print
	    (ctree-set-calist-with-default
	     'mime-acting-condition
	     (append shared
		     (list '(mode . "print")(cons 'method (cdr view)))))))
      (setq entries (cdr entries)))))

(mime-view-read-mailcap-files)

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . application)(subtype . octet-stream)
   (mode . "play")
   (method . mime-detect-content)))

(ctree-set-calist-with-default
 'mime-acting-condition
 '((mode . "extract")
   (method . mime-save-content)))

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . text)(subtype . x-rot13-47)(mode . "play")
   (method . mime-view-caesar)))
(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . text)(subtype . x-rot13-47-48)(mode . "play")
   (method . mime-view-caesar)))

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . message)(subtype . rfc822)(mode . "play")
   (method . mime-view-message/rfc822)))
(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . message)(subtype . partial)(mode . "play")
   (method . mime-store-message/partial-piece)))

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . message)(subtype . external-body)
   ("access-type" . "anon-ftp")
   (method . mime-view-message/external-anon-ftp)))

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . message)(subtype . external-body)
   ("access-type" . "url")
   (method . mime-view-message/external-url)))

(ctree-set-calist-strictly
 'mime-acting-condition
 '((type . application)(subtype . octet-stream)
   (method . mime-save-content)))


;;; @ quitting method
;;;

(defvar mime-preview-quitting-method-alist
  '((mime-show-message-mode
     . mime-preview-quitting-method-for-mime-show-message-mode))
  "Alist of major-mode vs. quitting-method of mime-view.")

(defvar mime-preview-over-to-previous-method-alist nil
  "Alist of major-mode vs. over-to-previous-method of mime-view.")

(defvar mime-preview-over-to-next-method-alist nil
  "Alist of major-mode vs. over-to-next-method of mime-view.")


;;; @ following method
;;;

(defvar mime-preview-following-method-alist nil
  "Alist of major-mode vs. following-method of mime-view.")

(defvar mime-view-following-required-fields-list
  '("From"))


;;; @ buffer setup
;;;

(defun mime-display-entity-visible-p (elements situation &optional default)
  (catch 'done
    (let (result)
      (while elements
	(when (setq result (cdr (assq (car elements) situation)))
	  (unless (memq result '(visible invisible))
	    (setq result (cond ((functionp result)
				(funcall result situation))
			       ((and (symbolp result) (boundp result))
				(symbol-value result))
			       (t default))))
	  ;; Non-nil values other than invisible are treated as
	  ;; visible.
	  (throw 'done (if (memq result '(invisible nil))
			   nil t)))
	(setq elements (cdr elements))))
    default))

(defvar mime-display-header-hook nil)

(defun mime-display-entity (entity &optional situation
				   default-situation preview-buffer)
  (or preview-buffer
      (setq preview-buffer (current-buffer)))
  (let* (nb ne nbb)
    (in-calist-package 'mime-view)
    (or situation
	(setq situation
	      (mime-find-entity-preview-situation entity default-situation)))
    (let ((button-is-visible
	   (and mime-view-buttons-visible
		(mime-display-entity-visible-p
		 '(*entity-button entity-button) situation t)))
	  (button-position (cdr (assq 'button-position situation)))
	  (header-is-visible
	   (mime-display-entity-visible-p '(*header header) situation))
	  (body-is-visible
	   (mime-display-entity-visible-p '(*body body) situation))
	  (children (mime-entity-children entity)))
      (set-buffer preview-buffer)
      (setq nb (point))
      (narrow-to-region nb nb)
      (if header-is-visible
	  (let ((header-presentation-method
		 (or (cdr (assq 'header-presentation-method situation))
		     (cdr (assq (cdr (assq 'major-mode situation))
				mime-header-presentation-method-alist)))))
	    (if header-presentation-method
		(funcall header-presentation-method entity situation)
	      (mime-insert-header entity
				  mime-view-ignored-field-list
				  mime-view-visible-field-list))
	    (run-hooks 'mime-display-header-hook)
	    (put-text-property nb (point-max) 'mime-view-entity-header entity)
	    (goto-char (point-max))
	    (insert "\n")))
      (when button-is-visible
	(unless (eq button-position 'after)
	  (goto-char (point-min)))
	(mime-view-insert-entity-button entity)
	(goto-char (point-max)))
      (setq nbb (point))
      (unless children
	(when body-is-visible
	  (let ((body-presentation-method
		 (cdr (assq 'body-presentation-method situation))))
	    (if (functionp body-presentation-method)
		(funcall body-presentation-method entity situation)
	      (mime-display-text/plain entity situation))))
	(goto-char (point-max))
	;; Insert LF if needed.
	(unless (eq (preceding-char) 10) (insert 10)))
      (setq ne (or (next-single-property-change nb 'mime-view-entity)
		   (point-max)))
      (widen)
      (put-text-property nb ne 'mime-view-entity entity)
      (put-text-property nb ne 'mime-view-situation situation)
      (put-text-property nbb ne 'mime-view-entity-body entity)
      (goto-char ne)
      (if (and children body-is-visible)
	  (let ((body-presentation-method
		 (cdr (assq 'body-presentation-method situation))))
	    (if (functionp body-presentation-method)
		(funcall body-presentation-method entity situation)
	      (mime-display-multipart/mixed entity situation)))))))


;;; @ MIME viewer mode
;;;

(defconst mime-view-menu-title "MIME-View")
(defconst mime-view-menu-list
  '((up		 "Move to upper entity"    mime-preview-move-to-upper)
    (previous	 "Move to previous entity" mime-preview-move-to-previous)
    (next	 "Move to next entity"	   mime-preview-move-to-next)
    (scroll-down "Scroll-down"             mime-preview-scroll-down-entity)
    (scroll-up	 "Scroll-up"               mime-preview-scroll-up-entity)
    (play	 "Play current entity"     mime-preview-play-current-entity)
    (extract	 "Extract current entity"  mime-preview-extract-current-entity)
    (print	 "Print current entity"    mime-preview-print-current-entity))
  "Menu for MIME Viewer")

(defvar mime-view-popup-menu
  (let ((menu (make-sparse-keymap mime-view-menu-title)))
    (nconc menu
           (mapcar (lambda (item)
                     (list (intern (nth 1 item)) 'menu-item
                           (nth 1 item) (nth 2 item)))
                   mime-view-menu-list))))

(defun mime-view-popup-menu (_event)
  "Popup the menu in the MIME Viewer buffer"
  (interactive "@e")
  (let ((menu mime-view-popup-menu) events func)
    (setq events (x-popup-menu t menu))
    (and events
         (setq func (lookup-key menu (apply #'vector events)))
         (commandp func)
         (funcall func))))
(defvar mouse-button-2 [mouse-2])
(defvar mouse-button-3 [mouse-3])

(defun mime-view-define-keymap (&optional default)
  (let ((mime-view-mode-map (if (keymapp default)
				(copy-keymap default)
			      (make-sparse-keymap))))
    (define-key mime-view-mode-map
      "u"        (function mime-preview-move-to-upper))
    (define-key mime-view-mode-map
      "p"        (function mime-preview-move-to-previous))
    (define-key mime-view-mode-map
      "n"        (function mime-preview-move-to-next))
    (define-key mime-view-mode-map
      "\e\t"     (function mime-preview-move-to-previous))
    (define-key mime-view-mode-map
      "\t"       (function mime-preview-move-to-next))
    (define-key mime-view-mode-map
      " "        (function mime-preview-scroll-up-entity))
    (define-key mime-view-mode-map
      "\M- "     (function mime-preview-scroll-down-entity))
    (define-key mime-view-mode-map
      "\177"     (function mime-preview-scroll-down-entity))
    (define-key mime-view-mode-map
      "\C-m"     (function mime-preview-next-line-entity))
    (define-key mime-view-mode-map
      "\C-\M-m"  (function mime-preview-previous-line-entity))
    (define-key mime-view-mode-map
      "v"        (function mime-preview-play-current-entity))
    (define-key mime-view-mode-map
      "e"        (function mime-preview-extract-current-entity))
    (define-key mime-view-mode-map
      "\C-c\C-p" (function mime-preview-print-current-entity))

    (define-key mime-view-mode-map
      "\C-c\C-t\C-f" (function mime-preview-toggle-header))
    (define-key mime-view-mode-map
      "\C-c\C-th" (function mime-preview-toggle-header))
    (define-key mime-view-mode-map
      "\C-c\C-t\C-c" (function mime-preview-toggle-content))

    (define-key mime-view-mode-map
      "\C-c\C-v\C-f" (function mime-preview-show-header))
    (define-key mime-view-mode-map
      "\C-c\C-vh" (function mime-preview-show-header))
    (define-key mime-view-mode-map
      "\C-c\C-v\C-c" (function mime-preview-show-content))

    (define-key mime-view-mode-map
      "\C-c\C-d\C-f" (function mime-preview-hide-header))
    (define-key mime-view-mode-map
      "\C-c\C-dh" (function mime-preview-hide-header))
    (define-key mime-view-mode-map
      "\C-c\C-d\C-c" (function mime-preview-hide-content))

    (define-key mime-view-mode-map
      "a"        (function mime-preview-follow-current-entity))
    (define-key mime-view-mode-map
      "q"        (function mime-preview-quit))
    (define-key mime-view-mode-map
      "\C-c\C-x" (function mime-preview-kill-buffer))
    ;; (define-key mime-view-mode-map
    ;;   "<"        (function beginning-of-buffer))
    ;; (define-key mime-view-mode-map
    ;;   ">"        (function end-of-buffer))
    (define-key mime-view-mode-map
      "?"        (function describe-mode))
    (define-key mime-view-mode-map
      [tab] (function mime-preview-move-to-next))
    (define-key mime-view-mode-map
      [delete] (function mime-preview-scroll-down-entity))
    (define-key mime-view-mode-map
      [backspace] (function mime-preview-scroll-down-entity))
    (if (functionp default)
	(setq mime-view-mode-map
	      (append mime-view-mode-map (list (cons t default)))))
    (if mouse-button-2
	(define-key mime-view-mode-map
	  mouse-button-2 (function mime-button-dispatcher)))
    (define-key mime-view-mode-map
      mouse-button-3 (function mime-view-popup-menu))
    (define-key mime-view-mode-map [menu-bar mime-view]
      (cons mime-view-menu-title
	    (make-sparse-keymap mime-view-menu-title)))
    (mapc (function
	   (lambda (item)
	     (define-key mime-view-mode-map
	       (vector 'menu-bar 'mime-view (car item))
	       (cons (nth 1 item)(nth 2 item)))))
	  (reverse mime-view-menu-list))

    ;; (run-hooks 'mime-view-define-keymap-hook)
    mime-view-mode-map))

(defvar mime-view-mode-default-map (mime-view-define-keymap))


(defsubst mime-maybe-hide-echo-buffer ()
  "Clear mime-echo buffer and delete window for it."
  (let ((buf (get-buffer mime-echo-buffer-name)))
    (if buf
	(with-current-buffer buf
	  (erase-buffer)
	  (let ((win (get-buffer-window buf)))
	    (if win
		(delete-window win)))
	  (bury-buffer buf)))))

(defvar mime-view-redisplay nil)

;;;###autoload
(defun mime-display-message (message &optional preview-buffer
				     mother default-keymap-or-function
				     original-major-mode keymap)
  "View MESSAGE in MIME-View mode.

Optional argument PREVIEW-BUFFER specifies the buffer of the
presentation.  It must be either nil or a name of preview buffer.

Optional argument MOTHER specifies mother-buffer of the preview-buffer.

Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
function.  If it is a keymap, keymap of MIME-View mode will be added
to it.  If it is a function, it will be bound as default binding of
keymap of MIME-View mode.

Optional argument ORIGINAL-MAJOR-MODE is major-mode of representation
buffer of MESSAGE.  If it is nil, current `major-mode' is used.

Optional argument KEYMAP is keymap of MIME-View mode.  If it is
non-nil, DEFAULT-KEYMAP-OR-FUNCTION is ignored.  If it is nil,
`mime-view-mode-default-map' is used."
  (mime-maybe-hide-echo-buffer)
  (let ((win-conf (current-window-configuration)))
    (or preview-buffer
	(setq preview-buffer
	      (concat "*Preview-" (mime-entity-name message) "*")))
    (or original-major-mode
	(setq original-major-mode major-mode))
    (let ((inhibit-read-only t))
      (set-buffer (get-buffer-create preview-buffer))
      (widen)
      (erase-buffer)
      (if mother
	  (setq mime-mother-buffer mother))
      (setq mime-preview-original-window-configuration win-conf)
      (setq major-mode 'mime-view-mode)
      (setq mode-name "MIME-View")
      (make-local-variable 'nobreak-char-display)
      (setq nobreak-char-display mime-view-nobreak-char-display)
      ;; Do not hide button when first entity is
      ;; neither text nor multipart.
      (mime-display-entity
       message nil `(,(if (memq (mime-entity-media-type message)
				'(text multipart nil))
			  '(entity-button . invisible)
			'(button-position . after))
		     (header . visible)
		     (major-mode . ,original-major-mode))
       preview-buffer)
      (use-local-map
       (or keymap
	   (if default-keymap-or-function
	       (mime-view-define-keymap default-keymap-or-function)
	     mime-view-mode-default-map)))
      (let ((point
	     (next-single-property-change (point-min) 'mime-view-entity)))
	(if point
	    (goto-char point)
	  (goto-char (point-min))
	  (search-forward "\n\n" nil t)))
      (run-hooks 'mime-view-mode-hook)
      (set-buffer-modified-p nil)
      (setq buffer-read-only t)
      preview-buffer)))

;;;###autoload
(defun mime-view-buffer (&optional raw-buffer preview-buffer mother
				   default-keymap-or-function
				   representation-type)
  "View RAW-BUFFER in MIME-View mode.
Optional argument PREVIEW-BUFFER is either nil or a name of preview
buffer.
Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
function.  If it is a keymap, keymap of MIME-View mode will be added
to it.  If it is a function, it will be bound as default binding of
keymap of MIME-View mode.
Optional argument REPRESENTATION-TYPE is representation-type of
message.  It must be nil, `binary' or `cooked'.  If it is nil,
`cooked' is used as default."
  (interactive)
  (or raw-buffer
      (setq raw-buffer (current-buffer)))
  (or representation-type
      (setq representation-type
	    (with-current-buffer raw-buffer
	      (cdr (or (assq major-mode mime-raw-representation-type-alist)
		       (assq t mime-raw-representation-type-alist))))))
  (if (eq representation-type 'binary)
      (setq representation-type 'buffer))
  (setq preview-buffer (mime-display-message
			(mime-open-entity representation-type raw-buffer)
			preview-buffer mother default-keymap-or-function))
  (or (get-buffer-window preview-buffer)
      (let ((r-win (get-buffer-window raw-buffer)))
	(if r-win
	    (set-window-buffer r-win preview-buffer)
	  (let ((m-win (and mother (get-buffer-window mother))))
	    (if m-win
		(set-window-buffer m-win preview-buffer)
	      (switch-to-buffer preview-buffer)))))))

(defun mime-view-mode (&optional mother ctl encoding
				 raw-buffer preview-buffer
				 default-keymap-or-function)
  "Major mode for viewing MIME message.

Here is a list of the standard keys for mime-view-mode.

key		feature
---		-------

u		Move to upper content
p or M-TAB	Move to previous content
n or TAB	Move to next content
SPC		Scroll up or move to next content
M-SPC or DEL	Scroll down or move to previous content
RET		Move to next line
M-RET		Move to previous line
v		Decode current content as `play mode'
e		Decode current content as `extract mode'
C-c C-p		Decode current content as `print mode'
a		Followup to current content.
q		Quit
button-2	Move to point under the mouse cursor
        	and decode current content as `play mode'
"
  (interactive)
  (let (message)
    (unless mime-view-redisplay
      (save-excursion
	(if raw-buffer (set-buffer raw-buffer))
	(let ((type
	       (cdr
		(or (assq major-mode mime-raw-representation-type-alist)
		    (assq t mime-raw-representation-type-alist)))))
	  (if (eq type 'binary)
	      (setq type 'buffer))
	  (setq message (mime-open-entity type raw-buffer))
	  (or (mime-entity-content-type message)
	      (mime-entity-set-content-type message ctl)))
	(or (mime-entity-encoding message)
	    (mime-entity-set-encoding message encoding))))
    (mime-display-message message preview-buffer
			  mother default-keymap-or-function)))


;;; @@ utility
;;;

(defun mime-preview-find-boundary-info (&optional with-children)
  "Return boundary information of current part.
If WITH-CHILDREN, refer boundary surrounding current part and its branches."
  (let (entity
	p-beg p-end
	entity-node-id len)
    (while (and
	    (null (setq entity
			(get-text-property (point) 'mime-view-entity)))
	    (> (point) (point-min)))
      (backward-char))
    (setq p-beg (previous-single-property-change (point) 'mime-view-entity))
    (setq entity-node-id (and entity (mime-entity-node-id entity)))
    (setq len (length entity-node-id))
    (cond ((null p-beg)
	   (setq p-beg
		 (if (eq (next-single-property-change (point-min)
						      'mime-view-entity)
			 (point))
		     (point)
		   (point-min))))
	  ((eq (next-single-property-change p-beg 'mime-view-entity)
	       (point))
	   (setq p-beg (point))))
    (setq p-end (next-single-property-change p-beg 'mime-view-entity))
    (cond ((null p-end)
	   (setq p-end (point-max)))
	  ((null entity-node-id)
	   (setq p-end (point-max)))
	  (with-children
	   (save-excursion
	     (catch 'tag
	       (let (e i)
		 (while (setq e
			      (next-single-property-change
			       (point) 'mime-view-entity))
		   (goto-char e)
		   (let ((rc (mime-entity-node-id
			      (get-text-property (point)
						 'mime-view-entity))))
		     (or (and (>= (setq i (- (length rc) len)) 0)
			      (equal entity-node-id (nthcdr i rc)))
			 (throw 'tag nil)))
		   (setq p-end (or (next-single-property-change
				    (point) 'mime-view-entity)
				   (point-max)))))
	       (setq p-end (point-max))))))
    (vector p-beg p-end entity)))


;;; @@ playing
;;;

(autoload 'mime-preview-play-current-entity "mime-play"
  "Play current entity." t)

(defun mime-preview-extract-current-entity (&optional ignore-examples)
  "Extract current entity into file (maybe).
It decodes current entity to call internal or external method as
\"extract\" mode.  The method is selected from variable
`mime-acting-condition'."
  (interactive "P")
  (mime-preview-play-current-entity ignore-examples "extract"))

(defun mime-preview-print-current-entity (&optional ignore-examples)
  "Print current entity (maybe).
It decodes current entity to call internal or external method as
\"print\" mode.  The method is selected from variable
`mime-acting-condition'."
  (interactive "P")
  (mime-preview-play-current-entity ignore-examples "print"))


;;; @@ following
;;;

(defun mime-preview-follow-current-entity ()
  "Write follow message to current entity.
It calls following-method selected from variable
`mime-preview-following-method-alist'."
  (interactive)
  (let* ((boundary-info (mime-preview-find-boundary-info t))
	 (p-beg (aref boundary-info 0))
	 (p-end (aref boundary-info 1))
	 (entity (aref boundary-info 2))
	 pb-beg)
    (if (or (get-text-property p-beg 'mime-view-entity-body)
	    (null entity))
	(setq pb-beg p-beg)
      (setq pb-beg
	    (next-single-property-change
	     p-beg 'mime-view-entity-body nil
	     (or (next-single-property-change p-beg 'mime-view-entity)
		 p-end))))
    (let* ((mode (mime-preview-original-major-mode 'recursive))
	   (entity-node-id (and entity (mime-entity-node-id entity)))
	   (new-name
	    (format "%s-%s" (buffer-name) (reverse entity-node-id)))
	   new-buf
	   (the-buf (current-buffer))
	   fields)
      ;; Do not use `with-current-buffer'.  Inner save-excursion(),
      ;; the current buffer may be accessed.
      (save-excursion
	(set-buffer (setq new-buf (get-buffer-create new-name)))
	(erase-buffer)
	(insert ?\n)
	(insert-buffer-substring the-buf pb-beg p-end)
	(goto-char (point-min))
	(let ((current-entity
	       (if (and entity
			(eq (mime-entity-media-type entity) 'message)
			(eq (mime-entity-media-subtype entity) 'rfc822))
		   (car (mime-entity-children entity))
		 entity)))
	  (while (and current-entity
		      (if (and (eq (mime-entity-media-type
				    current-entity) 'message)
			       (eq (mime-entity-media-subtype
				    current-entity) 'rfc822))
			  nil
			(mime-insert-header current-entity fields)
			t))
	    (setq fields (std11-collect-field-names)
		  current-entity (mime-entity-parent current-entity))))
	(let ((rest mime-view-following-required-fields-list)
	      field-name ret)
	  (while rest
	    (setq field-name (car rest))
	    (or (std11-field-body field-name)
		(progn
		  (with-current-buffer the-buf
		    (let ((entity (when mime-mother-buffer
				    (set-buffer mime-mother-buffer)
				    (get-text-property (point)
						       'mime-view-entity))))
		      (while (and entity
				  (null (setq ret (mime-entity-fetch-field
						   entity field-name))))
			(setq entity (mime-entity-parent entity)))))
		  (if ret
		      (insert field-name ": " ret "\n"))))
	    (setq rest (cdr rest)))))
      (let ((f (cdr (assq mode mime-preview-following-method-alist))))
	(if (functionp f)
	    (funcall f new-buf)
	  (message
	   "Sorry, following method for %s is not implemented yet."
	   mode))))))


;;; @@ moving
;;;

(defun mime-preview-move-to-upper ()
  "Move to upper entity.
If there is no upper entity, call function `mime-preview-quit'."
  (interactive)
  (let (cinfo)
    (while (null (setq cinfo
		       (get-text-property (point) 'mime-view-entity)))
      (backward-char))
    (let ((r (mime-entity-parent cinfo))
	  point)
      (catch 'tag
	(while (setq point (previous-single-property-change
			    (point) 'mime-view-entity))
	  (goto-char point)
	  (when (eq r (get-text-property (point) 'mime-view-entity))
	    (if (or (eq mime-preview-move-scroll t)
		    (and mime-preview-move-scroll
			 (>= point
			     (save-excursion
			       (move-to-window-line -1)
			       (forward-line (* -1 next-screen-context-lines))
			       (beginning-of-line)
			       (point)))))
		(recenter next-screen-context-lines))
	    (throw 'tag t)))
	(mime-preview-quit)))))

(defun mime-preview-move-to-previous ()
  "Move to previous entity.
If there is no previous entity, it calls function registered in
variable `mime-preview-over-to-previous-method-alist'."
  (interactive)
  (while (and (not (bobp))
	      (null (get-text-property (point) 'mime-view-entity)))
    (backward-char))
  (let ((point (previous-single-property-change (point) 'mime-view-entity)))
    (if (and point
	     (>= point (point-min)))
	(if (get-text-property (1- point) 'mime-view-entity)
	    (progn (goto-char point)
		   (if
		    (or (eq mime-preview-move-scroll t)
			(and mime-preview-move-scroll
			     (<= point
				(save-excursion
				  (move-to-window-line 0)
				  (forward-line next-screen-context-lines)
				  (end-of-line)
				  (point)))))
			(recenter (* -1 next-screen-context-lines))))
	  (goto-char (1- point))
	  (mime-preview-move-to-previous))
      (let ((f (assq (mime-preview-original-major-mode)
		     mime-preview-over-to-previous-method-alist)))
	(if f
	    (funcall (cdr f)))))))

(defun mime-preview-move-to-next ()
  "Move to next entity.
If there is no previous entity, it calls function registered in
variable `mime-preview-over-to-next-method-alist'."
  (interactive)
  (while (and (not (eobp))
	      (null (get-text-property (point) 'mime-view-entity)))
    (forward-char))
  (let ((point (next-single-property-change (point) 'mime-view-entity)))
    (if (and point
	     (<= point (point-max)))
	(progn
	  (goto-char point)
	  (if (null (get-text-property point 'mime-view-entity))
	      (mime-preview-move-to-next)
	    (and
	     (or (eq mime-preview-move-scroll t)
		 (and mime-preview-move-scroll
		      (>= point
			 (save-excursion
			   (move-to-window-line -1)
			   (forward-line
			    (* -1 next-screen-context-lines))
			   (beginning-of-line)
			   (point)))))
		 (recenter next-screen-context-lines))))
      (let ((f (assq (mime-preview-original-major-mode)
		     mime-preview-over-to-next-method-alist)))
	(if f
	    (funcall (cdr f)))))))

(defun mime-preview-scroll-up-entity (&optional h)
  "Scroll up current entity.
If reached to (point-max), it calls function registered in variable
`mime-preview-over-to-next-method-alist'."
  (interactive)
  (if (eobp)
      (let ((f (assq (mime-preview-original-major-mode)
		     mime-preview-over-to-next-method-alist)))
	(if f
	    (funcall (cdr f))))
    (let ((point
	   (or (next-single-property-change (point) 'mime-view-entity)
	       (point-max)))
	  (bottom (window-end (selected-window))))
      (if (and (not h)
	       (> bottom point))
	  (progn (goto-char point)
		 (recenter next-screen-context-lines))
	(condition-case nil
	    (scroll-up h)
	  (end-of-buffer
	   (goto-char (point-max))))))))

(defun mime-preview-scroll-down-entity (&optional h)
  "Scroll down current entity.
If reached to (point-min), it calls function registered in variable
`mime-preview-over-to-previous-method-alist'."
  (interactive)
  (if (bobp)
      (let ((f (assq (mime-preview-original-major-mode)
		     mime-preview-over-to-previous-method-alist)))
	(if f
	    (funcall (cdr f))))
    (let ((point
	   (or (previous-single-property-change (point) 'mime-view-entity)
	       (point-min)))
	  (top (window-start (selected-window))))
      (if (and (not h)
	       (< top point))
	  (progn (goto-char point)
		 (recenter (* -1 next-screen-context-lines)))
	(condition-case nil
	    (scroll-down h)
	  (beginning-of-buffer
	   (goto-char (point-min))))))))

(defun mime-preview-next-line-entity (&optional lines)
  "Scroll up one line (or prefix LINES lines).
If LINES is negative, scroll down LINES lines."
  (interactive "p")
  (mime-preview-scroll-up-entity (or lines 1)))

(defun mime-preview-previous-line-entity (&optional lines)
  "Scrroll down one line (or prefix LINES lines).
If LINES is negative, scroll up LINES lines."
  (interactive "p")
  (mime-preview-scroll-down-entity (or lines 1)))


;;; @@ display
;;;

(defun mime-preview-toggle-display (type &optional display)
  (let ((situation (mime-preview-find-boundary-info t))
	(sym (intern (concat "*" (symbol-name type))))
	entity p-beg p-end)
    (setq p-beg (aref situation 0)
	  p-end (aref situation 1)
	  entity (aref situation 2)
	  situation (get-text-property p-beg 'mime-view-situation))
    (cond ((eq display 'invisible)
	   (setq display nil))
	  (display)
	  (t
	   (setq display
		 (memq (cdr (or (assq sym situation)
				(assq type situation)))
		       '(nil invisible)))))
    (setq situation (put-alist sym (if display
				       'visible
				     'invisible)
			       situation))
    (save-excursion
      (let ((inhibit-read-only t))
	(delete-region p-beg p-end)
	(mime-display-entity entity situation)))
    (let ((ret (assoc situation mime-preview-situation-example-list)))
      (if ret
	  (setcdr ret (1+ (cdr ret)))
	(add-to-list 'mime-preview-situation-example-list
		     (cons situation 0))))))

(defun mime-preview-toggle-header (&optional force-visible)
  (interactive "P")
  (mime-preview-toggle-display 'header force-visible))

(defun mime-preview-toggle-content (&optional force-visible)
  (interactive "P")
  (mime-preview-toggle-display 'body force-visible))

(defun mime-preview-show-header ()
  (interactive)
  (mime-preview-toggle-display 'header 'visible))

(defun mime-preview-show-content ()
  (interactive)
  (mime-preview-toggle-display 'body 'visible))

(defun mime-preview-hide-header ()
  (interactive)
  (mime-preview-toggle-display 'header 'invisible))

(defun mime-preview-hide-content ()
  (interactive)
  (mime-preview-toggle-display 'body 'invisible))

    
;;; @@ quitting
;;;

(defun mime-preview-quit ()
  "Quit from MIME-preview buffer.
It calls function registered in variable
`mime-preview-quitting-method-alist'."
  (interactive)
  (let ((r (assq (mime-preview-original-major-mode)
		 mime-preview-quitting-method-alist)))
    (if r
	(funcall (cdr r)))))

(defun mime-preview-kill-buffer ()
  (interactive)
  (kill-buffer (current-buffer)))


;;; @ end
;;;

(provide 'mime-view)

(mime-view-read-situation-examples-file)

;;; mime-view.el ends here
0707010000001C000081A4000003E80000006400000001627140E500000998000000000000000000000000000000000000002900000000semi-1.14.6+239+gb1c245b81715/mime-w3.el;;; mime-w3.el --- mime-view content filter for text  -*- lexical-binding: t -*-

;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: HTML, MIME, multimedia, mail, news

;; This file is part of SEMI (Suite of Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'w3 nil t)
(require 'mime)

(eval-and-compile
  (defmacro mime-put-keymap-region (start end keymap)
    `(put-text-property ,start ,end 'local-map ,keymap)))

(defmacro mime-save-background-color (&rest body)
  `(cons 'progn ,body))

(defvar mime-w3-message-structure nil)

(defun mime-preview-text/html (entity _situation)
  (setq mime-w3-message-structure (mime-find-root-entity entity))
  (goto-char (point-max))
  (let ((p (point)))
    (insert "\n")
    (goto-char p)
    (save-restriction
      (narrow-to-region p p)
      (mime-insert-text-content entity)
      (run-hooks 'mime-text-decode-hook)
      (condition-case err
	  (w3-region p (point-max))
	 (error (message "%s" err)))
      (mime-put-keymap-region p (point-max) w3-mode-map))))

(defun url-cid (url &optional _proxy-info)
  (let ((entity
	 (mime-find-entity-from-content-id (mime-uri-parse-cid url)
					   mime-w3-message-structure))
	buffer)
    (when entity
      (setq buffer (generate-new-buffer (format " *cid %s" url)))
      (save-excursion
	(set-buffer buffer)
	(mime-insert-entity-content entity)
	(if (boundp 'url-current-mime-type)
	    (setq url-current-mime-type (mime-entity-type/subtype entity)))))
    buffer))

(if (fboundp 'url-register-protocol)
    (url-register-protocol "cid"
			   'url-cid
			   'url-identity-expander)
  (provide 'url-cid))


;;; @ end
;;;

(provide 'mime-w3)

;;; mime-w3.el ends here
0707010000001D000081A4000003E80000006400000001627140E500001618000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/semi-def.el;;; semi-def.el --- definition module for SEMI -*- lexical-binding: t -*-

;; Copyright (C) 1995,96,97,98,99,2000,01,03,05 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: definition, MIME, multimedia, mail, news

;; This file is part of SEMI (Sample of Emacs MIME Implementation).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(defconst mime-user-interface-product ["SEMI-EPG" (1 14 7) "Harue"]
  "Product name, version number and code name of MIME-kernel package.")

(autoload 'mule-caesar-region "mule-caesar"
  "Caesar rotation of current region." t)


;;; @ constants
;;;

(defconst mime-echo-buffer-name "*MIME-echo*"
  "Name of buffer to display MIME-playing information.")

(defconst mime-temp-buffer-name " *MIME-temp*")


;;; @ button
;;;

(defcustom mime-button-face 'bold
  "Face used for content-button or URL-button of MIME-Preview buffer."
  :group 'mime
  :type 'face)

(defcustom mime-button-mouse-face 'highlight
  "Face used for MIME-preview buffer mouse highlighting."
  :group 'mime
  :type 'face)

(defsubst mime-add-button (from to function &optional data)
  "Create a button between FROM and TO with callback FUNCTION and DATA."
  (and mime-button-face
       (put-text-property from to 'face mime-button-face))
  (and mime-button-mouse-face
       (put-text-property from to 'mouse-face mime-button-mouse-face))
  (put-text-property from to 'mime-button-callback function)
  (and data
       (put-text-property from to 'mime-button-data data)))

(defsubst mime-insert-button (string function &optional data)
  "Insert STRING as button with callback FUNCTION and DATA."
  (save-restriction
    (narrow-to-region (point)(point))
    (insert "[" string "]\n")
    (mime-add-button (point-min)(point-max) function data)))

(defvar mime-button-mother-dispatcher nil)

(defun mime-button-dispatcher (event)
  "Select the button under point."
  (interactive "e")
  (let (buf point func data)
    (save-window-excursion
      (mouse-set-point event)
      (setq buf (current-buffer)
	    point (point)
	    func (get-text-property (point) 'mime-button-callback)
	    data (get-text-property (point) 'mime-button-data)))
    ;; Do not use `with-current-buffer'.
    ;; buf may be the current buffer.
    (save-excursion
      (set-buffer buf)
      (goto-char point)
      (if func
	  (apply func data)
	(if (fboundp mime-button-mother-dispatcher)
	    (funcall mime-button-mother-dispatcher event))))))


;;; @ for URL
;;;

(defcustom mime-browse-url-regexp
  (concat "\\(https?\\|ftps?\\|file\\|gopher\\|news\\|nntps?\\|telnets?\\|wais\\|mailto\\):"
	  "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?"
	  "[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
  "*Regexp to match URL in text body."
  :group 'mime
  :type 'regexp)

(defcustom mime-browse-url-function (function browse-url)
  "*Function to browse URL."
  :group 'mime
  :type 'function)

(defsubst mime-add-url-buttons ()
  "Add URL-buttons for text body."
  (goto-char (point-min))
  (while (re-search-forward mime-browse-url-regexp nil t)
    (let ((beg (match-beginning 0))
	  (end (match-end 0)))
      (mime-add-button beg end mime-browse-url-function
		       (list (buffer-substring beg end))))))


;;; @ menu
;;;

(defun mime-should-use-popup-menu ()
  (and window-system
       (memq (event-basic-type last-command-event)
	     '(mouse-1 mouse-2 mouse-3))))
(defun mime-select-menu-alist (title menu-alist)
  (if (mime-should-use-popup-menu)
      (x-popup-menu
       (list '(1 1) (selected-window))
       (list title (cons title menu-alist)))
    (cdr
     (assoc (completing-read (concat title " : ") menu-alist)
	    menu-alist))))

;;; @ Other Utility
;;;

(defvar mime-condition-type-alist
  '((preview . mime-preview-condition)
    (action . mime-acting-condition)))

(defvar mime-condition-mode-alist
  '((with-default . ctree-set-calist-with-default)
    (t . ctree-set-calist-strictly)))

(defun mime-add-condition (target-type condition &optional mode file)
  "Add CONDITION to database specified by TARGET-TYPE.
TARGET-TYPE must be 'preview or 'action.  
If optional argument MODE is 'strict or nil (omitted), CONDITION is
added strictly.
If optional argument MODE is 'with-default, CONDITION is added with
default rule.
If optional argument FILE is specified, it is loaded when CONDITION is
activate."
  (let ((sym (cdr (assq target-type mime-condition-type-alist))))
    (if sym
	(let ((func (cdr (or (assq mode mime-condition-mode-alist)
			     (assq t mime-condition-mode-alist)))))
	  (if (fboundp func)
	      (progn
		(funcall func sym condition)
		(if file
		    (mapc (lambda (parameter)
			    (when (setq func (cdr (assq parameter condition)))
			      (autoload func file)))
			  '(method body-presentation-method))))
	    (error "Function for mode `%s' is not found." mode)))
      (error "Variable for target-type `%s' is not found." target-type))))


;;; @ end
;;;

(provide 'semi-def)

;;; semi-def.el ends here
0707010000001E000081A4000003E80000006400000001627140E500000083000000000000000000000000000000000000002A00000000semi-1.14.6+239+gb1c245b81715/semi-pkg.el(define-package "semi" "1.14.7"
  "A library to provide MIME features."
  '((emacs "24.5")
    (apel "10.8")
    (flim "1.14.9")))
0707010000001F000081A4000003E80000006400000001627140E500002029000000000000000000000000000000000000002C00000000semi-1.14.6+239+gb1c245b81715/semi-setup.el;;; semi-setup.el --- setup file for MIME-View.  -*- lexical-binding: t -*-

;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word

;; This file is part of SEMI (Setting for Emacs MIME Interfaces).

;; 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'path-util)
(require 'alist)
(require 'semi-def)

(defun call-after-loaded (module func &optional hook-name)
  "If MODULE is provided, then FUNC is called.
Otherwise func is set to MODULE-load-hook.
If optional argument HOOK-NAME is specified,
it is used as hook to set."
  (if (featurep module)
      (funcall func)
    (or hook-name
	(setq hook-name (intern (concat (symbol-name module) "-load-hook"))))
    (add-hook hook-name func)))


;; for image/*
(defvar mime-setup-enable-inline-image
  window-system
  "*If it is non-nil, semi-setup sets up to use mime-image.")

(if mime-setup-enable-inline-image
    (eval-after-load "mime-view"
      '(require 'mime-image)))

;; for text/html
(when (and (boundp 'mime-html-previewer-alist)
	   (null (boundp 'mime-view-text/html-previewer-alist)))
  (defvar mime-view-text/html-previewer-alist 'mime-html-previewer-alist))

(when (and (boundp 'mime-setup-enable-inline-html)
	   (null (boundp 'mime-view-text/html-previewer)))
  (defvar mime-view-text/html-previewer mime-setup-enable-inline-html))

(defadvice mime-w3m-insinuate (around insinuate-to-semi-epg activate)
  (setq mime-view-text/html-previewer 'w3m))

(make-obsolete-variable 'mime-html-previewer-alist
			'mime-view-text/html-previewer-alist
			"12 Jan 2014")

(make-obsolete-variable 'mime-setup-enable-inline-html
			'mime-view-text/html-previewer
			"12 Jan 2014")

;; for text/vcard, text/x-vcard
(defvar mime-setup-enable-vcard
  (module-installed-p 'vcard)
  "*If it is non-nil, semi-setup sets up to use mime-vcard.")

(eval-after-load "mime-view"
  '(when mime-setup-enable-vcard
     (mapc (lambda (subtype)
	     (mime-add-condition
	      'preview 
	      `((type . text)(subtype . ,subtype)
		(body . visible)
		(body-presentation-method . mime-display-text/vcard))
	      'strict "mime-vcard")
	     
	     (set-alist 'mime-view-type-subtype-score-alist
			`(text . ,subtype) 3))
	   '(vcard x-vcard))))

;; for PGP
(defvar mime-setup-enable-epg t
  "*If it is non-nil, semi-setup sets up to use mime-pgp.")

(eval-after-load "mime-view"
  '(when mime-setup-enable-epg
     (mime-add-condition
      'preview '((type . application)(subtype . pgp)
		 (message-button . visible)))
	 
     (mime-add-condition
      'action '((type . multipart)(subtype . signed)
		(method . mime-verify-multipart/signed))
      'strict "mime-pgp")
	 
     (mime-add-condition
      'action
      '((type . application)(subtype . pgp-signature)
	(method . mime-verify-application/*-signature))
      'strict "mime-pgp")
	 
     (mime-add-condition
      'action
      '((type . application)(subtype . pgp-encrypted)
	(method . mime-decrypt-application/pgp-encrypted))
      'strict "mime-pgp")
	 
     (mime-add-condition
      'action
      '((type . application)(subtype . pgp-keys)
	(method . mime-add-application/pgp-keys))
      'strict "mime-pgp")

     (mime-add-condition
      'action
      '((type . application)(subtype . pkcs7-signature)
	(method . mime-verify-application/*-signature))
      'strict "mime-pgp")

     (mime-add-condition
      'action
      '((type . application)(subtype . x-pkcs7-signature)
	(method . mime-verify-application/*-signature))
      'strict "mime-pgp")
	 
     (mime-add-condition
      'action
      '((type . application)(subtype . pkcs7-mime)
	(method . mime-view-application/pkcs7-mime))
      'strict "mime-pgp")

     (mime-add-condition
      'action
      '((type . application)(subtype . x-pkcs7-mime)
	(method . mime-view-application/pkcs7-mime))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . application)
	(subtype . pkcs7-mime)
	(body . mime-pgp-decrypt-when-preview)
	(body-presentation-method . mime-preview-application/pkcs7-mime))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . multipart)
	(subtype . encrypted)
	("protocol" . "application/pgp-encrypted")
	(body . visible)
	(body-presentation-method . mime-display-multipart/pgp-encrypted))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . application)
	(subtype . pgp-signature)
	(body . mime-pgp-verify-when-preview)
	(body-presentation-method . mime-preview-application/*-signature))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . application)
	(subtype . pgp-encrypted)
	(body . mime-pgp-decrypt-when-preview)
	(body-presentation-method . mime-preview-application/pgp-encrypted))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . application)
	(subtype . pkcs7-signature)
	(body . mime-pgp-verify-when-preview)
	(body-presentation-method . mime-preview-application/*-signature))
      'strict "mime-pgp")

     (mime-add-condition
      'preview
      '((type . application)
	(subtype . x-pkcs7-signature)
	(body . mime-pgp-verify-when-preview)
	(body-presentation-method . mime-preview-application/*-signature))
      'strict "mime-pgp")))


(eval-after-load "mime-view"
  '(progn
     (mime-add-condition
      'preview
      '((type . application)
	(subtype . ms-tnef)
	(body . visible)
	(body-presentation-method . mime-display-application/ms-tnef))
      'strict "mime-tnef")
     (mime-add-condition
      'preview
      '((type . application)
	(subtype . vnd.ms-tnef)
	(body . visible)
	(body-presentation-method . mime-display-application/ms-tnef))
      'strict "mime-tnef")))


;;; @ for mime-edit
;;;

;; (defun mime-setup-decode-message-header ()
;;   (save-excursion
;;     (save-restriction
;;       (goto-char (point-min))
;;       (narrow-to-region
;;        (point-min)
;;        (if (re-search-forward
;;             (concat "^" (regexp-quote mail-header-separator) "$")
;;             nil t)
;;            (match-beginning 0)
;;          (point-max)
;;          ))
;;       (mime-decode-header-in-buffer)
;;       (set-buffer-modified-p nil)
;;       )))

;; (add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header)


;;; @@ variables
;;;

(defvar mime-setup-use-signature nil
  "If it is not nil, mime-setup sets up to use signature.el.")

(defvar mime-setup-default-signature-key "\C-c\C-s"
  "*Key to insert signature.")

(defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w"))
  "Alist of major-mode vs. key to insert signature.")


;;; @@ for signature
;;;

(autoload 'insert-signature "signature" "Insert signature" t)

(defun mime-setup-set-signature-key ()
  (let ((keymap (current-local-map)))
    (if keymap
	(let ((key
	       (or (cdr (assq major-mode mime-setup-signature-key-alist))
		   mime-setup-default-signature-key)))
	  (define-key keymap key (function insert-signature))))))

(when mime-setup-use-signature
  (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key)
  ;; (setq message-signature nil)
  )


;;; @ for mu-cite
;;;

;; (add-hook 'mu-cite/pre-cite-hook 'eword-decode-header)


;;; @ for Mac OS X
;;;

(when (eq system-type 'darwin)
  (eval-after-load "mime-view"
    '(progn
       (mime-add-condition
	'action
	'((type . application)
	  (method . mime-mac-save-and-play-with-open))
	'with-default
	"mime-mac"))))


;;; @ end
;;;

(provide 'semi-setup)

;;; semi-setup.el ends here
07070100000020000081A4000003E80000006400000001627140E5000012DE000000000000000000000000000000000000002B00000000semi-1.14.6+239+gb1c245b81715/signature.el;;; signature.el --- a signature utility for GNU Emacs  -*- lexical-binding: t -*-

;; Copyright (C) 1994,1995,1996,1997,2000 Free Software Foundation, Inc.

;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;;         OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
;;         Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
;; Maintainer: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
;; Created: 1994/7/11
;; Keywords: mail, news, signature

;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).

;; 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 this program; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'std11)


;;; @ valiables
;;;

(defvar signature-insert-at-eof nil
  "*If non-nil, insert signature at the end of file.")

(defvar signature-delete-blank-lines-at-eof nil
  "*If non-nil, signature-insert-at-eof deletes blank lines at the end
of file.")

(defvar signature-load-hook nil
  "*List of functions called after signature.el is loaded.")

(defvar signature-separator "-- \n"
  "*String to separate contents and signature.
It is inserted when signature is inserted at end of file.")

(defvar signature-file-name "~/.signature"
  "*Name of file containing the user's signature.")

(defvar signature-file-alist nil
  "*Alist of the form:
    (((FIELD . PATTERN) . FILENAME)
     ...)
PATTERN is a string or list of string. If PATTERN matches the contents of
FIELD, the contents of FILENAME is inserted.")

(defvar signature-file-prefix nil
  "*String containing optional prefix for the signature file names")

(defvar signature-insert-hook nil
  "*List of functions called before inserting a signature.")

(make-obsolete-variable
 'signature-use-bbdb "feature abolished" "29 May 2020")

(defun signature/get-sigtype-interactively (&optional default)
  (read-file-name "Insert your signature: "
                  (or default (concat signature-file-name "-"))
                  (or default signature-file-name)
                  nil))

(defun signature/get-signature-file-name ()
  (save-excursion
    (save-restriction
      (narrow-to-region
       (goto-char (point-min))
       (if (re-search-forward
            (concat "^" (regexp-quote mail-header-separator) "$")
            nil t)
           (match-beginning 0)
         (point-max)))
      (catch 'found
        (let ((alist signature-file-alist) cell field value)
          (while alist
            (setq cell  (car alist)
                  field (std11-field-body (car (car cell)))
                  value (cdr (car cell)))
            (cond ((functionp value)
		   (let ((name (apply value field (cdr cell))))
		     (if name
			 (throw 'found
				(concat signature-file-prefix name)))))
		  ((stringp field)
		   (cond ((consp value)
			  (while value
			    (if (string-match (car value) field)
				(throw 'found
				       (concat
					signature-file-prefix (cdr cell)))
			      (setq value (cdr value)))))
			 ((stringp value)
			  (if (string-match value field)
			      (throw 'found
				     (concat
				      signature-file-prefix (cdr cell))))))))
            (setq alist (cdr alist))))
        signature-file-name))))

(defun insert-signature (&optional arg)
  "Insert the file named by signature-file-name.
It is inserted at the end of file if signature-insert-at-eof is non-nil,
and otherwise at the current point.  A prefix argument enables user to
specify a file named <signature-file-name>-DISTRIBUTION interactively."
  (interactive "P")
  (let ((signature-file-name
         (expand-file-name
          (or (and arg
		   (signature/get-sigtype-interactively))
	      (signature/get-signature-file-name)))))
    (or (file-readable-p signature-file-name)
        (error "Cannot open signature file: %s" signature-file-name))
    (if signature-insert-at-eof
        (progn
          (goto-char (point-max))
          (or (bolp) (insert "\n"))
          (if signature-delete-blank-lines-at-eof (delete-blank-lines))))
    (run-hooks 'signature-insert-hook)
    (if (= (point)(point-max))
	(insert signature-separator))
    (insert-file-contents signature-file-name)
    (force-mode-line-update)
    signature-file-name))


;;; @ end
;;;

(provide 'signature)

(run-hooks 'signature-load-hook)

;;; signature.el ends here
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!1290 blocks
openSUSE Build Service is sponsored by