From: morioka Date: Mon, 9 Mar 1998 11:09:02 +0000 (+0000) Subject: tm 7.16. X-Git-Tag: tm7_16~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=62389038dae127500284c246321a512a5be87273;p=elisp%2Ftm.git tm 7.16. --- diff --git a/Changes-7.16.en b/Changes-7.16.en new file mode 100644 index 0000000..0d893f9 --- /dev/null +++ b/Changes-7.16.en @@ -0,0 +1,145 @@ +* tm + +tm/mime-setup.el +---------------------------- +revision 7.4 +date: 1995/10/17 16:20:39; author: morioka; state: Exp; lines: +4 -1 +In variable `mime-file-types', setting for *.diff. +---------------------------- + +tm/tm-ew-d.el +---------------------------- +revision 7.5 +date: 1995/10/18 11:18:03; author: morioka; state: Exp; lines: +2 -1 +Function `mime-eword/decode-string' unfolds string. +---------------------------- +revision 7.4 +date: 1995/10/17 16:45:27; author: morioka; state: Exp; lines: +4 -4 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string', function +`mime/decode-encoded-words-region' was renamed to +`mime-eword/decode-region'. +---------------------------- +revision 7.3 +date: 1995/10/17 16:39:47; author: morioka; state: Exp; lines: +8 -2 +Version constant `mime/eword-decoder-version' was defined. +---------------------------- + +tm/tm-ew-e.el +---------------------------- +revision 7.4 +date: 1995/10/18 08:54:59; author: morioka; state: Exp; lines: +6 -1 +Function `mime-eword/encode-string' was created. +---------------------------- +revision 7.3 +date: 1995/10/17 16:37:25; author: morioka; state: Exp; lines: +9 -3 +Version constant `mime/eword-encoder-version' was defined. +---------------------------- +revision 7.2 +date: 1995/10/17 16:32:15; author: morioka; state: Exp; lines: +94 -1 +Public functions about encoded-word encoder were moved from +tm-eword.el. +---------------------------- + +tm/tm-eword.el +---------------------------- +revision 7.9 +date: 1995/10/18 08:55:37; author: morioka; state: Exp; lines: +8 -6 +Function `mime-eword/encode-string' was defined. +---------------------------- +revision 7.8 +date: 1995/10/17 16:46:33; author: morioka; state: Exp; lines: +3 -3 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string', function +`mime/decode-encoded-words-region' was renamed to +`mime-eword/decode-region'. +---------------------------- +revision 7.7 +date: 1995/10/17 16:33:57; author: morioka; state: Exp; lines: +1 -3 +tm-eword-load-hook was deleted. +---------------------------- +revision 7.6 +date: 1995/10/17 16:33:26; author: morioka; state: Exp; lines: +2 -10 +version constant was deleted. +---------------------------- +revision 7.5 +date: 1995/10/17 16:31:20; author: morioka; state: Exp; lines: +4 -97 +Functions about encoded-word encoder were moved to tm-ew-e.el. +---------------------------- + +tm/tm-view.el +---------------------------- +revision 7.16 +date: 1995/10/17 16:48:06; author: morioka; state: Exp; lines: +2 -2 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string'. +---------------------------- + +tm/tm-vm.el +---------------------------- +revision 7.1 +date: 1995/10/17 16:49:51; author: morioka; state: Exp; lines: +2 -2 +Comment was modified because function +`mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string'. +---------------------------- + + +tm/mh-e + + Attached version 7.05. + +tm/mh-e/tm-mh-e.el +---------------------------- +revision 7.5 +date: 1995/10/18 09:57:56; author: morioka; state: Exp; lines: +14 -14 +(1) When `,' key is pressed, encoded-words are not decoded. +(2) When `,' key is pressed in automatic MIME preview mode, article + buffer is displayed. +---------------------------- +revision 7.4 +date: 1995/10/18 09:43:43; author: morioka; state: Exp; lines: +18 -6 +(1) New implementation about `.' and `,'. +(2) When `,' key is pressed in automatic MIME preview mode, it displays + preview buffer which has all headers. +---------------------------- + + +tm/gnus + + Attached version 7.04. + +tm/gnus/tm-gnus5.el +---------------------------- +revision 7.3 +date: 1995/10/17 16:52:54; author: morioka; state: Exp; lines: +6 -6 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string'. +---------------------------- + +tm/gnus/tm-ognus.el +---------------------------- +revision 7.1 +date: 1995/10/17 16:56:12; author: morioka; state: Exp; lines: +6 -7 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string'. +---------------------------- + +tm/gnus/tm-sgnus.el +---------------------------- +revision 7.4 +date: 1995/10/18 08:32:36; author: morioka; state: Exp; lines: +39 -8 +(1) alias `mime/decode-encoded-words-string' was defined to indicate + `mime-eword/decode-string'. It is for old nnheader patch. + +(2) Function `tm-gnus/article-hide-headers-if-wanted' is added to + `gnus-article-display-hook' instead of + `gnus-article-hide-headers-if-wanted'. It does not call function + `gnus-article-hide-headers-if-wanted' when automatic MIME preview + mode. +---------------------------- +revision 7.3 +date: 1995/10/17 16:58:05; author: morioka; state: Exp; lines: +4 -4 +Function `mime/decode-encoded-words-string' was renamed to +`mime-eword/decode-string'. +---------------------------- diff --git a/Changes-7.16.ja b/Changes-7.16.ja new file mode 100644 index 0000000..967c03f --- /dev/null +++ b/Changes-7.16.ja @@ -0,0 +1,143 @@ +* tm + +tm/mime-setup.el +---------------------------- +revision 7.4 +date: 1995/10/17 16:20:39; author: morioka; state: Exp; lines: +4 -1 +変数 mime-file-types に *.diff を設定した。 +---------------------------- + +tm/tm-ew-d.el +---------------------------- +revision 7.5 +date: 1995/10/18 11:18:03; author: morioka; state: Exp; lines: +2 -1 +関数 mime-eword/decode-string で unfolding するようにした。 +---------------------------- +revision 7.4 +date: 1995/10/17 16:45:27; author: morioka; state: Exp; lines: +4 -4 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に、 +関数 mime/decode-encoded-words-region を `mime-eword/decode-region' に +改名した。 +---------------------------- +revision 7.3 +date: 1995/10/17 16:39:47; author: morioka; state: Exp; lines: +8 -2 +version 定数 `mime/eword-decoder-version' を定義した。 +---------------------------- + +tm/tm-ew-e.el +---------------------------- +revision 7.4 +date: 1995/10/18 08:54:59; author: morioka; state: Exp; lines: +6 -1 +関数 mime-eword/encode-string を追加した。 +---------------------------- +revision 7.3 +date: 1995/10/17 16:37:25; author: morioka; state: Exp; lines: +9 -3 +version 定数 `mime/eword-encoder-version' を新設した。 +---------------------------- +revision 7.2 +date: 1995/10/17 16:32:15; author: morioka; state: Exp; lines: +94 -1 +encoded-word の encode に関する公開用の関数を tm-eword.el から移した。 +---------------------------- + +tm/tm-eword.el +---------------------------- +revision 7.9 +date: 1995/10/18 08:55:37; author: morioka; state: Exp; lines: +8 -6 +関数 mime-eword/encode-string を追加した。 +---------------------------- +revision 7.8 +date: 1995/10/17 16:46:33; author: morioka; state: Exp; lines: +3 -3 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に、 +関数 mime/decode-encoded-words-region を `mime-eword/decode-region' に +改名した。 +---------------------------- +revision 7.7 +date: 1995/10/17 16:33:57; author: morioka; state: Exp; lines: +1 -3 +tm-eword-load-hook を廃止した。 +---------------------------- +revision 7.6 +date: 1995/10/17 16:33:26; author: morioka; state: Exp; lines: +2 -10 +version 定数を廃止した。 +---------------------------- +revision 7.5 +date: 1995/10/17 16:31:20; author: morioka; state: Exp; lines: +4 -97 +encode 関係の関数を全て tm-ew-e.el に移した。 +---------------------------- + +tm/tm-view.el +---------------------------- +revision 7.16 +date: 1995/10/17 16:48:06; author: morioka; state: Exp; lines: +2 -2 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に +改名した。 +---------------------------- + +tm/tm-vm.el +---------------------------- +revision 7.1 +date: 1995/10/17 16:49:51; author: morioka; state: Exp; lines: +2 -2 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に +改名したことに伴い、comment を修正した。 +---------------------------- + + +tm/mh-e + + Version 7.05 を添付した。 + +tm/mh-e/tm-mh-e.el +---------------------------- +revision 7.5 +date: 1995/10/18 09:57:56; author: morioka; state: Exp; lines: +14 -14 +(1) `,' を押した時、encoded-word は decode しないようにした。 +(2) automatic MIME preview mode の時に `,' を押した場合、article + buffer を表示するようにした。 +---------------------------- +revision 7.4 +date: 1995/10/18 09:43:43; author: morioka; state: Exp; lines: +18 -6 +(1) `.' と `,' を実現する関数を作り直した。 +(2) automatic MIME preview mode において `,' を押した時、header を全部 + 表示した preview buffer を表示するようにした。 +---------------------------- + + +tm/gnus + + Version 7.04 を添付した。 + +tm/gnus/tm-gnus5.el +---------------------------- +revision 7.3 +date: 1995/10/17 16:52:54; author: morioka; state: Exp; lines: +6 -6 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に +改名した。 +---------------------------- + +tm/gnus/tm-ognus.el +---------------------------- +revision 7.1 +date: 1995/10/17 16:56:12; author: morioka; state: Exp; lines: +6 -7 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に +改名した。 +---------------------------- + +tm/gnus/tm-sgnus.el +---------------------------- +revision 7.4 +date: 1995/10/18 08:32:36; author: morioka; state: Exp; lines: +39 -8 +(1) 関数 mime/decode-encoded-words-string が + `mime-eword/decode-string' に改名された事に伴い、古い Gnus 5.0.* + nnheader patch を考慮して、関数 mime-eword/decode-string を + `mime/decode-encoded-words-string' に alias した。 + +(2) gnus-article-display-hook から関数 + gnus-article-hide-headers-if-wanted を取り除き、代わりに、 + automatic MIME preview mode の時以外にのみ + gnus-article-hide-headers-if-wanted を 動かす関数 + tm-gnus/article-hide-headers-if-wanted を設定した。 +---------------------------- +revision 7.3 +date: 1995/10/17 16:58:05; author: morioka; state: Exp; lines: +4 -4 +関数 mime/decode-encoded-words-string を `mime-eword/decode-string' に +改名した。 +---------------------------- diff --git a/Makefile b/Makefile index 8a9d687..373e27e 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ TL_FILES = tl/README.eng tl/Makefile tl/mk-tl tl/*.el tl/doc/*.texi FILES = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES) -TARFILE = tm7.15.tar +TARFILE = tm7.16.tar nemacs: diff --git a/gnus/Makefile b/gnus/Makefile index f69d772..6265993 100644 --- a/gnus/Makefile +++ b/gnus/Makefile @@ -17,7 +17,7 @@ TMDIR19 = $(HOME)/lib/emacs19/lisp FILES = tm/gnus/*.el tm/doc/tm-gnus*.texi -TARFILE = tm-gnus7.02.1.tar +TARFILE = tm-gnus7.04.tar gnus3: diff --git a/gnus/g5-path b/gnus/g5-path index 71dd762..1fba7f4 100644 --- a/gnus/g5-path +++ b/gnus/g5-path @@ -12,6 +12,6 @@ ;; ;; please edit this ;; - '("/usr/local/lib/emacs/site-lisp/gnus-5.0.6/lisp") + '("/usr/local/lib/emacs/site-lisp/gnus-5.0.8/lisp") ;; load-path)) diff --git a/gnus/tm-gnus5.el b/gnus/tm-gnus5.el index 91f070d..5b0cff0 100644 --- a/gnus/tm-gnus5.el +++ b/gnus/tm-gnus5.el @@ -18,16 +18,16 @@ (autoload 'mime/viewer-mode "tm-view" "View MIME message." t) (autoload 'mime/decode-message-header - "tm-ew-d" "Decode MIME encoded-word." t) -(autoload 'mime/decode-encoded-words-string - "tm-ew-d" "Decode MIME encoded-word." t) + "tm-ew-d" "Decode MIME encoded-words in message header." t) +(autoload 'mime-eword/decode-string + "tm-ew-d" "Decode MIME encoded-words in string." t) ;;; @ version ;;; (defconst tm-gnus/RCS-ID - "$Id: tm-gnus5.el,v 7.2 1995/10/05 12:57:53 morioka Exp $") + "$Id: tm-gnus5.el,v 7.3 1995/10/17 16:52:54 morioka Exp $") (defconst tm-gnus/version (concat (get-version-string tm-gnus/RCS-ID) " for GNUS 5")) @@ -117,12 +117,12 @@ article is automatic MIME decoded.") (mail-header-set-from header (if from - (mime/decode-encoded-words-string from) + (mime-eword/decode-string from) "")) (mail-header-set-subject header (if subj - (mime/decode-encoded-words-string subj) + (mime-eword/decode-string subj) "")) )) gnus-newsgroup-headers) diff --git a/gnus/tm-ognus.el b/gnus/tm-ognus.el index 1b7b936..43d848e 100644 --- a/gnus/tm-ognus.el +++ b/gnus/tm-ognus.el @@ -6,7 +6,7 @@ ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: -;;; $Id: tm-ognus.el,v 7.0 1995/10/03 05:08:59 morioka Exp $ +;;; $Id: tm-ognus.el,v 7.1 1995/10/17 16:56:12 morioka Exp $ ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word ;;; ;;; This file is part of tm (Tools for MIME). @@ -16,9 +16,9 @@ (require 'gnus) (autoload 'mime/decode-message-header - "tm-ew-d" "Decode MIME encoded-word." t) -(autoload 'mime/decode-encoded-words-string - "tm-ew-d" "Decode MIME encoded-word." t) + "tm-ew-d" "Decode MIME encoded-words in message header." t) +(autoload 'mime-eword/decode-string + "tm-ew-d" "Decode MIME encoded-words in string." t) (defvar tm-gnus/decoding-mode t "*Decode MIME header if non-nil.") @@ -63,7 +63,7 @@ If you don't like it, define your own gnus-article-set-mode-line." (let ((maxlen 15) ;Maximum subject length (subject (if gnus-current-headers - (mime/decode-encoded-words-string + (mime-eword/decode-string (nntp-header-subject gnus-current-headers)) "") )) @@ -90,8 +90,7 @@ If you don't like it, define your own gnus-article-set-mode-line." (lambda (header) (let ((subj (or (gnus-header-subject header) ""))) (nntp-set-header-subject - header - (mime/decode-encoded-words-string subj)) + header (mime-eword/decode-string subj)) ))) gnus-newsgroup-headers) ) diff --git a/gnus/tm-sgnus.el b/gnus/tm-sgnus.el index aafc58d..c95e9d9 100644 --- a/gnus/tm-sgnus.el +++ b/gnus/tm-sgnus.el @@ -18,7 +18,7 @@ (autoload 'mime/viewer-mode "tm-view" "View MIME message." t) (autoload 'mime/decode-message-header "tm-ew-d" "Decode MIME encoded-words in message header." t) -(autoload 'mime/decode-encoded-words-string +(autoload 'mime-eword/decode-string "tm-ew-d" "Decode MIME encoded-words in string." t) @@ -26,7 +26,7 @@ ;;; (defconst tm-gnus/RCS-ID - "$Id: tm-sgnus.el,v 7.2 1995/10/11 10:20:29 morioka Exp $") + "$Id: tm-sgnus.el,v 7.4 1995/10/18 08:32:36 morioka Exp $") (defconst tm-gnus/version (concat (get-version-string tm-gnus/RCS-ID) " for September")) @@ -65,9 +65,28 @@ article is automatic MIME decoded.") (gnus-summary-scroll-up -1) ) +(defun tm-gnus/summary-toggle-header (&optional arg) + (interactive "P") + (if (and tm-gnus/decode-all gnus-show-mime) + (let ((mime-viewer/ignored-field-list + (if (save-excursion + (set-buffer gnus-article-buffer) + (some-element + (lambda (field) + (rfc822/get-field-body field) + ) + mime-viewer/ignored-field-list)) + mime-viewer/ignored-field-list))) + (gnus-summary-select-article t t) + ) + (gnus-summary-toggle-header arg) + )) + (define-key gnus-summary-mode-map "v" (function tm-gnus/view-message)) (define-key gnus-summary-mode-map "\e\r" (function tm-gnus/summary-scroll-down)) +(define-key gnus-summary-mode-map + "t" (function tm-gnus/summary-toggle-header)) ;;; @ for tm-view @@ -101,12 +120,12 @@ article is automatic MIME decoded.") (mail-header-set-from header (if from - (mime/decode-encoded-words-string from) + (mime-eword/decode-string from) "")) (mail-header-set-subject header (if subj - (mime/decode-encoded-words-string subj) + (mime-eword/decode-string subj) "")) )) gnus-newsgroup-headers) @@ -114,6 +133,9 @@ article is automatic MIME decoded.") (add-hook 'gnus-select-group-hook (function tm-gnus/decode-summary-from-and-subjects)) + ) + (t + (defalias 'mime/decode-encoded-words-string 'mime-eword/decode-string) )) @@ -121,13 +143,12 @@ article is automatic MIME decoded.") ;;; (defun tm-gnus/preview-article () - (let (mime-viewer/ignored-field-list) - (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) - )) + (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) + ) (defun tm-gnus/set-mime-method (mode) (setq gnus-show-mime-method @@ -140,6 +161,16 @@ article is automatic MIME decoded.") (setq gnus-show-mime t) +(defun tm-gnus/article-hide-headers-if-wanted () + (if (not (and gnus-show-mime tm-gnus/decode-all)) + (gnus-article-hide-headers-if-wanted) + )) + +(remove-hook 'gnus-article-display-hook + 'gnus-article-hide-headers-if-wanted) +(add-hook 'gnus-article-display-hook + 'tm-gnus/article-hide-headers-if-wanted) + ;;; @ for tm-comp ;;; diff --git a/mh-e/Makefile b/mh-e/Makefile index 016f69b..23f9ed1 100644 --- a/mh-e/Makefile +++ b/mh-e/Makefile @@ -23,7 +23,7 @@ TMDIR19 = $(HOME)/lib/emacs19/lisp FILES = tm/mh-e/*.el tm/mh-e/Makefile tm/mh-e/mk-tmh tm/mh-e/*.ol -TARFILE = tm-mh-e7.03.tar +TARFILE = tm-mh-e7.05.tar elc: diff --git a/mh-e/tm-mh-e.el b/mh-e/tm-mh-e.el index 2d325da..e62070e 100644 --- a/mh-e/tm-mh-e.el +++ b/mh-e/tm-mh-e.el @@ -26,7 +26,7 @@ ;;; (defconst tm-mh-e/RCS-ID - "$Id: tm-mh-e.el,v 7.3 1995/10/13 08:15:17 morioka Exp $") + "$Id: tm-mh-e.el,v 7.5 1995/10/18 09:57:56 morioka Exp $") (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) @@ -37,6 +37,10 @@ (defvar tm-mh-e/decode-all t "*If t, decode all of the message. Otherwise decode header only.") +(defvar tm-mh-e/show-all-header nil) + +(defvar tm-mh-e/decode-encoded-word t) + ;;; @ functions ;;; @@ -48,7 +52,7 @@ (defun mh-display-msg (msg-num folder &optional show-buffer mode) (or mode - (setq mode tm-mh-e/decode-all) + (setq mode (and tm-mh-e/decode-all (not tm-mh-e/show-all-header))) ) ;; Display message NUMBER of FOLDER. ;; Sets the current buffer to the show buffer. @@ -118,7 +122,9 @@ (goto-char (point-min))) (t (mh-start-of-uncleaned-message))) - (mime/decode-message-header) + (if tm-mh-e/decode-encoded-word + (mime/decode-message-header) + ) (set-buffer-modified-p nil) (setq buffer-read-only t) (mh-show-mode) @@ -163,15 +169,20 @@ With arg, turn MIME processing on if arg is positive." (mh-show (mh-get-msg-num t)) ) +(defun tm-mh-e/show (&optional message) + (interactive) + (setq tm-mh-e/show-all-header nil) + (setq tm-mh-e/decode-encoded-word t) + (mh-invalidate-show-buffer) + (mh-show message) + ) + (defun tm-mh-e/header-display () (interactive) - (if tm-mh-e/decode-all - (let ((win (selected-window))) - (pop-to-buffer mh-show-buffer) - (switch-to-buffer mime::preview/article-buffer) - (goto-char (point-min)) - (select-window win) - ) + (setq tm-mh-e/show-all-header t) + (setq tm-mh-e/decode-encoded-word nil) + (mh-invalidate-show-buffer) + (let (mime-viewer/ignored-field-list) (mh-header-display) )) @@ -286,6 +297,7 @@ With arg, turn MIME processing on if arg is positive." (define-key mh-folder-mode-map "v" (function tm-mh-e/view-message)) (define-key mh-folder-mode-map "\et" (function tm-mh-e/toggle-decoding-mode)) +(define-key mh-folder-mode-map "." (function tm-mh-e/show)) (define-key mh-folder-mode-map "," (function tm-mh-e/header-display)) (define-key mh-folder-mode-map "\r" (function (lambda () diff --git a/mime-setup.el b/mime-setup.el index 3fbf941..667e81a 100644 --- a/mime-setup.el +++ b/mime-setup.el @@ -6,7 +6,7 @@ ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: -;;; $Id: mime-setup.el,v 7.3 1995/10/06 07:17:22 morioka Exp $ +;;; $Id: mime-setup.el,v 7.4 1995/10/17 16:20:39 morioka Exp $ ;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word ;;; ;;; This file is part of tm (Tools for MIME). @@ -182,6 +182,9 @@ "application" "octet-stream" (("name" . file) ("type" . "tar") ("conversions" . "gzip")) nil) + ("\\.diff$" + "application" "octet-stream" (("name" . file) + ("type" . "patch")) nil) ("\\.signature" "text" "plain" nil nil) (".*" nil nil nil nil)) diff --git a/tm-ew-d.el b/tm-ew-d.el index 615810c..6797b9c 100644 --- a/tm-ew-d.el +++ b/tm-ew-d.el @@ -8,8 +8,6 @@ ;;; ;;; Author: ENAMI Tsugutomo ;;; MORIOKA Tomohiko -;;; Version: -;;; $Id: tm-ew-d.el,v 7.2 1995/10/05 12:20:36 morioka Exp $ ;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word ;;; @@ -19,6 +17,14 @@ (require 'tm-def) +;;; @ version +;;; + +(defconst tm-ew-d/RCS-ID + "$Id: tm-ew-d.el,v 7.5 1995/10/18 11:18:03 morioka Exp $") +(defconst mime/eword-decoder-version (get-version-string tm-ew-d/RCS-ID)) + + ;;; @ MIME encoded-word definition ;;; @@ -39,7 +45,8 @@ ;;; @ for string ;;; -(defun mime/decode-encoded-words-string (str) +(defun mime-eword/decode-string (str) + (setq str (rfc822/unfolding-string str)) (let ((dest "")(ew nil) beg end) (while (setq beg (string-match mime/encoded-word-regexp str)) @@ -63,7 +70,7 @@ ;;; @ for region ;;; -(defun mime/decode-encoded-words-region (beg end &optional unfolding) +(defun mime-eword/decode-region (beg end &optional unfolding) (interactive "*r") (save-excursion (save-restriction @@ -99,7 +106,7 @@ (save-restriction (narrow-to-region (goto-char (point-min)) (progn (re-search-forward "^$" nil t) (point))) - (mime/decode-encoded-words-region (point-min) (point-max) t) + (mime-eword/decode-region (point-min) (point-max) t) ))) (defun mime/unfolding () diff --git a/tm-ew-e.el b/tm-ew-e.el index d81e40c..2abfd32 100644 --- a/tm-ew-e.el +++ b/tm-ew-e.el @@ -5,9 +5,7 @@ ;;; Copyright (C) 1995 Free Software Foundation, Inc. ;;; Copyright (C) 1993,1994,1995 MORIOKA Tomohiko ;;; -;;; Author: MORIOKA Tomohiko -;;; Version: -;;; $Id: tm-ew-e.el,v 7.1 1995/10/11 11:56:46 morioka Exp $ +;;; Author: MORIOKA Tomohiko ;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word ;;; @@ -16,6 +14,22 @@ (require 'tm-def) +;;; @ version +;;; + +(defconst tm-ew-e/RCS-ID + "$Id: tm-ew-e.el,v 7.4 1995/10/18 08:54:59 morioka Exp $") +(defconst mime/eword-encoder-version (get-version-string tm-ew-e/RCS-ID)) + + +;;; @ variables +;;; + +(defvar mime/no-encoding-header-fields '("X-Nsubject" "Newsgroups")) + +(defvar mime/use-X-Nsubject nil) + + ;;; @ encoded-text encoder ;;; @@ -393,6 +407,96 @@ (rfc822/lexical-analyze str))))) +;;; @ application interfaces +;;; + +(defun mime/encode-field (str) + (setq str (rfc822/unfolding-string str)) + (let ((ret (string-match rfc822/field-top-regexp str))) + (if ret + (let ((field-name (substring str 0 (match-end 1))) + (field-body (eliminate-top-spaces + (substring str (match-end 0)))) + fname) + (concat field-name ": " + (cond ((string= field-body "") "") + ((member (setq fname (downcase field-name)) + '("reply-to" "from" "sender" + "resent-reply-to" "resent-from" + "resent-sender" "to" "resent-to" + "cc" "resent-cc" + "bcc" "resent-bcc" "dcc") + ) + (car (tm-eword::encode-address-list + (+ (length field-name) 1) field-body)) + ) + (t + (catch 'tag + (let ((r mime/no-encoding-header-fields) fn) + (while r + (setq fn (car r)) + (if (string= (downcase fn) fname) + (throw 'tag field-body) + ) + (setq r (cdr r)) + )) + (car (tm-eword::encode-string + (+ (length field-name) 1) field-body)) + )) + )) + ) + str))) + +(defun mime/exist-encoded-word-in-subject () + (let ((str (rfc822/get-field-body "Subject"))) + (if (and str (string-match mime/encoded-word-regexp str)) + str))) + +(defun mime/encode-message-header () + (interactive "*") + (save-excursion + (save-restriction + (narrow-to-region (goto-char (point-min)) + (progn + (re-search-forward + (concat + "^" (regexp-quote mail-header-separator) "$") + nil t) + (match-beginning 0) + )) + (goto-char (point-min)) + (let (beg end field) + (while (re-search-forward rfc822/field-top-regexp nil t) + (setq beg (match-beginning 0)) + (setq end (rfc822/field-end)) + (if (and (find-charset-region beg end) + (setq field + (mime/encode-field + (buffer-substring-no-properties beg end) + )) + ) + (progn + (delete-region beg end) + (insert field) + )) + )) + (if mime/use-X-Nsubject + (let ((str (mime/exist-encoded-word-in-subject))) + (if str + (insert + (concat + "\nX-Nsubject: " + (mime/decode-encoded-words-string + (rfc822/unfolding-string str)) + ))))) + ))) + +(defun mime-eword/encode-string (str &optional column mode) + (car (tm-eword::encode-rwl (or column 0) + (tm-eword::split-string str) mode)) + ) + + ;;; @ end ;;; diff --git a/tm-eword.el b/tm-eword.el index 9327b55..59f2875 100644 --- a/tm-eword.el +++ b/tm-eword.el @@ -6,6 +6,8 @@ ;;; Copyright (C) 1993,1994,1995 MORIOKA Tomohiko ;;; ;;; Author: MORIOKA Tomohiko +;;; Version: +;;; $Id: tm-eword.el,v 7.9 1995/10/18 08:55:37 morioka Exp $ ;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word ;;; @@ -13,121 +15,18 @@ (require 'tl-str) (require 'tm-def) -(autoload 'mime/decode-encoded-words-string "tm-ew-d") -(autoload 'mime/decode-encoded-words-region "tm-ew-d" nil t) +(autoload 'mime/encode-message-header "tm-ew-e" nil t) (autoload 'mime/decode-message-header "tm-ew-d" nil t) +(autoload 'mime/encode-field "tm-ew-e" nil t) -(require 'tm-ew-e) +(autoload 'mime-eword/decode-region "tm-ew-d" nil t) +(autoload 'mime-eword/encode-string "tm-ew-e") +(autoload 'mime-eword/decode-string "tm-ew-d") - -;;; @ version -;;; - -(defconst tm-eword/RCS-ID - "$Id: tm-eword.el,v 7.4 1995/10/11 11:53:17 morioka Exp $") - -(defconst tm-eword/version (get-version-string tm-eword/RCS-ID)) - - -;;; @ variables -;;; - -(defvar mime/no-encoding-header-fields '("X-Nsubject" "Newsgroups")) - -(defvar mime/use-X-Nsubject nil) +(autoload 'mime/exist-encoded-word-in-subject "tm-ew-e" nil t) -;;; @ Application Interface -;;; - -;;; @@ MIME header encoders -;;; - -(defun mime/encode-field (str) - (setq str (rfc822/unfolding-string str)) - (let ((ret (string-match rfc822/field-top-regexp str))) - (if ret - (let ((field-name (substring str 0 (match-end 1))) - (field-body (eliminate-top-spaces - (substring str (match-end 0)))) - fname) - (concat field-name ": " - (cond ((string= field-body "") "") - ((member (setq fname (downcase field-name)) - '("reply-to" "from" "sender" - "resent-reply-to" "resent-from" - "resent-sender" "to" "resent-to" - "cc" "resent-cc" - "bcc" "resent-bcc" "dcc") - ) - (car (tm-eword::encode-address-list - (+ (length field-name) 1) field-body)) - ) - (t - (catch 'tag - (let ((r mime/no-encoding-header-fields) fn) - (while r - (setq fn (car r)) - (if (string= (downcase fn) fname) - (throw 'tag field-body) - ) - (setq r (cdr r)) - )) - (car (tm-eword::encode-string - (+ (length field-name) 1) field-body)) - )) - )) - ) - str))) - -(defun mime/exist-encoded-word-in-subject () - (let ((str (rfc822/get-field-body "Subject"))) - (if (and str (string-match mime/encoded-word-regexp str)) - str))) - -(defun mime/encode-message-header () - (interactive "*") - (save-excursion - (save-restriction - (narrow-to-region (goto-char (point-min)) - (progn - (re-search-forward - (concat - "^" (regexp-quote mail-header-separator) "$") - nil t) - (match-beginning 0) - )) - (goto-char (point-min)) - (let (beg end field) - (while (re-search-forward rfc822/field-top-regexp nil t) - (setq beg (match-beginning 0)) - (setq end (rfc822/field-end)) - (if (and (find-charset-region beg end) - (setq field - (mime/encode-field - (buffer-substring-no-properties beg end) - )) - ) - (progn - (delete-region beg end) - (insert field) - )) - )) - (if mime/use-X-Nsubject - (let ((str (mime/exist-encoded-word-in-subject))) - (if str - (insert - (concat - "\nX-Nsubject: " - (mime/decode-encoded-words-string - (rfc822/unfolding-string str)) - ))))) - ))) - - ;;; @ end ;;; (provide 'tm-eword) - -(run-hooks 'tm-eword-load-hook) diff --git a/tm-partial.el b/tm-partial.el index d39a78f..6b895b3 100644 --- a/tm-partial.el +++ b/tm-partial.el @@ -11,7 +11,7 @@ ;;; ;;; This file is a part of tm (Tools for MIME). ;;; -;;; $Id: tm-partial.el,v 6.1 1995/09/26 14:50:54 morioka Exp $ +;;; $Id: tm-partial.el,v 7.0 1995/10/18 08:19:27 morioka Exp $ ;;; (require 'tm-view) @@ -71,7 +71,9 @@ (subject-id nil) (part-num 1) (part-missing nil)) - (cond ((eq major-mode 'gnus-article-mode) + (cond ((or (eq major-mode 'gnus-article-mode) + (eq major-mode 'gnus-original-article-mode) + ) (setq subject-buf gnus-summary-buffer) (setq target 'gnus4) ) @@ -196,6 +198,12 @@ (set-atype 'mime/content-decoding-condition '((type . "message/partial") (method . mime/decode-message/grab-partials) + (major-mode . gnus-original-article-mode) + )) + +(set-atype 'mime/content-decoding-condition + '((type . "message/partial") + (method . mime/decode-message/grab-partials) (major-mode . mh-show-mode) )) diff --git a/tm-view.el b/tm-view.el index 8d17373..8e3f80f 100644 --- a/tm-view.el +++ b/tm-view.el @@ -25,7 +25,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 7.15 1995/10/13 08:43:49 morioka Exp $") + "$Id: tm-view.el,v 7.16 1995/10/17 16:48:06 morioka Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -380,7 +380,7 @@ The compressed face will be piped to this command.") (save-restriction (narrow-to-region beg end) (setq subj - (mime/decode-encoded-words-string + (mime-eword/decode-string (mime-viewer/get-subject params encoding))) ) (set-buffer obuf) diff --git a/tm-vm.el b/tm-vm.el index f0effa6..e561fb8 100644 --- a/tm-vm.el +++ b/tm-vm.el @@ -21,7 +21,7 @@ (require 'vm) (defconst tm-vm/RCS-ID - "$Id: tm-vm.el,v 7.0 1995/10/03 05:04:35 morioka Exp $") + "$Id: tm-vm.el,v 7.1 1995/10/17 16:49:51 morioka Exp $") (defconst tm-vm/version (get-version-string tm-vm/RCS-ID)) (define-key vm-mode-map "Z" 'tm-vm/view-message) @@ -43,7 +43,7 @@ ;; (setq vm-summary-format "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c, %I\"%UA\"\n") ;; (defun vm-summary-function-A (m) -;; (mime/decode-encoded-words-string (vm-su-subject m))) +;; (mime-ewords/decode-string (vm-su-subject m))) ;;; @ functions