From d08665e7a6b365c8605933c756812403c1a504f2 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 2 Mar 1998 15:06:59 +0000 Subject: [PATCH] tm 6.58 --- Makefile | 16 ++--- gnus/tm-dgnus.el | 14 ++++- mh-e/code-jp.ol | 57 ++++++++++++++++++ mh-e/tm-mh-e.el | 5 +- mh-e/tm-mh-e3.el | 10 +++- tm-view.el | 171 ++++++++++++++++++++++++++++-------------------------- 6 files changed, 180 insertions(+), 93 deletions(-) create mode 100644 mh-e/code-jp.ol diff --git a/Makefile b/Makefile index 2534416..8e784e5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 6.11 1995/06/17 18:54:23 morioka Exp morioka $ +# $Id: Makefile,v 6.12 1995/06/22 05:00:00 morioka Exp morioka $ # # Please specify emacs executables: @@ -42,18 +42,18 @@ RM = /bin/rm -f CP = /bin/cp -p UTILS = ol2 decode-b -GOMI = $(UTILS) *.elc .lpath.el +GOMI = $(UTILS) *.elc loadpath FILES = tm/README.eng tm/rel-*.ol \ tm/Makefile tm/Makefile.bc tm/make-lpath tm/inst-el tm/inst-elc \ tm/*.el tm/*.c tm/methods \ tm/doc/Makefile tm/doc/*.pln tm/doc/*.ol tm/doc/*.tex tm/doc/*.texi \ tm/gnus/Makefile tm/gnus/*-path tm/gnus/mk-tgnus tm/gnus/*.el \ - tm/mh-e/Makefile tm/mh-e/Makefile.bc code-jp.ol tm/mh-e/*.el \ - tl/README.eng \ - tl/Makefile tl/Makefile.bc tl/loadpath \ - tl/*.el tl/doc/*.texi + tm/mh-e/Makefile tm/mh-e/Makefile.bc tm/mh-e/code-jp.ol tm/mh-e/*.el +# tl/README.eng \ +# tl/Makefile tl/Makefile.bc tl/loadpath \ +# tl/*.el tl/doc/*.texi -TARFILE = tm6.54.tar +TARFILE = tm6.58.tar lpath-nemacs: @@ -99,6 +99,7 @@ lpath-orig19: orig19: lpath-orig19 make -f Makefile.bc all EMACS=$(ORIG19) EMACS_TYPE=orig cd gnus; PWD=`pwd` make gnus4 EMACS=$(ORIG19) +# cd gnus; PWD=`pwd` make dgnus EMACS=$(ORIG19) cd mh-e; PWD=`pwd` make orig19 ORIG19=$(ORIG19) orig19-vm: lpath-nemacs @@ -114,6 +115,7 @@ lpath-mule2: mule2: lpath-mule2 make -f Makefile.bc all EMACS=$(MULE2) EMACS_TYPE=mule cd gnus; PWD=`pwd` make gnus4 EMACS=$(MULE2) +# cd gnus; PWD=`pwd` make dgnus EMACS=$(MULE2) cd mh-e; PWD=`pwd` make mule2 MULE2=$(MULE2) mule2-vm: lpath-nemacs diff --git a/gnus/tm-dgnus.el b/gnus/tm-dgnus.el index e42a3e6..defa71e 100644 --- a/gnus/tm-dgnus.el +++ b/gnus/tm-dgnus.el @@ -5,7 +5,7 @@ ;;; @ version ;;; (defconst tm-gnus/RCS-ID - "$Id: tm-dgnus.el,v 6.4 1995/06/18 16:12:05 morioka Exp $") + "$Id: tm-dgnus.el,v 6.5 1995/06/22 05:34:56 morioka Exp $") (defconst tm-gnus/version (concat (get-version-string tm-gnus/RCS-ID) " (ding)")) @@ -224,6 +224,18 @@ With arg, turn MIME processing on if arg is positive." ) +;;; @ etc +;;; + +(add-hook 'gnus-exit-gnus-hook + (function + (lambda () + (let ((buf (get-buffer tm-gnus/preview-buffer))) + (if buf + (kill-buffer buf) + ))))) + + ;;; @ end ;;; diff --git a/mh-e/code-jp.ol b/mh-e/code-jp.ol new file mode 100644 index 0000000..75134e8 --- /dev/null +++ b/mh-e/code-jp.ol @@ -0,0 +1,57 @@ +『tm-mh-e で ISO-2022-JP 以外の文字 code を使う方法』 +by 守岡 知彦 + + MTA で ISO-2022-JP を EUC-JP や Shift-JIS などに code 変換している場 +合、tm-mh-e の default の設定では文字化けします。こうしたことを行なう +ことはあまり勧められたことではないと思いますが、ここではこうした環境で +tm-mh-e を使う場合の設定について説明します。 + + +* Mule の場合 + + tm-mh-e の標準設定では、charset parameter が存在する場合はそれで指定 +された文字 code になり、charset parameter が存在しない場合(非 MIME +message を含む)の場合の文字 code は *ctext* となります。 + + charset が存在しない場合の文字 code は変数 +mime/default-coding-system で指定されます。この既定値が *ctext* であり、 +ISO-8859-1 か ISO-2022-JP などの JUNET 方式の ISO-2022 code であること +を期待しています。 + + charset が存在する場合は、変数 mime/charset-coding-system-alist に設 +定された、その charset に対応する Mule の coding-system が用いられます。 + + これらの動作は関数 tm-mh-e/code-convert-region-to-emacs で行なわれま +す。よって、これらの変数および関数を変更することによって MTA で code +変換された場合の対策を行なうことができます。 + + +** 非 MIME message または charset が存在しない場合のみの対策 + + 非 MIME message の場合、変数 mime/default-coding-system に文字 code +を設定すれば OK です。Shift-JIS の場合は + + (setq mime/default-coding-system *sjis*) + +EUC-JP の場合は、 + + (setq mime/default-coding-system *euc-japan*) + +として下さい。 + + +** charset が存在する場合も含めた対策 + + charset が存在する場合、変数 mime/charset-coding-system-alist に +"ISO-2022-JP" に対応する coding-system を *sjis* や *euc-japan* に変え +るというのが1つの方法です。但し、この場合、encode されて元の文字 code +が保存されている場合に文字化けすることになります。 + + このことを考慮すると、関数 tm-mh-e/code-convert-region-to-emacs を再 +定義するのが良いといえます。おそらく、ISO-2022-JP 以外の文字 code は保 +存されないでしょうから、以下のような定義で十分でしょう。 + + (defun tm-mh-e/code-convert-region-to-emacs + (beg end charset &optional encoding) + (code-convert beg end *sjis* *internal*) + ) diff --git a/mh-e/tm-mh-e.el b/mh-e/tm-mh-e.el index 5d14bfc..3a4b886 100644 --- a/mh-e/tm-mh-e.el +++ b/mh-e/tm-mh-e.el @@ -21,7 +21,7 @@ ;;; @ version ;;; (defconst tm-mh-e/RCS-ID - "$Id: tm-mh-e.el,v 6.18 1995/06/20 21:07:39 morioka Exp $") + "$Id: tm-mh-e.el,v 6.20 1995/06/22 04:58:44 morioka Exp $") (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) @@ -168,7 +168,8 @@ With arg, turn MIME processing on if arg is positive." mime::article/preview-buffer)) (if (looking-at "^\\[.+\\]\n") (replace-match "")) - (run-hooks 'mail-citation-hook) + (narrow-to-region (point)(point-max)) + (mh-insert-prefix-string mh-ins-buf-prefix) )) (mh-yank-cur-msg) )) diff --git a/mh-e/tm-mh-e3.el b/mh-e/tm-mh-e3.el index d4f65a7..f534cb7 100644 --- a/mh-e/tm-mh-e3.el +++ b/mh-e/tm-mh-e3.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tm-mh-e3.el,v 4.0 1995/06/18 16:26:37 morioka Exp $ +;;; $Id: tm-mh-e3.el,v 5.0 1995/06/22 03:36:07 morioka Exp $ ;;; ;;; This is a part of tm-mh-e.el which is a module for old mh-e ;;; to emulate mh-e 4.*. @@ -9,6 +9,14 @@ (require 'mh-e) + +(defvar mail-citation-hook nil + "*Hook for modifying a citation just inserted in the mail buffer. +Each hook function can find the citation between point and mark. +And each hook function should leave point and mark around the citation +text as modified.") + + ;;; Ensure new buffers won't get this mode if default-major-mode is nil. (put 'mh-show-mode 'mode-class 'special) diff --git a/tm-view.el b/tm-view.el index b1a33a3..4110f29 100644 --- a/tm-view.el +++ b/tm-view.el @@ -22,7 +22,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 6.54 1995/06/13 22:31:38 morioka Exp $") + "$Id: tm-view.el,v 6.58 1995/06/22 04:11:58 morioka Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -160,17 +160,30 @@ ctype mime-viewer/content-subject-omitting-Content-Type-list)) (insert - (format "[%s %s (%s)]\n" - (or (assoc-value "x-part-number" params) - (if (listp cnum) - (mapconcat (function - (lambda (num) - (format "%s" (+ num 1)) - )) - cnum ".") - "0")) - subj ctype)) - )) + (let ((access-type (assoc "access-type" params)) + (num (or (assoc-value "x-part-number" params) + (if (listp cnum) + (mapconcat (function + (lambda (num) + (format "%s" (+ num 1)) + )) + cnum ".") + "0")) + )) + (if access-type + (let ((server (assoc "server" params))) + (setq access-type (cdr access-type)) + (if server + (format "[%s %s ([%s] %s)]\n" num subj + access-type (cdr server)) + (let ((site (assoc-value "site" params)) + (dir (assoc-value "directory" params)) + ) + (format "[%s %s ([%s] %s:%s)]\n" num subj + access-type site dir) + ))) + (format "[%s %s (%s)]\n" num subj ctype) + ))))) (defvar mime-viewer/content-subject-function (function mime-viewer/default-content-subject-function)) @@ -485,9 +498,9 @@ it is regarded as current-buffer. [tm-view]" (or (message/get-field-body "Content-Description") (message/get-field-body "Subject") - )) - "")) - ))) + ))) + "")) + )) (defun mime-viewer/get-name (param) (let ((str (mime-viewer/get-subject param))) @@ -517,20 +530,18 @@ it is regarded as current-buffer. [tm-view]" (setq obuf (concat "*Preview-" (buffer-name buf) "*")) ) (setq pcl (mime::make-flat-content-list cinfo)) - (save-window-excursion - (let ((bf (get-buffer obuf))) - (switch-to-buffer obuf) - (setq buffer-read-only nil) - (if bf - (erase-buffer) - )) - (make-variable-buffer-local 'mime::preview/article-buffer) - (setq mime::preview/article-buffer the-buf) - (make-variable-buffer-local 'mime::preview/original-major-mode) - (setq mime::preview/original-major-mode mode) - (setq major-mode 'mime/viewer-mode) - (setq mode-name "MIME-View") - ) + (let ((bf (get-buffer obuf))) + (switch-to-buffer obuf) + (setq buffer-read-only nil) + (if bf + (erase-buffer) + )) + (make-variable-buffer-local 'mime::preview/article-buffer) + (setq mime::preview/article-buffer the-buf) + (make-variable-buffer-local 'mime::preview/original-major-mode) + (setq mime::preview/original-major-mode mode) + (setq major-mode 'mime/viewer-mode) + (setq mode-name "MIME-View") (setq dest (mapcar (function @@ -541,74 +552,70 @@ it is regarded as current-buffer. [tm-view]" (params (mime::content-info/parameters cell)) he cnum e nb ne subj str) (setq cnum (mime::get-point-content-number beg cinfo)) + (switch-to-buffer the-buf) (setq he (save-excursion (goto-char beg) (re-search-forward "^$" nil t) (+ (match-end 0) 1) )) - (save-window-excursion - (switch-to-buffer obuf) - (setq nb (point)) - (narrow-to-region nb nb) - ) + (switch-to-buffer obuf) + (setq nb (point)) + (narrow-to-region nb nb) + (switch-to-buffer the-buf) (if (mime-viewer/header-visible-p cnum cinfo ctype) (progn (setq str (buffer-substring beg he)) - (save-window-excursion - (switch-to-buffer obuf) - (insert str) - (let ((f (assq - mode - mime-viewer/content-header-filter-alist)) - ) - (if (and f (setq f (cdr f))) - (funcall f) - (mime-viewer/default-content-header-filter) + (switch-to-buffer obuf) + (insert str) + (let ((f (assq + mode + mime-viewer/content-header-filter-alist)) ) - )))) + (if (and f (setq f (cdr f))) + (funcall f) + (mime-viewer/default-content-header-filter) + )) + (switch-to-buffer the-buf) + )) (if (mime-viewer/body-visible-p cnum cinfo ctype) (let (be) (setq str (buffer-substring he end)) - (save-window-excursion - (switch-to-buffer obuf) - (save-restriction - (setq be (point-max)) - (narrow-to-region be be) - (insert str) - (setq ne (point-max)) - (let ((f (or (assoc-value - ctype - mime-viewer/content-filter-alist) - ))) - (if (and f (fboundp f)) - (funcall f ctype params encoding) - (mime-viewer/default-content-filter - cnum cinfo ctype params subj) - )) - (setq ne (point-max)) - )))) - (save-window-excursion - (switch-to-buffer obuf) - (mime-viewer/default-content-separator - cnum cinfo ctype params subj) - ) - (save-window-excursion - (switch-to-buffer obuf) - (prog1 - (progn - (setq subj (mime-viewer/get-subject params)) - (goto-char nb) - (funcall mime-viewer/content-subject-function - cnum cinfo ctype params subj) + (switch-to-buffer obuf) + (save-restriction + (setq be (point-max)) + (narrow-to-region be be) + (insert str) + (setq ne (point-max)) + (let ((f (or (assoc-value + ctype + mime-viewer/content-filter-alist) + ))) + (if (and f (fboundp f)) + (funcall f ctype params encoding) + (mime-viewer/default-content-filter + cnum cinfo ctype params subj) + )) (setq ne (point-max)) - (widen) - (mime::preview-content-info/create nb (- ne 1) - buf cell) ) - (goto-char ne) - ))))) + (switch-to-buffer the-buf) + )) + (switch-to-buffer obuf) + (mime-viewer/default-content-separator + cnum cinfo ctype params subj) + (prog1 + (progn + (setq subj (mime-viewer/get-subject params)) + (goto-char nb) + (funcall mime-viewer/content-subject-function + cnum cinfo ctype params subj) + (setq ne (point-max)) + (widen) + (mime::preview-content-info/create nb (- ne 1) + buf cell) + ) + (goto-char ne) + )))) pcl)) - (switch-to-buffer obuf) (set-buffer-modified-p nil) (setq buffer-read-only t) (switch-to-buffer the-buf) -- 1.7.10.4