From 83d94fa120b4ca085be5849bc3c387e724989c70 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 9 Mar 1998 07:41:52 +0000 Subject: [PATCH] tm 6.83. --- Changes-6.81-6.83.en | 138 +++++++++++++++++++++++ Changes-6.81-6.83.ja | 136 +++++++++++++++++++++++ Makefile | 5 +- README.eng | 21 ++-- mh-e/Makefile | 2 +- mh-e/tm-mh-e.el | 30 ++++- mk-tm | 2 +- tiny-mime.el | 12 +- tinyrich.el | 53 ++------- tm-def.el | 46 +++++++- tm-ftp.el | 15 ++- tm-latex.el | 10 +- tm-partial.el | 19 ++-- tm-tar.el | 302 ++++++++++++++++++++++++++++++++++++++++++++++++++ tm-view.el | 44 +++++++- tm-w3.el | 44 ++++++++ 16 files changed, 792 insertions(+), 87 deletions(-) create mode 100644 Changes-6.81-6.83.en create mode 100644 Changes-6.81-6.83.ja create mode 100644 tm-tar.el create mode 100644 tm-w3.el diff --git a/Changes-6.81-6.83.en b/Changes-6.81-6.83.en new file mode 100644 index 0000000..080d519 --- /dev/null +++ b/Changes-6.81-6.83.en @@ -0,0 +1,138 @@ +* tl + + Attached version 6.6.5. + + +tl/tl-header.el +---------------------------- +revision 5.9 +date: 1995/09/20 12:11:33; author: morioka; state: Exp; lines: +12 -3 +(1) Function `message/field-end' was created. +(2) Function `message/get-field-body' was modified to use function + `message/field-end'. +---------------------------- + + +* tm + +tm/tiny-mime.el +---------------------------- +revision 6.7 +date: 1995/09/20 12:17:28; author: morioka; state: Exp; lines: +2 -10 +Function `mime/unfolding' was modified to use function +`message/field-end'. +---------------------------- + +tm/tinyrich.el +---------------------------- +revision 5.0 +date: 1995/09/20 14:45:56; author: morioka; state: Exp; lines: +12 -41 +It was modified to use function `tm:set-face-region'. +---------------------------- + +tm/tm-def.el +---------------------------- +revision 6.1 +date: 1995/09/20 14:44:49; author: morioka; state: Exp; lines: +30 -2 +function `tm:set-face-region' was defined for each emacs variants. +---------------------------- +revision 6.0 +date: 1995/09/19 16:09:04; author: morioka; state: Exp; lines: +2 -2 +UENO Hiroshi said: +====================================================================== +tm-def gets `mime/tmp-dir' from environment variable `TM_TMPDIR', on +the other hand external methods get from `TM_TMP_DIR'. External +methods for OS/2 is using `TM_TMP_DIR', because csh version external +methods, which are model of OS/2 methods, were using `TM_TMP_DIR'. So +I think TM_TMP_DIR may be correct. Anyway, I think they should be +unified. +====================================================================== +So I fixed to use `TM_TMP_DIR'. +---------------------------- +revision 5.0 +date: 1995/09/14 15:48:25; author: morioka; state: Exp; lines: +13 -1 +Variable `mime/use-multi-frame' and variable `mime/find-file-function' +are defined. +---------------------------- + +tm/tm-ftp.el +---------------------------- +revision 6.1 +date: 1995/09/14 15:49:43; author: morioka; state: Exp; lines: +11 -4 +When variable `mime/use-multi-frame' is non-nil, dired is displayed as +another frame. +---------------------------- + +tm/tm-latex.el +---------------------------- +revision 3.0 +date: 1995/09/14 15:51:35; author: morioka; state: Exp; lines: +6 -4 +Variable `mime/find-file-function' was defined as a function to find +file. +---------------------------- + +tm/tm-partial.el +---------------------------- +revision 6.0 +date: 1995/09/20 14:39:23; author: morioka; state: Exp; lines: +12 -7 +Fixed a problem of function `mime/decode-message/grab-partials'. +---------------------------- + +tm/tm-tar.el +---------------------------- +By UENO Hiroshi . +It is a internal method of tm-view to view files included in tar or +tar.gz content. +---------------------------- + +tm/tm-view.el +---------------------------- +revision 6.83 +date: 1995/09/20 14:19:42; author: morioka; state: Exp; lines: +5 -1 +Function `mime-viewer/make-preview-buffer' was fixed about +message/partial announcement. If body is empty, empty line is inserted. +---------------------------- +revision 6.82 +date: 1995/09/20 12:16:14; author: morioka; state: Exp; lines: +26 -3 +(1) Display X-Face. +(2) X-Face field does not display in default. +---------------------------- +revision 6.81 +date: 1995/09/14 15:46:45; author: morioka; state: Exp; lines: +10 -3 +2 announcements of message/partial, mouse is available or not, was +defined. +---------------------------- + +tm/tm-w3.el +---------------------------- +revision 1.1 +date: 1995/09/14 15:51:57; author: morioka; state: Exp; +Internal method to view HTML content. +---------------------------- + + +* tm/mh-e + + Attached version 6.27. + +tm/mh-e/tm-mh-e.el +---------------------------- +revision 6.27 +date: 1995/09/20 12:34:39; author: morioka; state: Exp; lines: +4 -2 + + (if (featurep 'hilit19) + (hilit-rehighlight-buffer-quietly) + ) + +was inserted in function `tm-mh-e/content-header-filter'. +---------------------------- +revision 6.26 +date: 1995/09/20 12:19:28; author: morioka; state: Exp; lines: +2 -1 +Function `tm-mh-e/content-header-filter' was modified to call function +`mime-viewer/x-face-function'. +---------------------------- +revision 6.25 +date: 1995/09/15 06:58:00; author: morioka; state: Exp; lines: +24 -1 +Function `tm-mh-e/toggle-showing' was defined to fix a problem of `t' +key in summary mode. +---------------------------- diff --git a/Changes-6.81-6.83.ja b/Changes-6.81-6.83.ja new file mode 100644 index 0000000..3ce7ca6 --- /dev/null +++ b/Changes-6.81-6.83.ja @@ -0,0 +1,136 @@ +* tl + + Version 6.6.5 を添付した。 + + +tl/tl-header.el +---------------------------- +revision 5.9 +date: 1995/09/20 12:11:33; author: morioka; state: Exp; lines: +12 -3 +(1) 関数 message/field-end を追加した。 +(2) 関数 message/field-end を使うように関数 message/get-field-body を + 修正した。 +---------------------------- + + +* tm + +tm/tiny-mime.el +---------------------------- +revision 6.7 +date: 1995/09/20 12:17:28; author: morioka; state: Exp; lines: +2 -10 +関数 mime/unfolding で関数 message/field-end を使うようにした。 +---------------------------- + +tm/tinyrich.el +---------------------------- +revision 5.0 +date: 1995/09/20 14:45:56; author: morioka; state: Exp; lines: +12 -41 +関数 tm:set-face-region を使うようにした。 +---------------------------- + +tm/tm-def.el +---------------------------- +revision 6.1 +date: 1995/09/20 14:44:49; author: morioka; state: Exp; lines: +30 -2 +各 Emacs の variant に対して、関数 tm:set-face-region を定義した。 +---------------------------- +revision 6.0 +date: 1995/09/19 16:09:04; author: morioka; state: Exp; lines: +2 -2 +上野 博 さん曰く: +====================================================================== +まず tm-def で mime/tmp-dir を環境変数 TM_TMPDIR から取るようになって +いるのですが、外部 method の方は TM_TMP_DIR になっています。 OS/2 用の +外部 method も TM_TMP_DIR を使っているのですが、確かこれは csh 用に書 +かれていた method をまねて書いたので TM_TMP_DIR が正しいような気がしま +す。まぁどっちが正しいということもないので、どちらかに統一すればよいの +でしょう。 +====================================================================== +という訳で、TM_TMP_DIR に修正した。 +---------------------------- +revision 5.0 +date: 1995/09/14 15:48:25; author: morioka; state: Exp; lines: +13 -1 +変数 mime/use-multi-frame と変数 mime/find-file-function を定義した。 +---------------------------- + +tm/tm-ftp.el +---------------------------- +revision 6.1 +date: 1995/09/14 15:49:43; author: morioka; state: Exp; lines: +11 -4 +変数 mime/dired-function が non-nil の時、dired を別 frame に表示する +ようにした。 +---------------------------- + +tm/tm-latex.el +---------------------------- +revision 3.0 +date: 1995/09/14 15:51:35; author: morioka; state: Exp; lines: +6 -4 +file の参照に用いる関数として、変数 mime/find-file-function の値を用い +るようにした。 +---------------------------- + +tm/tm-partial.el +---------------------------- +revision 6.0 +date: 1995/09/20 14:39:23; author: morioka; state: Exp; lines: +12 -7 +関数 mime/decode-message/grab-partials の不具合を修正した。 +---------------------------- + +tm/tm-tar.el +---------------------------- +上野 博 さん作。 +tar や tar.gz file を閲覧するための内部 method. +---------------------------- + +tm/tm-view.el +---------------------------- +revision 6.83 +date: 1995/09/20 14:19:42; author: morioka; state: Exp; lines: +5 -1 +関数 mime-viewer/make-preview-buffer を、message/partial の時に +preview buffer に表示する message の前に必ず空行が入るように修正した。 +---------------------------- +revision 6.82 +date: 1995/09/20 12:16:14; author: morioka; state: Exp; lines: +26 -3 +(1) X-Face を表示するようにした。 +(2) X-Face field を表示しないようにした。 +---------------------------- +revision 6.81 +date: 1995/09/14 15:46:45; author: morioka; state: Exp; lines: +10 -3 +message/partial 用の message を mouse が使える場合と使えない場合の2通 +り用意した。 +---------------------------- + +tm/tm-w3.el +---------------------------- +revision 1.1 +date: 1995/09/14 15:51:57; author: morioka; state: Exp; +HTML を閲覧するための内部 method. +---------------------------- + + +* tm/mh-e + + Version 6.27 を添付した。 + +tm/mh-e/tm-mh-e.el +---------------------------- +revision 6.27 +date: 1995/09/20 12:34:39; author: morioka; state: Exp; lines: +4 -2 +関数 tm-mh-e/content-header-filter に + + (if (featurep 'hilit19) + (hilit-rehighlight-buffer-quietly) + ) + +を入れた。 +---------------------------- +revision 6.26 +date: 1995/09/20 12:19:28; author: morioka; state: Exp; lines: +2 -1 +関数 tm-mh-e/content-header-filter を関数 mime-viewer/x-face-function +を呼ぶように修正した。 +---------------------------- +revision 6.25 +date: 1995/09/15 06:58:00; author: morioka; state: Exp; lines: +24 -1 +関数 tm-mh-e/toggle-showing を定義し、summary mode で `t' key がうまく +働くように修正した。 +---------------------------- diff --git a/Makefile b/Makefile index ad7de05..f546d4d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ TM_FILES = tm/README.eng tm/rel-*.ol tm/Changes* \ tm/config.tm tm/Makefile tm/mk-tm \ tm/tm-view.el tm/tiny-mime.el \ tm/tm-mule.el tm/tm-nemacs.el tm/tm-orig.el tm/tm-def.el \ - tm/tm-ftp.el tm/tm-latex.el tm/tm-partial.el \ + tm/tm-ftp.el tm/tm-latex.el tm/tm-w3.el tm/tm-partial.el \ + tm/tm-tar.el \ tm/tm-rich.el tm/richtext.el tm/tinyrich.el \ tm/tm-comp.el \ tm/tm-setup.el tm/mime-setup.el \ @@ -32,7 +33,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 = tm6.80.1.tar +TARFILE = tm6.83.tar nemacs: diff --git a/README.eng b/README.eng index c28ce06..a2bcdd4 100644 --- a/README.eng +++ b/README.eng @@ -1,6 +1,6 @@ [README for tm (English Version)] by MORIOKA Tomohiko -$Id: README.eng,v 6.10 1995/09/09 05:56:08 morioka Exp $ +$Id: README.eng,v 6.11 1995/09/20 17:16:09 morioka Exp $ 1 What's tm? @@ -123,16 +123,15 @@ environment. Run `make install-19', if you use Emacs 19.*. -5.1.1 (ding) GNUS or GNUS 5.* +5.1.1 Gnus 5.* If you want to use automatic MIME preview support, please apply a -patch to (ding) GNUS or GNUS 5.*. This patch is called `with tm -patch'. It is available from -ftp.jaist.ac.jp:/pub/GNU/elisp/dgnus/. Current version is -dgnus-0.99.23-tm.diff. +patch to Gnus 5.*. This patch is called `with tm patch'. It is +available from ftp.jaist.ac.jp:/pub/GNU/elisp/dgnus/. Current version +is gnus-5.0.4-tm.diff. -5.1 tm-mh-e +5.2 tm-mh-e (1) Please edit mh-e/Makefile @@ -158,6 +157,14 @@ dgnus-0.99.23-tm.diff. Please insert (load "mime-setup") or (load "tm-setup") in .emacs. If you use mime-setup, you should prepare mime.el. +mime.el is included in emacs-mime-tools.shar written by UMEDA +Masanobu. It is available by anonymous ftp: + + ftp.kyutech.ac.jp /pub/MultiMedia/mime/ + ftp.jaist.ac.jp /pub/GNU/elisp/mime/ + +or a lot of anonymous ftp sites. Please try archie. + 6.1 VM If you want use vm, please insert following in .vm or .emacs: diff --git a/mh-e/Makefile b/mh-e/Makefile index d9639a6..9dcdc23 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-e6.24.1.tar +TARFILE = tm-mh-e6.27.tar elc: diff --git a/mh-e/tm-mh-e.el b/mh-e/tm-mh-e.el index f72af2d..feb5c23 100644 --- a/mh-e/tm-mh-e.el +++ b/mh-e/tm-mh-e.el @@ -2,7 +2,6 @@ ;;; A MIME extender for mh-e ;;; ;;; by Morioka Tomohiko, 1993/11/21 -;;; modified by YAMAOKA Katsumi ;;; @@ -22,7 +21,7 @@ ;;; (defconst tm-mh-e/RCS-ID - "$Id: tm-mh-e.el,v 6.24 1995/09/02 06:02:20 morioka Exp $") + "$Id: tm-mh-e.el,v 6.27 1995/09/20 12:34:39 morioka Exp $") (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) @@ -176,6 +175,28 @@ With arg, turn MIME processing on if arg is positive." (mh-yank-cur-msg) )) +(defun tm-mh-e/toggle-showing () + "Toggle the scanning mode/showing mode of displaying messages." + (interactive) + (if mh-showing + (if tm-mh-e/decode-all + (let ((pbuf + (save-window-excursion + (set-buffer mh-show-buffer) + mime::article/preview-buffer))) + (if (get-buffer pbuf) + (delete-windows-on pbuf) + ) + (setq mh-showing nil) + (set-buffer-modified-p (buffer-modified-p)) ;force mode line update + (if mh-recenter-summary-p + (mh-recenter nil) + )) + (mh-set-scan-mode) + ) + (mh-show) + )) + ;;; @ for tm-view ;;; @@ -184,6 +205,7 @@ With arg, turn MIME processing on if arg is positive." (symbol-function 'mime/code-convert-region-to-emacs)) (defun tm-mh-e/content-header-filter () + (mime-viewer/x-face-function) (goto-char (point-min)) (while (and (re-search-forward (concat "^" mime-viewer/ignored-field-regexp ":") @@ -200,6 +222,9 @@ With arg, turn MIME processing on if arg is positive." (tm-mh-e/code-convert-region-to-emacs (point-min)(point-max) mime/default-coding-system) (mime/decode-message-header) + (if (featurep 'hilit19) + (hilit-rehighlight-buffer-quietly) + ) ) (defun tm-mh-e/quitting-method () @@ -286,6 +311,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 "t" (function tm-mh-e/toggle-showing)) (define-key mh-folder-mode-map "\r" (function (lambda () (interactive) diff --git a/mk-tm b/mk-tm index 4d49728..fbe0ff8 100644 --- a/mk-tm +++ b/mk-tm @@ -43,7 +43,7 @@ ) )) -(setq tm-uncompile-el-files '("tm-partial.el")) +(setq tm-uncompile-el-files '("tm-partial.el" "tm-w3.el")) (if (catch 'tag (let ((paths load-path) path) diff --git a/tiny-mime.el b/tiny-mime.el index 905811c..7bc4bb7 100644 --- a/tiny-mime.el +++ b/tiny-mime.el @@ -21,7 +21,7 @@ ;;; (defconst mime/RCS-ID - "$Id: tiny-mime.el,v 6.6 1995/09/04 10:33:27 morioka Exp $") + "$Id: tiny-mime.el,v 6.7 1995/09/20 12:17:28 morioka Exp $") (defconst mime/tiny-mime-version (get-version-string mime/RCS-ID)) @@ -617,15 +617,7 @@ (let (field beg end) (while (re-search-forward message/field-name-regexp nil t) (setq beg (match-beginning 0)) - (setq end (progn - (if (re-search-forward "\n[!-9;-~]+:" nil t) - (goto-char (match-beginning 0)) - (if (re-search-forward "^$" nil t) - (goto-char (1- (match-beginning 0))) - (end-of-line) - )) - (point) - )) + (setq end (message/field-end)) (setq field (buffer-substring beg end)) (if (string-match mime/encoded-word-regexp field) (save-restriction diff --git a/tinyrich.el b/tinyrich.el index 7e26937..3929205 100644 --- a/tinyrich.el +++ b/tinyrich.el @@ -1,47 +1,17 @@ ;;; -;;; $Id: tinyrich.el,v 4.0 1995/09/10 13:35:41 morioka Exp $ +;;; $Id: tinyrich.el,v 5.0 1995/09/20 14:45:56 morioka Exp $ ;;; ;;; by MORIOKA Tomohiko ;;; modified by YAMATE Keiichirou ;;; -(defvar mime/text/enriched-face-list - '("bold" "italic" "fixed" "underline")) - -(cond ((string-match "XEmacs\\|Lucid" emacs-version) - (defun mime/set-face-region (b e face) - (let ((sym (intern face))) - (if (member sym (face-list)) - (let ((overlay (make-extent b e))) - (set-extent-property overlay 'face sym) - )))) - ) - ((and (>= emacs-major-version 19) window-system) - (defun mime/set-face-region (b e face) - (let ((sym (intern face))) - (if (member sym (face-list)) - (let ((overlay (make-overlay b e))) - (overlay-put overlay 'face sym) - )))) - ) - ((and (boundp 'NEMACS) NEMACS) - (setq mime/available-face-list - '("bold" "italic" "underline")) - (setq mime/available-face-attribute-alist - '(("bold" . inversed-region) - ("italic" . underlined-region) - ("underline" . underlined-region) - )) - (defun mime/set-face-region (beg end sym) - (attribute-add-narrow-attribute - (cdr (assoc sym mime/available-face-attribute-alist)) - beg end)) - ) - (t - (setq mime/text/richtext-face-list nil) - (defun mime/set-face-region (beg end sym) +(defvar mime-viewer/face-list-for-text/enriched + (cond ((and (>= emacs-major-version 19) window-system) + '(bold italic fixed underline) ) - )) + ((and (boundp 'NEMACS) NEMACS) + '("bold" "italic" "underline") + ))) (defun enriched-decode (beg end) (interactive "*r") @@ -57,7 +27,7 @@ (replace-match (substring str 1)) ))) (goto-char beg) - (let (cmd str (fb (point)) fe b e) + (let (cmd sym str (fb (point)) fe b e) (while (re-search-forward "<\\(<\\|[^<>\n\r \t]+>\\)" nil t) (setq b (match-beginning 0)) (setq cmd (buffer-substring b (match-end 0))) @@ -66,7 +36,8 @@ (replace-match "") (setq cmd (downcase (substring cmd 1 (- (length cmd) 1)))) ) - (cond ((string= cmd "param") + (setq sym (intern cmd)) + (cond ((eq sym 'param) (setq b (point)) (save-excursion (save-restriction @@ -79,7 +50,7 @@ ))) (delete-region b e) ) - ((member cmd mime/text/enriched-face-list) + ((memq sym mime-viewer/face-list-for-text/enriched) (setq b (point)) (save-excursion (save-restriction @@ -90,7 +61,7 @@ ) (setq e end) ))) - (mime/set-face-region b e cmd) + (tm:set-face-region b e sym) ))) (goto-char (point-max)) (if (not (eq (preceding-char) ?\n)) diff --git a/tm-def.el b/tm-def.el index 7c2b6e7..8a5e8d1 100644 --- a/tm-def.el +++ b/tm-def.el @@ -1,14 +1,26 @@ ;;; -;;; $Id: tm-def.el,v 4.1 1995/09/04 10:17:02 morioka Exp $ +;;; $Id: tm-def.el,v 6.1 1995/09/20 14:44:49 morioka Exp $ ;;; +(require 'emu) + + ;;; @ variables ;;; -(defvar mime/tmp-dir (or (getenv "TM_TMPDIR") "/tmp/")) +(defvar mime/tmp-dir (or (getenv "TM_TMP_DIR") "/tmp/")) + +(defvar mime/use-multi-frame + (and (>= emacs-major-version 19) window-system)) +(defvar mime/find-file-function + (if mime/use-multi-frame + (function find-file-other-frame) + (function find-file) + )) -;;; @ compatible module among Mule, NEmacs and NEpoch + +;;; @ for various Emacs variants ;;; (cond ((boundp 'MULE) (require 'tm-mule)) @@ -16,6 +28,34 @@ (t (require 'tm-orig)) ) +(cond ((string-match "XEmacs\\|Lucid" emacs-version) + (defun tm:set-face-region (b e face) + (let ((overlay (make-extent b e))) + (set-extent-property overlay 'face face) + )) + ) + ((and (>= emacs-major-version 19) window-system) + (defun tm:set-face-region (b e face) + (let ((overlay (make-overlay b e))) + (overlay-put overlay 'face face) + )) + ) + ((and (boundp 'NEMACS) NEMACS) + (setq tm:available-face-attribute-alist + '((bold . inversed-region) + (italic . underlined-region) + (underline . underlined-region) + )) + (defun tm:set-face-region (beg end face) + (attribute-add-narrow-attribute + (cdr (assq face mime/available-face-attribute-alist)) + beg end)) + ) + (t + (defun tm:set-face-region (beg end sym) + ) + )) + ;;; @ definitions about MIME ;;; diff --git a/tm-ftp.el b/tm-ftp.el index d4e5fc0..c8faf07 100644 --- a/tm-ftp.el +++ b/tm-ftp.el @@ -6,13 +6,18 @@ ;;; modified by MORIOKA Tomohiko (1994/11/ 8) ;;; and OKABE Yasuo (1994/11/11) ;;; -;;; $Id: tm-ftp.el,v 6.0 1995/03/13 16:49:24 morioka Exp $ +;;; $Id: tm-ftp.el,v 6.1 1995/09/14 15:49:43 morioka Exp $ ;;; -(provide 'tm-ftp) - +(require 'tm-view) (require 'ange-ftp) +(defvar mime/dired-function + (if mime/use-multi-frame + (function dired-other-frame) + (function dired) + )) + (defun mime/decode-message/external-ftp (beg end cal) (let ((access-type (cdr (assoc "access-type" cal))) (site (cdr (assoc "site" cal))) @@ -24,7 +29,7 @@ (concat "/anonymous@" site ":" directory)) (message (concat "Accessing " pathname "/" name "...")) (switch-to-buffer mime::article/preview-buffer) - (dired pathname) + (funcall mime/dired-function pathname) (goto-char (point-min)) (search-forward name) )) @@ -34,3 +39,5 @@ ("access-type" . "anon-ftp") (method . mime/decode-message/external-ftp) )) + +(provide 'tm-ftp) diff --git a/tm-latex.el b/tm-latex.el index f2d8884..472fbcb 100644 --- a/tm-latex.el +++ b/tm-latex.el @@ -1,14 +1,14 @@ ;;; -;;; tm-latex: tm-view internal decoder for tm-view +;;; tm-latex: tm-view internal decoder for LaTeX ;;; ;;; by OKABE Yasuo (1994/11/11) ;;; ;;; modified by MORIOKA Tomohiko ;;; -;;; $Id: tm-latex.el,v 2.0 1995/04/07 12:05:33 morioka Exp $ +;;; $Id: tm-latex.el,v 3.0 1995/09/14 15:51:35 morioka Exp $ ;;; -(provide 'tm-latex) +(require 'tm-view) (defun mime/decode-text/latex (beg end cal) (let* ((cur-buf (current-buffer)) @@ -17,7 +17,7 @@ (cdr (assoc "x-name" cal)) (concat (make-temp-name "tm") ".tex")))) (switch-to-buffer mime::article/preview-buffer) - (find-file (expand-file-name name mime/tmp-dir)) + (funcall mime/find-file-function (expand-file-name name mime/tmp-dir)) (if (or (<= (buffer-size) 0) (y-or-n-p "Replace the existing buffer?")) (progn @@ -46,3 +46,5 @@ ; ("type" . "latex") ; (method . mime/decode-text/latex) ; )) + +(provide 'tm-latex) diff --git a/tm-partial.el b/tm-partial.el index 7e06d9a..8e037a9 100644 --- a/tm-partial.el +++ b/tm-partial.el @@ -5,11 +5,14 @@ ;;; by Yasuo OKABE @ Kyoto University 1994 ;;; modified by MORIOKA Tomohiko ;;; and Shuhei KOBAYASHI - -;; original file is -;; gif.el written by Art Mellor @ Cayman Systems, Inc. 1991 - -;;; $Id: tm-partial.el,v 5.0 1995/05/22 17:06:31 morioka Exp $ +;;; +;;; original file is +;;; gif.el written by Art Mellor @ Cayman Systems, Inc. 1991 +;;; +;;; This file is a part of tm (Tools for MIME). +;;; +;;; $Id: tm-partial.el,v 6.0 1995/09/20 14:39:23 morioka Exp $ +;;; (require 'tm-view) @@ -130,7 +133,7 @@ (set-buffer article-buf) (goto-char (point-min)) (re-search-forward "^$") - (let ((delimit (point))) + (let ((delimit (1+ (point)))) (goto-char (point-min)) (if (not (let ((params (cdr (mime/Content-Type)))) @@ -141,7 +144,9 @@ (progn (kill-buffer buffer) (error "Couldn't find part %d" part-num))) - (append-to-buffer buffer (+ delimit 1) (point-max)))) + (if (< delimit (point-max)) + (append-to-buffer buffer delimit (point-max)) + ))) (setq part-num (+ part-num 1)))) (mime/gp:display-article) (save-excursion diff --git a/tm-tar.el b/tm-tar.el new file mode 100644 index 0000000..475bc68 --- /dev/null +++ b/tm-tar.el @@ -0,0 +1,302 @@ +;;; +;;; $Id: tm-tar.el,v 1.1 1995/09/18 17:09:19 H.Ueno Exp $ +;;; +;;; tm-tar.el +;;; +;;; Internal viewer for +;;; - application/x-tar +;;; - application/x-gzip, type="tar" +;;; - aplication/octet-stream, type="tar" +;;; - aplication/octet-stream, type="tar+gzip" +;;; +;;; by Hiroshi Ueno +;;; + +;;; @ required modules +;;; + +(require 'emu) +(require 'tm-view) + +;;; @ constants +;;; + +(defconst tm-tar/list-buffer "*tm-tar/List*") +(defconst tm-tar/view-buffer "*tm-tar/View*") +(defconst tm-tar/file-search-regexp "[0-9]+\:[0-9\:]+[ ]+[0-9]+[ ]+") + +;;; @ variables +;;; + +(defvar tm-tar/tar-program "gtar") +(defvar tm-tar/tar-compress-arg '("-z")) +(defvar tm-tar/gzip-program "gzip") +(defvar tm-tar/mmencode-program "mmencode") +(defvar tm-tar/uudecode-program "uudecode") + +(defvar mime/tm-tar-mode-map nil) +(if mime/tm-tar-mode-map + nil + (setq mime/tm-tar-mode-map (make-keymap)) + (suppress-keymap mime/tm-tar-mode-map) + (define-key mime/tm-tar-mode-map "\C-c" 'exit-recursive-edit) + (define-key mime/tm-tar-mode-map "q" 'exit-recursive-edit) + (define-key mime/tm-tar-mode-map "n" 'mime/tm-tar/next-line) + (define-key mime/tm-tar-mode-map " " 'mime/tm-tar/next-line) + (define-key mime/tm-tar-mode-map "\C-m" 'mime/tm-tar/next-line) + (define-key mime/tm-tar-mode-map "p" 'mime/tm-tar/previous-line) + (define-key mime/tm-tar-mode-map "\177" 'mime/tm-tar/previous-line) + (define-key mime/tm-tar-mode-map "\C-\M-m" 'mime/tm-tar/previous-line) + (define-key mime/tm-tar-mode-map "v" 'mime/tm-tar/view-file) + (define-key mime/tm-tar-mode-map "\C-h" 'Helper-help) + (define-key mime/tm-tar-mode-map "?" 'mime/tm-tar/helpful-message) + (cond ((string-match "XEmacs\\|Lucid" emacs-version) + (define-key mime/tm-tar-mode-map + 'button2 'mime/tm-tar/view-file-mouse) + ) + ((> emacs-major-version 18) + (define-key mime/tm-tar-mode-map + [mouse-2] 'mime/tm-tar/view-file-mouse) + )) + ) + +;;; @@ tm-tar mode functions +;;; + +(defun mime/tm-tar-mode (&optional prev-buf) + "Major mode for listing the contents of a tar archive file." + (unwind-protect + (let ((buffer-read-only t) + (mode-name "tm-tar") + (mode-line-buffer-identification '("%17b")) + ) + (goto-char (point-min)) + (mime/tm-tar/move-to-filename) + (catch 'mime/tm-tar-mode (mime/tm-tar-mode/command-loop)) + ) + (if prev-buf + (switch-to-buffer prev-buf) + ) + )) + +(defun mime/tm-tar-mode/command-loop () + (let ((old-local-map (current-local-map)) + ) + (unwind-protect + (progn + (use-local-map mime/tm-tar-mode-map) + (mime/tm-tar/helpful-message) + (recursive-edit) + ) + (save-excursion + (use-local-map old-local-map) + )) + )) + +(defun mime/tm-tar/next-line () + (interactive) + (next-line 1) + (mime/tm-tar/move-to-filename) + ) + +(defun mime/tm-tar/previous-line () + (interactive) + (previous-line 1) + (mime/tm-tar/move-to-filename) + ) + +(defun mime/tm-tar/view-file () + (interactive) + (let ((name (mime/tm-tar/get-filename)) + ) + (save-excursion + (switch-to-buffer tm-tar/view-buffer) + (setq buffer-read-only nil) + (erase-buffer) + (message "Reading a file from the archive. Please wait...") + (apply 'call-process tm-tar/tar-program + nil t nil (append tm-tar/view-args (list name))) + (goto-char (point-min)) + ) + (view-buffer tm-tar/view-buffer) + )) + +(defun mime/tm-tar/view-file-mouse (e) + (interactive "e") + (mouse-set-point e) + (mime/tm-tar/view-file) + ) + +(defun mime/tm-tar/get-filename () + (let (eol) + (save-excursion + (end-of-line) + (setq eol (point)) + (beginning-of-line) + (save-excursion + (if (re-search-forward "^d" eol t) + (error "Cannot view a directory")) + ) + (if (re-search-forward tm-tar/file-search-regexp eol t) + (progn (let ((beg (point)) + ) + (skip-chars-forward "^ \n") + (buffer-substring beg (point)) + )) + (error "No file on this line") + )) + )) + +(defun mime/tm-tar/move-to-filename () + (let ((eol (progn (end-of-line) (point))) + ) + (beginning-of-line) + (re-search-forward tm-tar/file-search-regexp eol t) + )) + +(defun mime/tm-tar/set-properties () + (if (> emacs-major-version 18) + (let ((beg (point-min)) + (end (point-max)) + ) + (goto-char beg) + (save-excursion + (while (re-search-forward tm-tar/file-search-regexp end t) + (put-text-property (point) + (progn + (end-of-line) + (point)) + 'mouse-face 'highlight) + )) + ))) + +(defun mime/tm-tar/helpful-message () + (interactive) + (message "Type %s, %s, %s, %s, %s, %s." + (substitute-command-keys "\\[Helper-help] for help") + (substitute-command-keys "\\[mime/tm-tar/helpful-message] for key") + (substitute-command-keys "\\[mime/tm-tar/next-line] to next") + (substitute-command-keys "\\[mime/tm-tar/previous-line] to prev") + (substitute-command-keys "\\[mime/tm-tar/view-file] to view") + (substitute-command-keys "\\[exit-recursive-edit] to quit") + )) + +;;; @@ tar message decoder +;; + +(defun mime/decode-message/tar (beg end cal) + (let ((coding (cdr (assoc 'encoding cal))) + (cur-buf (current-buffer)) + (tm-tar/tar-file-name (expand-file-name (concat (make-temp-name + (expand-file-name "tm" mime/tmp-dir)) ".tar"))) + (tm-tar/tmp-file-name (expand-file-name (make-temp-name + (expand-file-name "tm" mime/tmp-dir)))) + new-buf + ) + (find-file tm-tar/tmp-file-name) + (setq new-buf (current-buffer)) + (setq buffer-read-only nil) + (erase-buffer) + (save-excursion + (set-buffer cur-buf) + (goto-char beg) + (re-search-forward "^$") + (append-to-buffer new-buf (+ (match-end 0) 1) end) + ) + (if (member coding mime-viewer/uuencode-encoding-name-list) + (progn + (goto-char (point-min)) + (if (re-search-forward "^begin [0-9]+ " nil t) + (progn + (kill-line) + (insert tm-tar/tar-file-name) + ) + (progn + (set-buffer-modified-p nil) + (kill-buffer new-buf) + (error "uuencode file signature was not found") + )))) + (save-buffer) + (kill-buffer new-buf) + (message "Listing the contents of archive. Please wait...") + (cond ((string-equal coding "base64") + (call-process tm-tar/mmencode-program nil nil nil "-u" + "-o" tm-tar/tar-file-name tm-tar/tmp-file-name) + ) + ((string-equal coding "quoted-printable") + (call-process tm-tar/mmencode-program nil nil nil "-u" "-q" + "-o" tm-tar/tar-file-name tm-tar/tmp-file-name) + ) + ((member coding mime-viewer/uuencode-encoding-name-list) + (call-process tm-tar/uudecode-program nil nil nil + tm-tar/tmp-file-name) + ) + (t + (copy-file tm-tar/tmp-file-name tm-tar/tar-file-name t) + )) + (delete-file tm-tar/tmp-file-name) + (setq tm-tar/list-args (list "-tvf" tm-tar/tar-file-name)) + (setq tm-tar/view-args (list "-xOf" tm-tar/tar-file-name)) + (if (eq 0 (call-process tm-tar/gzip-program + nil nil nil "-t" tm-tar/tar-file-name)) + (progn + (setq tm-tar/list-args + (append tm-tar/tar-compress-arg tm-tar/list-args)) + (setq tm-tar/view-args + (append tm-tar/tar-compress-arg tm-tar/view-args)) + )) + (switch-to-buffer tm-tar/view-buffer) + (switch-to-buffer tm-tar/list-buffer) + (setq buffer-read-only nil) + (erase-buffer) + (apply 'call-process tm-tar/tar-program + nil t nil tm-tar/list-args) + (mime/tm-tar/set-properties) + (mime/tm-tar-mode cur-buf) + (kill-buffer tm-tar/view-buffer) + (kill-buffer tm-tar/list-buffer) + (delete-file tm-tar/tar-file-name) + )) + +;;; @@ program/buffer coding system +;;; + +(cond ((boundp 'MULE) + (define-program-coding-system tm-tar/view-buffer nil *autoconv*) + ) + ((boundp 'NEMACS) + (define-program-kanji-code tm-tar/view-buffer nil 1) + )) + +;;; @@ message types to use tm-tar +;;; + +(set-atype 'mime/content-decoding-condition + '((type . "application/octet-stream") + (method . mime/decode-message/tar) + (mode . "play") ("type" . "tar") + )) + +(set-atype 'mime/content-decoding-condition + '((type . "application/octet-stream") + (method . mime/decode-message/tar) + (mode . "play") ("type" . "tar+gzip") + )) + +(set-atype 'mime/content-decoding-condition + '((type . "application/x-gzip") + (method . mime/decode-message/tar) + (mode . "play") ("type" . "tar") + )) + +(set-atype 'mime/content-decoding-condition + '((type . "application/x-tar") + (method . mime/decode-message/tar) + (mode . "play") + )) + +;;; @ end +;;; + +(provide 'tm-tar) + diff --git a/tm-view.el b/tm-view.el index 8f1cf53..2678325 100644 --- a/tm-view.el +++ b/tm-view.el @@ -21,7 +21,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 6.80 1995/09/09 08:54:54 morioka Exp $") + "$Id: tm-view.el,v 6.83 1995/09/20 14:19:42 morioka Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -96,7 +96,7 @@ (defvar mime-viewer/ignored-field-list '("Received" "Return-Path" "Replied" "Errors-To" "Lines" "Sender" "Path" "Nntp-Posting-Host" - "Content-Type" "Precedence")) + "Content-Type" "Precedence" "X-Face")) (defvar mime-viewer/ignored-field-regexp) @@ -113,8 +113,15 @@ "\\(\\." mime-viewer/file-name-char-regexp "+\\)*")) (defvar mime-viewer/announcement-for-message/partial - "[[ This is message/partial style split message. ]] -[[ Please press `v' key in this buffer. ]]") + (if (and (>= emacs-major-version 19) 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. ]]" + )) ;;; @@ predicate functions @@ -197,10 +204,33 @@ (function mime-viewer/default-content-subject-function)) -;;; @ content header filter +;;; @@ content header filter +;;; + +;;; @@@ X-Face ;;; +;; hack from Gnus 5.0.4. + +(defvar mime-viewer/x-face-command + "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -" + "String to be executed to display an X-Face field. +The command will be executed in a sub-shell asynchronously. +The compressed face will be piped to this command.") + +(defun mime-viewer/x-face-function () + "Function to display X-Face field. You can redefine to customize." + (goto-char (point-min)) + (if (re-search-forward "^X-Face:[ \t]*" nil t) + (let ((beg (match-end 0)) + (end (message/field-end)) + ) + (call-process-region beg end "sh" nil 0 nil + "-c" mime-viewer/x-face-command) + ))) + (defun mime-viewer/default-content-header-filter () + (mime-viewer/x-face-function) (goto-char (point-min)) (while (and (re-search-forward (concat "^" mime-viewer/ignored-field-regexp ":") @@ -605,6 +635,10 @@ it is regarded as current-buffer. [tm-view]" (let (be) (switch-to-buffer obuf) (save-restriction + (goto-char (point-max)) + (if (not (search-backward "\n\n" nil t)) + (insert "\n") + ) (setq be (point-max)) (narrow-to-region be be) (insert diff --git a/tm-w3.el b/tm-w3.el new file mode 100644 index 0000000..485b8a1 --- /dev/null +++ b/tm-w3.el @@ -0,0 +1,44 @@ +;;; +;;; tm-w3.el: a tm-view internal decoder for HTML +;;; +;;; by MORIOKA Tomohiko (1995/09/14) +;;; +;;; based on tm-latex.el by OKABE Yasuo +;;; +;;; $Id: tm-w3.el,v 1.1 1995/09/14 15:51:57 morioka Exp $ +;;; + +(require 'tm-view) + +(autoload 'w3-mode "w3" "HTML viewer" t) + +(defvar mime-viewer/html-default-mode (function w3-mode)) + +(defun mime-viewer/decode-html (beg end cal) + (let* ((cur-buf (current-buffer)) + new-buf + (name (or (cdr (assoc "name" cal)) + (cdr (assoc "x-name" cal)) + (concat (make-temp-name "tm") ".html")))) + (switch-to-buffer mime::article/preview-buffer) + (funcall mime/find-file-function (expand-file-name name mime/tmp-dir)) + (if (or (<= (buffer-size) 0) + (y-or-n-p "Replace the existing buffer?")) + (progn + (erase-buffer) + (setq new-buf (current-buffer)) + (save-excursion + (set-buffer cur-buf) + (goto-char beg) + (re-search-forward "^$") + (append-to-buffer new-buf (+ (match-end 0) 1) end) + ))) + (call-interactively mime-viewer/html-default-mode) + )) + +(set-atype 'mime/content-decoding-condition + '((type . "text/html") + (method . mime-viewer/decode-html) + )) + +(provide 'tm-w3) -- 1.7.10.4