--- /dev/null
+Wed Jan 17 08:27:26 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tl: version 7.08 was released.
+ * tm: version 7.40 was released.
+
+Sun Jan 14 05:52:49 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-edit.el (mime-editor/choose-charset): New implementation: use
+ function `mime/find-charset-region' instead of
+ `mime-body-charset-chooser'.
+
+ * tm-edit.el: Variable `mime-body-charset-chooser' and its
+ implementations were deleted.
+
+ * tm-edit.el (mime-editor/normalize-body): use variable
+ `mime/charset-default-encoding-alist' instead of function
+ `mime-editor/choose-encoding'.
+
+ * tm-edit.el: Function `mime-editor/choose-encoding' was deleted.
+
+Fri Jan 12 13:59:13 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-def.el (mime/find-charset-region): New function
+
+ * tm-def.el (mime/charset-default-encoding-alist): New variable
+
+Thu Jan 11 18:31:43 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-ew-e.el: Variable `mime/default-charset-encoding-alist' was
+ renamed to `mime-eword/charset-encoding-alist'.
+
+ * tm-ew-e.el: Constant `mime/eword-encoder-version' was renamed to
+ `mime-eword/encoder-version'.
+
+ * tm-ew-e.el: Variable `mime/default-charset-encoding-alist' was
+ moved from tm-def.el.
+
+ * tm-def.el: Variable `mime/default-charset-encoding-alist' was
+ moved to tm-ew-e.el.
+
+ * tm-ew-e.el: Function `mime/find-charset-rule' was renamed to
+ `tm-eword::find-charset-rule'.
+
+ * tm-ew-e.el (mime/find-charset-rule): modified to use function
+ `mime/find-charset'
+
+ * tm-def.el (mime/find-charset): new function
+
+Thu Jan 11 05:33:53 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-ew-e.el (mime/find-charset-rule): new implementation
+
+ * tm-orig.el: Variable `mime/decoding-charset-list' was deleted.
+
+Thu Jan 11 05:12:50 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-nemacs.el, tm-orig.el:
+ Variable `mime/lc-charset-rule-list' was deleted.
+
+ * tm-mule.el:
+ Variable `mime/lc-charset-rule-list' and
+ `mime/unknown-charset-rule' were deleted.
+
+Thu Jan 11 05:09:28 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-def.el (mime/default-charset-encoding-alist): new variable
+
+Thu Jan 11 04:56:08 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-orig.el, tm-nemacs.el, tm-mule.el
+ (mime/lc-charset-alist, mime/unknown-charset): new variable
+
+Wed Jan 10 00:07:57 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-edit.el:
+ (mime-editor/translate-body, mime-editor/translate-region):
+ Spaces in boundary are replaced by underlines.
+ (cf. [tm-en:255,258])
+
+Tue Jan 9 19:08:21 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-mule.el: Obsolete definitions were deleted.
+
+Tue Jan 9 18:43:12 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-orig.el, tm-nemacs.el, tm-mule.el:
+ Variable `mime/latin-lc-list' was deleted.
+
+Tue Jan 9 16:28:44 1996 Morioka Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-orig.el, tm-nemacs.el, tm-mule.el:
+ Variable `mime/lc-charset-and-encoding-alist' was deleted.
tm/mh-e/Makefile tm/mh-e/mk-tmh tm/mh-e/code-jp.ol \
tm/mh-e/*.el tm/mh-e/ChangeLog-*
-MEL_FILES = mel/*.el mel/Makefile mel/mk-mel mel/Changes*
+MEL_FILES = mel/*.el mel/Makefile mel/mk-mel mel/ChangeLog
TL_FILES = tl/README.en tl/Makefile tl/mk-tl tl/*.el tl/doc/*.texi \
- tl/Changes*
+ tl/ChangeLog
FILES = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES)
-TARFILE = tm7.39.tar.gz
+TARFILE = tm7.40.tar.gz
18:
-@c{$Id: tm-view=en.texi,v 7.7 1995/12/25 10:00:44 morioka Exp $}
+@c{$Id: tm-view=en.texi,v 7.8 1995/12/26 00:23:32 morioka Exp $}
@node tm-view, encoded-word, tm-MUA, Top
@comment node-name, next, previous, up
contents of the message. It is done by definition for Content-Types.
On the preview buffer created by tm-view, user can manipulate a
-message to decode, such as run external vewer, extract files, or
+message to decode, such as run external viewer, extract files, or
print.
Notice: In this document, I call @strong{content-type} as
;;; MURATA Masahiro <murata@sol.cs.ritsumei.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1995/09/24
-;;; Version: $Revision: 7.30 $
+;;; Version: $Revision: 7.33 $
;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;;
(defconst tm-gnus/RCS-ID
- "$Id: tm-sgnus.el,v 7.30 1995/12/25 08:15:56 morioka Exp $")
+ "$Id: tm-sgnus.el,v 7.33 1996/01/09 12:06:29 morioka Exp $")
(defconst tm-gnus/version
(concat (get-version-string tm-gnus/RCS-ID) " for September"))
(goto-char (point-min)) (search-forward "\n\n")
'invisible t)
))
- (mime-viewer/ignored-field-regexp
- (if hidden
- "^:$"
- mime-viewer/ignored-field-regexp))
(mime-viewer/redisplay t)
)
(gnus-summary-select-article hidden t)
(make-local-variable 'tm:mother-button-dispatcher)
(setq tm:mother-button-dispatcher
(function gnus-article-push-button))
- (mime/viewer-mode nil nil nil gnus-original-article-buffer
- gnus-article-buffer)
+ (let ((mime-viewer/ignored-field-regexp "^:$"))
+ (mime/viewer-mode nil nil nil gnus-original-article-buffer
+ gnus-article-buffer)
+ )
(setq tm-gnus/automatic-mime-preview t)
(run-hooks 'tm-gnus/article-prepare-hook)
)
(function tm-gnus/article-decode-encoded-word))
+;;; @ for tm-edit
+;;;
+
+(defun tm-gnus/forward-insert-buffer (buffer)
+ (save-excursion
+ (save-restriction
+ (if gnus-signature-before-forwarded-message
+ (goto-char (point-max))
+ (goto-char (point-min))
+ (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "$"))
+ (forward-line 1))
+ ;; Narrow to the area we are to insert.
+ (narrow-to-region (point) (point))
+ ;; Insert the separators and the forwarded buffer.
+ (mime-editor/insert-tag "message" "rfc822")
+ (insert-buffer-substring buffer)
+ ;; Delete any invisible text.
+ (goto-char (point-min))
+ (let (beg)
+ (while (setq beg (next-single-property-change (point) 'invisible))
+ (goto-char beg)
+ (delete-region beg (or (next-single-property-change
+ (point) 'invisible)
+ (point-max))))))))
+
+(call-after-loaded
+ 'mime-setup
+ (lambda ()
+ (cond ((string-match "XEmacs" emacs-version)
+ (require 'gnus-msg)
+ (fset 'gnus-forward-insert-buffer 'tm-gnus/forward-insert-buffer)
+ )
+ (t
+ (eval-after-load
+ "gnus-msg"
+ '(fset 'gnus-forward-insert-buffer 'tm-gnus/forward-insert-buffer)
+ )
+ ))))
+
+
;;; @ for BBDB
;;;
;;; tm-def.el --- definition module for tm
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1995 MORIOKA Tomohiko
+;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-def.el,v 7.8 1995/12/23 12:43:20 morioka Exp $
+;;; $Id: tm-def.el,v 7.12 1996/01/12 13:59:13 morioka Exp $
;;; Keywords: mail, news, MIME, multimedia, definition
;;;
;;; This file is part of tm (Tools for MIME).
;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
(require 'emu)
(require 'tl-822)
)
+;;; @ charset and encoding
+;;;
+
+(defun mime/find-charset (lcl)
+ (if lcl
+ (or (cdr (some-element
+ (function
+ (lambda (elt)
+ (subsetp lcl (car elt))
+ ))
+ mime/lc-charset-alist)
+ )
+ mime/unknown-charset)
+ ))
+
+(defun mime/find-charset-region (beg end)
+ (mime/find-charset (cons lc-ascii (find-charset-region beg end)))
+ )
+
+(defvar mime/charset-default-encoding-alist
+ '(("US-ASCII" . nil)
+ ("ISO-8859-1" . "quoted-printable")
+ ("ISO-8859-2" . "quoted-printable")
+ ("ISO-8859-3" . "quoted-printable")
+ ("ISO-8859-4" . "quoted-printable")
+;;; ("ISO-8859-5" . "quoted-printable")
+ ("KOI8-R" . "quoted-printable")
+ ("ISO-8859-7" . "quoted-printable")
+ ("ISO-8859-8" . "quoted-printable")
+ ("ISO-8859-9" . "quoted-printable")
+ ("ISO-2022-JP" . nil)
+ ("ISO-2022-KR" . nil)
+ ("EUC-KR" . nil)
+ ("ISO-2022-JP-2" . nil)
+ ("ISO-2022-INT-1" . nil)
+ ))
+
+
;;; @ button
;;;
;;;
(provide 'tm-def)
+
+;;; tm-def.el ends here
;;;
;;; tm-edit.el --- Simple MIME Composer for GNU Emacs
;;;
-
-;; Copyright (C) 1993 UMEDA Masanobu
-;; Copyright (C) 1994,1995 MORIOKA Tomohiko
-
-;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
-;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Revision: 7.38 $
-;; Keywords: mail, news, MIME, multimedia, multilingual
-
-;; This file is not part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Copyright (C) 1993 UMEDA Masanobu
+;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;;
+;;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
+;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Created: 1994/08/21 renamed from mime.el
+;;; Version: $Revision: 7.40 $
+;;; Keywords: mail, news, MIME, multimedia, multilingual
+;;;
+;;; This file is part of tm (Tools for MIME).
+;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
;;; Commentary:
;; definition to load mime/editor-mode automatically:
;;
;; (autoload 'mime/editor-mode "tm-edit"
-;; "Minor mode for editing MIME message." t)
+;; "Minor mode for editing MIME message." t)
;;
;; In case of Mail mode (includes VM mode), you need the following
;; hook definition:
;;
;;--[[audio/basic][base64]]^M...audio encoded in base64 comes here...
-;; LCD Archive Entry:
-;; mime|Masanobu UMEDA|umerin@mse.kyutech.ac.jp|
-;; Simple MIME Composer|
-;; $Date: 1995/12/21 18:27:09 $|$Revision: 7.38 $|~/misc/mime.el.Z|
-
;;; Code:
(require 'sendmail)
;;;
(defconst mime-editor/RCS-ID
- "$Id: tm-edit.el,v 7.38 1995/12/21 18:27:09 morioka Exp $")
+ "$Id: tm-edit.el,v 7.40 1996/01/14 05:52:49 morioka Exp $")
(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
(defvar mime-auto-hide-body t
"*Hide non-textual body encoded in base64 after insertion if non-nil.")
-(defvar mime-body-charset-chooser
- (cond ((boundp 'NEMACS)
- (function mime-body-charset-chooser-for-nemacs))
- ((featurep 'mule)
- (function mime-body-charset-chooser-for-mule))
- ((string-match "^19\\." emacs-version)
- (function mime-body-charset-chooser-for-emacs19))
- (t ;ASCII only emacs
- (function mime-body-charset-chooser-for-emacs18)))
- "*Function to identify charset and encoding of a text in a given region.
-The value is a form of (CHARSET . ENCODING), where ENCODING must be a
-full name, such as base64.")
-
(defvar mime-string-encoder
(cond ((boundp 'NEMACS)
(function mime-string-encoder-for-nemacs))
Hide a non-textual body message encoded in base64 after insertion
if non-nil.
- mime-body-charset-chooser
- Specifies a function to identify charset and encoding of a text in
- a given region. The value is a form of (CHARSET . ENCODING),
- where ENCODING must be a full name, such as base64.
-
mime-string-encoder
Specifies a function to encode a string for given encoding method.
The method is a form of (CHARSET . ENCODING).
(defun mime-editor/insert-text ()
"Insert a text message.
-Charset is automatically obtained from the mime-body-charset-chooser."
+Charset is automatically obtained from the `mime/lc-charset-alist'."
(interactive)
(if (and (mime-editor/insert-tag "text" nil nil)
(looking-at mime-editor/single-part-tag-regexp))
(defun mime-editor/choose-charset ()
"Choose charset of a text following current point."
- (save-excursion
- (let* ((beg (point))
- (end (mime-editor/content-end)))
- (car (funcall mime-body-charset-chooser beg end)))))
-
-(defun mime-editor/choose-encoding ()
- "Choose encoding of a text following current point."
- (save-excursion
- (let* ((beg (point))
- (end (mime-editor/content-end)))
- (cdr (funcall mime-body-charset-chooser beg end)))))
+ (mime/find-charset-region (point) (mime-editor/content-end))
+ )
(defun mime-make-text-tag (&optional subtype)
"Make a tag for a text after current point.
(interactive)
(save-excursion
(let ((boundary
- (concat mime-multipart-boundary " " (current-time-string)))
+ (concat mime-multipart-boundary "_"
+ (replace-space-with-underline (current-time-string))
+ ))
(i 1)
- (time (current-time-string))
ret)
(while (mime-editor/process-multipart-1
- (format "%s %s-%d" mime-multipart-boundary time i))
+ (format "%s-%d" boundary i))
(setq i (1+ i))
)
(save-restriction
(point))))
(setq ret (mime-editor/translate-region
beg end
- (format "%s %s-%d" mime-multipart-boundary time i)))
+ (format "%s-%d" boundary i)))
))
(let ((contype (car ret)) ;Content-Type
(encoding (nth 1 ret)) ;Content-Transfer-Encoding
(defun mime-editor/translate-region (beg end &optional boundary multipart)
(if (null boundary)
(setq boundary
- (concat mime-multipart-boundary " " (current-time-string)))
+ (concat mime-multipart-boundary "_"
+ (replace-space-with-underline (current-time-string))))
)
(save-excursion
(save-restriction
;; Point is now on current tag.
;; Define encoding and encode text if necessary.
(if (null encoding) ;Encoding is not specified.
- (let* ((encoding (mime-editor/choose-encoding))
+ (let* ((encoding
+ (cdr
+ (assoc charset mime/charset-default-encoding-alist)
+ ))
(beg (mime-editor/content-beginning))
(end (mime-editor/content-end))
(body (buffer-substring beg end))
;; Emacs 18 implementations
-(defun mime-body-charset-chooser-for-emacs18 (begin end)
- "Return a cons of charset and encoding of a message in a given region.
-Encoding name must be a canonical name, such as `base64'."
- '("US-ASCII" . nil) ;Default charset of MIME.
- )
-
(defun mime-string-encoder-for-emacs18 (method string)
"For given METHOD that is a cons of charset and encoding, encode a STRING."
(let ((charset (car method))
\f
;; Emacs 19 implementations
-(defun mime-body-charset-chooser-for-emacs19 (begin end)
- "Return a cons of charset and encoding of a message in a given region.
-Encoding name must be a canonical name, such as `base64'.
-US-ASCII and ISO-8859-1 are supported on Emacs 19."
- (cond ((save-excursion
- (goto-char begin)
- (re-search-forward "[\200-\377]" end t))
- '("ISO-8859-1" . "quoted-printable"))
- (t
- '("US-ASCII" . nil)) ;Default charset of MIME.
- ))
-
(defun mime-string-encoder-for-emacs19 (method string)
"For given METHOD that is a cons of charset and encoding, encode a STRING."
(let ((charset (car method))
\f
;; NEmacs implementations
-(defun mime-body-charset-chooser-for-nemacs (begin end)
- "Return a cons of charset and encoding of a message in a given region.
-Encoding name must be a canonical name, such as `base64'.
-US-ASCII and ISO-2022-JP are supported on NEmacs."
- (cond ((check-region-kanji-code begin end)
- ;; The following are safe encoding methods for use in
- ;; USENET News systems that strip off all ESCs.
- ;; '("ISO-2022-JP" . "quoted-printable")
- ;; '("ISO-2022-JP" . "base64")
- ;; The following expects transport systems are all MIME
- ;; compliants. For instance, ESCs are never stripped off.
- '("ISO-2022-JP" . nil))
- (t
- '("US-ASCII" . nil)) ;Default charset of MIME.
- ))
-
(defun mime-string-encoder-for-nemacs (method string)
"For given METHOD that is a cons of charset and encoding, encode a STRING.
US-ASCII and ISO-2022-JP are supported on NEmacs."
;; Thanks to contributions by wkenji@flab.fujitsu.co.jp (Kenji
;; WAKAMIYA) and handa@etl.go.jp (Kenichi Handa).
-(defun mime-body-charset-chooser-for-mule (begin end)
- "Return a cons of charset and encoding of a message in a given
-region. Encoding name must be a canonical name, such as `base64'.
-US-ASCII, ISO-8859-* (except for ISO-8859-6), ISO-2022-JP,
-ISO-2022-JP-2 and ISO-2022-INT-1 are supported on Mule. Either of
-charset ISO-2022-JP-2 or ISO-2022-INT-1 is used for multilingual text
-in Mule."
- (let ((lclist (find-charset-region begin end)))
- (cond ((null lclist)
- '("US-ASCII" . nil)) ;Default charset of MIME.
- ;; Multilingual capability requred.
- ((and (> (length lclist) 1)
- (boundp '*iso-2022-int-1*))
- '("ISO-2022-INT-1" . nil))
- ((> (length lclist) 1)
- '("ISO-2022-JP-2" . nil))
- ;; Simple charset.
- ((memq lc-ltn1 lclist)
- '("ISO-8859-1" . "quoted-printable"))
- ((memq lc-ltn2 lclist)
- '("ISO-8859-2" . "quoted-printable"))
- ((memq lc-ltn3 lclist)
- '("ISO-8859-3" . "quoted-printable"))
- ((memq lc-ltn4 lclist)
- '("ISO-8859-4" . "quoted-printable"))
- ((memq lc-crl lclist)
- '("ISO-8859-5" . "quoted-printable"))
- ;;((memq lc-arb lclist)
- ;; '("ISO-8859-6" . "quoted-printable"))
- ((memq lc-grk lclist)
- '("ISO-8859-7" . "quoted-printable"))
- ((memq lc-hbw lclist)
- '("ISO-8859-8" . "quoted-printable"))
- ((memq lc-ltn5 lclist)
- '("ISO-8859-9" . "quoted-printable"))
- ((memq lc-jp lclist)
- '("ISO-2022-JP" . nil))
- ((memq lc-kr lclist)
- '("ISO-2022-KR" . nil))
- ;; Unknown charset.
- ((boundp '*iso-2022-int-1*)
- '("ISO-2022-INT-1" . nil))
- (t
- '("ISO-2022-JP-2" . nil))
- )))
-
(defun mime-string-encoder-for-mule (method string)
"For given METHOD that is a cons of charset and encoding, encode a
STRING. US-ASCII, ISO-8859-* (except for ISO-8859-6), ISO-2022-JP,
;;;
-;;; tm-ew-d.el --- RFC 1522 based multilingual MIME message header
+;;; tm-ew-e.el --- RFC 1522 based multilingual MIME message header
;;; encoder for GNU Emacs
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1993,1994,1995 MORIOKA Tomohiko
+;;; Copyright (C) 1993 .. 1996 MORIOKA Tomohiko
;;;
-;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Version: $Revision: 7.12 $
;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word
;;;
+;;; This file is part of tm (Tools for MIME).
+;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
(require 'mel)
(require 'tl-822)
;;;
(defconst tm-ew-e/RCS-ID
- "$Id: tm-ew-e.el,v 7.6 1995/12/01 13:03:44 morioka Exp $")
-(defconst mime/eword-encoder-version (get-version-string tm-ew-e/RCS-ID))
+ "$Id: tm-ew-e.el,v 7.12 1996/01/11 18:31:43 morioka Exp $")
+(defconst mime-eword/encoder-version (get-version-string tm-ew-e/RCS-ID))
;;; @ variables
(defvar mime/use-X-Nsubject nil)
+(defvar mime-eword/charset-encoding-alist
+ '(("US-ASCII" . nil)
+ ("ISO-8859-1" . "Q")
+ ("ISO-8859-2" . "Q")
+ ("ISO-8859-3" . "Q")
+ ("ISO-8859-4" . "Q")
+;;; ("ISO-8859-5" . "Q")
+ ("KOI8-R" . "Q")
+ ("ISO-8859-7" . "Q")
+ ("ISO-8859-8" . "Q")
+ ("ISO-8859-9" . "Q")
+ ("ISO-2022-JP" . "B")
+ ("ISO-2022-KR" . "B")
+ ("EUC-KR" . "B")
+ ("ISO-2022-JP-2" . "B")
+ ("ISO-2022-INT-1" . "B")
+ ))
+
;;; @ encoded-text encoder
;;;
;;; @ rule
;;;
-(defun mime/find-charset-rule (lcl)
+(defun tm-eword::find-charset-rule (lcl)
(if lcl
- (let ((ret (some-element
- (function
- (lambda (elt)
- (subsetp lcl (car elt))
- ))
- mime/lc-charset-rule-list)
- ))
- (if ret
- (cdr ret)
- mime/unknown-charset-rule)
- )
- '(nil nil)
- ))
+ (let* ((charset (mime/find-charset lcl))
+ (encoding
+ (cdr (assoc charset mime-eword/charset-encoding-alist))
+ ))
+ (list charset encoding)
+ )))
(defun tm-eword::words-to-ruled-words (wl)
(mapcar (function
(lambda (word)
- (cons (cdr word) (mime/find-charset-rule (car word)))
+ (cons (cdr word) (tm-eword::find-charset-rule (car word)))
))
wl))
(setq dest
(append dest
(list
- (cons str (mime/find-charset-rule
+ (cons str (tm-eword::find-charset-rule
(find-charset-string str)))
)))
)
;;;
(provide 'tm-ew-e)
+
+;;; tm-ew-e.el ends here
;;; tm-mule.el --- tm definitions depended on Mule
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-mule.el,v 7.1 1995/10/03 04:49:53 morioka Exp $
+;;; $Id: tm-mule.el,v 7.6 1996/01/11 05:09:28 morioka Exp $
;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
(require 'emu)
(require 'tl-list)
))
-;;; @ charset and encoding
+;;; @ leading-character and charset
;;;
-(defvar mime/lc-charset-rule-list
+(defvar mime/lc-charset-alist
(list
- (list (list lc-ascii) "US-ASCII" nil)
- (list (list lc-ascii lc-ltn1) "ISO-8859-1" "Q")
- (list (list lc-ascii lc-ltn2) "ISO-8859-2" "Q")
- (list (list lc-ascii lc-ltn3) "ISO-8859-3" "Q")
- (list (list lc-ascii lc-ltn4) "ISO-8859-4" "Q")
-;;;(list (list lc-ascii lc-crl) "ISO-8859-5" "Q")
- (list (list lc-ascii lc-crl) "KOI8-R" "Q")
- (list (list lc-ascii lc-grk) "ISO-8859-7" "Q")
- (list (list lc-ascii lc-hbw) "ISO-8859-8" "Q")
- (list (list lc-ascii lc-ltn5) "ISO-8859-9" "Q")
- (list (list lc-ascii lc-jp) "ISO-2022-JP" "B")
- (list (list lc-ascii lc-kr) "EUC-KR" "B")
- (list (list lc-ascii
+ (cons (list lc-ascii) "US-ASCII")
+ (cons (list lc-ascii lc-ltn1) "ISO-8859-1")
+ (cons (list lc-ascii lc-ltn2) "ISO-8859-2")
+ (cons (list lc-ascii lc-ltn3) "ISO-8859-3")
+ (cons (list lc-ascii lc-ltn4) "ISO-8859-4")
+;;;(cons (list lc-ascii lc-crl) "ISO-8859-5")
+ (cons (list lc-ascii lc-crl) "KOI8-R")
+ (cons (list lc-ascii lc-grk) "ISO-8859-7")
+ (cons (list lc-ascii lc-hbw) "ISO-8859-8")
+ (cons (list lc-ascii lc-ltn5) "ISO-8859-9")
+ (cons (list lc-ascii lc-jp) "ISO-2022-JP")
+ (cons (list lc-ascii lc-kr) "EUC-KR")
+ (cons (list lc-ascii
lc-jp lc-cn
lc-kr lc-jp2
- lc-ltn1 lc-grk) "ISO-2022-JP-2" "B")
- (list (list lc-ascii
+ lc-ltn1 lc-grk) "ISO-2022-JP-2")
+ (cons (list lc-ascii
lc-jp lc-cn
lc-kr lc-jp2
lc-cns1 lc-cns2
- lc-ltn1 lc-grk) "ISO-2022-INT-1" "B")
- ))
-
-(defvar mime/unknown-charset-rule '("ISO-2022-INT-1" "B"))
-
-
-;;; @ (obsoleted)
-;;;
-
-(defvar mime/lc-charset-and-encoding-alist
- (list
- (cons lc-ascii nil)
- (cons lc-jp '("ISO-2022-JP" . "B"))
- (cons lc-cn '("ISO-2022-CN" . "B"))
- (cons lc-kr '("EUC-KR" . "B"))
- (cons lc-ltn1 '("ISO-8859-1" . "Q"))
- (cons lc-ltn2 '("ISO-8859-2" . "Q"))
- (cons lc-ltn3 '("ISO-8859-3" . "Q"))
- (cons lc-ltn4 '("ISO-8859-4" . "Q"))
- (cons lc-crl '("ISO-8859-5" . "B"))
-;;;(cons lc-arb '("ISO-8859-6" . "B"))
- (cons lc-grk '("ISO-8859-7" . "B"))
- (cons lc-hbw '("ISO-8859-8" . "B"))
- (cons lc-ltn5 '("ISO-8859-9" . "Q"))
+ lc-ltn1 lc-grk) "ISO-2022-INT-1")
))
-(defvar mime/latin-lc-list
- (list lc-ascii lc-ltn1 lc-ltn2 lc-ltn3 lc-ltn4 lc-ltn5))
-
-(defvar mime/charset-lc-alist
- (list
- (cons "ISO-8859-1" lc-ltn1) ; Latin-1
- (cons "ISO-8859-2" lc-ltn2) ; Latin-2
- (cons "ISO-8859-3" lc-ltn3) ; Latin-3
- (cons "ISO-8859-4" lc-ltn4) ; Latin-4
- (cons "ISO-8859-5" lc-crl ) ; Cyrillic
-;;;(cons "ISO-8859-6" lc-arb ) ; Arabic
- (cons "ISO-8859-7" lc-grk ) ; Greek
- (cons "ISO-8859-8" lc-hbw ) ; Hebrew
- (cons "ISO-8859-9" lc-ltn5) ; Latin-5
- ))
-
-(defun mime/set-charset-and-encoding (lc cs charset encoding)
- (setq mime/lc-charset-and-encoding-alist
- (put-alist lc (cons charset encoding)
- mime/lc-charset-and-encoding-alist))
- (if cs
- (setq mime/charset-coding-system-alist
- (put-alist charset cs mime/charset-coding-system-alist))
- (setq mime/charset-lc-alist
- (put-alist charset lc mime/charset-lc-alist))
- ))
-;;; example
-;;;
-;;; (mime/set-charset-and-encoding lc-kr *euc-kr* "EUC-KR" "B")
-;;; (mime/set-charset-and-encoding lc-koi8 nil "KOI8" "B")
-
-
-(defun mime/remove-leading-character (str)
- (let ((dest "") (i 0) (len (length str)) chr)
- (while (< i len)
- (setq chr (elt str i))
- (if (< chr 128)
- (progn
- (setq dest (concat dest (char-to-string chr)))
- (setq i (+ i 1))
- )
- (progn
- (setq dest (concat dest (char-to-string (elt str (+ i 1)))))
- (setq i (+ i 2))
- ))
- )
- dest))
-
-(defun mime/insert-leading-character (str lc)
- (let ((lc-str (char-to-string lc))
- (dest "")
- (i 0) (len (length str))
- chr chr-str)
- (while (< i len)
- (setq chr (elt str i))
- (setq chr-str (char-to-string chr))
- (setq dest (concat dest
- (if (< chr 128)
- chr-str
- (concat lc-str chr-str)
- )))
- (setq i (+ i 1))
- )
- dest))
+(defvar mime/unknown-charset "ISO-2022-INT-1")
;;; @ functions
(defun mime/convert-string-to-emacs (charset str)
(let ((cs (cdr (assoc charset mime/charset-coding-system-alist))))
- (cond (cs
- (code-convert-string str cs *internal*)
- )
- (t
- (let ((lc (cdr (assoc charset mime/charset-lc-alist))))
- (if lc
- (mime/insert-leading-character str lc)
- )
- )))))
+ (if cs
+ (code-convert-string str cs *internal*)
+ )))
(defun mime/convert-string-from-emacs (str charset)
(let ((cs (cdr (assoc charset mime/charset-coding-system-alist))))
- (cond (cs
- (code-convert-string str *internal* cs)
- )
- (t
- (if (assoc charset mime/charset-lc-alist)
- (mime/remove-leading-character str)
- str)))))
-
+ (if cs
+ (code-convert-string str *internal* cs)
+ )))
(defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
(if (stringp charset)
(provide 'tm-mule)
(run-hooks 'tm-mule-load-hook)
+
+;;; tm-mule.el ends here
;;; tm-nemacs.el --- tm definitions depended on NEmacs
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-nemacs.el,v 7.2 1995/12/06 08:04:50 morioka Exp $
+;;; $Id: tm-nemacs.el,v 7.6 1996/01/11 05:12:50 morioka Exp $
;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
(require 'emu)
(defvar mime/default-coding-system *junet*)
-(defvar mime/lc-charset-rule-list
+(defvar mime/lc-charset-alist
(list
- (list (list lc-ascii) "US-ASCII" nil)
- (list (list lc-ascii lc-jp) "ISO-2022-JP" "B")
+ (cons (list lc-ascii) "US-ASCII")
+ (cons (list lc-ascii lc-jp) "ISO-2022-JP")
))
-
-;;; @@ (obsolete)
-;;;
-
-(defvar mime/lc-charset-and-encoding-alist
- (list (cons lc-ascii nil)
- (cons lc-jp '("ISO-2022-JP" . "B"))
- ))
-
-(defvar mime/latin-lc-list (list lc-ascii))
+(defvar mime/unknown-charset "ISO-2022-JP")
;;; @ functions
(provide 'tm-nemacs)
(run-hooks 'tm-nemacs-load-hook)
+
+;;; tm-nemacs.el ends here
;;; tm-orig.el --- tm definitions depended on FSF Original Emacs
;;;
;;; Copyright (C) 1995 Free Software Foundation, Inc.
-;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
+;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-orig.el,v 7.1 1995/10/03 04:52:16 morioka Exp $
+;;; $Id: tm-orig.el,v 7.6 1996/01/11 05:15:05 morioka Exp $
;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;;
+;;; 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. If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
(require 'emu)
(defvar mime/default-coding-system nil)
-(defvar mime/lc-charset-rule-list
+(defvar mime/lc-charset-alist
(list
- (list (list lc-ascii) "US-ASCII" nil)
- (list (list lc-ascii lc-ltn1) "ISO-8859-1" "Q")
+ (cons (list lc-ascii) "US-ASCII")
+ (cons (list lc-ascii lc-ltn1) "ISO-8859-1")
))
-(defvar mime/decoding-charset-list '("US-ASCII" "ISO-8859-1"))
-
-
-;;; @@ (obsolete)
-;;;
-
-(defvar mime/lc-charset-and-encoding-alist
- (list (cons lc-ascii nil)
- (cons lc-ltn1 '("ISO-8859-1" . "Q"))
- ))
-
-(defvar mime/latin-lc-list (list lc-ascii lc-ltn1))
+(defvar mime/unknown-charset "ISO-8859-1")
;;; @ functions
(provide 'tm-orig)
(run-hooks 'tm-orig-load-hook)
+
+;;; tm-orig.el ends here