From ac4443ef55190936e3a390644f0964b389e2582e Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 2 Mar 1998 14:34:46 +0000 Subject: [PATCH] tm 6.15 --- Makefile | 25 +++++++-------- README.eng | 9 +++++- mh-e/Makefile | 2 +- mh-e/tm-mh-e.el | 71 ++++++++++++++++++++++++++++++++++++++++--- rel-6eng.ol | 25 +++++++++++++++ rel-6jp.ol | 22 ++++++++++++++ tiny-mime.el | 6 ++-- tm-comp.el | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++----- tm-setup.el | 6 +++- tm-view.el | 89 ++++++++++++++++++++++++++++------------------------- 10 files changed, 276 insertions(+), 70 deletions(-) diff --git a/Makefile b/Makefile index 7535946..ed0293e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 3.0 1995/04/17 19:06:08 morioka Exp morioka $ +# $Id: Makefile,v 4.0 1995/04/18 12:35:44 morioka Exp morioka $ # # Please specify emacs executables: @@ -38,7 +38,7 @@ FILES = tm/README.eng tm/rel-*.ol tm/Makefile tm/Makefile.bc \ tm/mh-e/Makefile tm/mh-e/Makefile.bc tm/mh-e/*.el \ tl/README.eng tl/Makefile tl/Makefile.bc tl/*.el tl/doc/*.texi -TARFILE = tm6.14.tar +TARFILE = tm6.15.tar nemacs: @@ -62,25 +62,26 @@ install-mule1: mule1 orig19: make -f Makefile.bc all \ EMACS=$(ORIG19) EMACS_TYPE=orig TLSRCDIR=$(TLSRCDIR) - (cd gnus; make orig19) - (cd mh-e; make orig19) + (cd gnus; make orig19 ORIG19=$(ORIG19)) + (cd mh-e; make orig19 ORIG19=$(ORIG19)) -install-orig19: orig19 +install-orig19: orig19 install-gnus4-mh-e4 make -f Makefile.bc install TMDIR=$(TMDIR19) EMACS_TYPE=orig - (cd gnus; make install-19) - (cd mh-e; make install-19) mule2: make -f Makefile.bc all \ EMACS=$(MULE2) EMACS_TYPE=mule TLSRCDIR=$(TLSRCDIR) - (cd gnus; make mule2) - (cd mh-e; make mule2) + (cd gnus; make mule2 MULE2=$(MULE2)) + (cd mh-e; make mule2 MULE2=$(MULE2)) -install-mule2: mule2 +install-mule2: mule2 install-gnus4-mh-e4 make -f Makefile.bc install TMDIR=$(TMDIR19) EMACS_TYPE=mule - (cd gnus; make install-19) - (cd mh-e; make install-19) + + +install-gnus4-mh-e4: + (cd gnus; make install-19 TMDIR19=$(TMDIR19)) + (cd mh-e; make install-19 TMDIR19=$(TMDIR19)) all: $(UTILS) $(DVI) diff --git a/README.eng b/README.eng index f40f3e8..ab7c3aa 100644 --- a/README.eng +++ b/README.eng @@ -1,6 +1,6 @@ [README for tm (English Version)] by MORIOKA Tomohiko -$Id: README.eng,v 1.2 1995/02/09 15:47:58 morioka Exp $ +$Id: README.eng,v 1.2 1995/02/09 15:47:58 morioka Exp morioka $ 1 What's tm? @@ -42,6 +42,13 @@ Tm has following modules: - tm-gnus : tm-MUA for GNUS - tm-rmail : tm-MUA for RMAIL - tm-vm : tm-MUA for vm + - extender for tm-view + - tm-partial : automatic assembler for message/partial + - tm-ftp : for anonymous ftp + - tm-rich : for text/enriched and text/richtext + - tm-comp : extender for mime.el (big message automatic + splitter, previewer using tm-view, uuencode + supporter) - tm-setup: set up module for tm-MUAs - mime-setup: set up module for MIME diff --git a/mh-e/Makefile b/mh-e/Makefile index dbc4f79..bf44b36 100644 --- a/mh-e/Makefile +++ b/mh-e/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.1 1995/01/10 12:28:01 morioka Exp $ +# $Id: Makefile,v 1.1 1995/01/10 12:28:01 morioka Exp morioka $ # # Please specify emacs executables: diff --git a/mh-e/tm-mh-e.el b/mh-e/tm-mh-e.el index 41bf7b7..985e4ed 100644 --- a/mh-e/tm-mh-e.el +++ b/mh-e/tm-mh-e.el @@ -5,8 +5,6 @@ ;;; modified by YAMAOKA Katsumi ;;; -(provide 'tm-mh-e) - ;;; @ require modules ;;; @@ -22,7 +20,7 @@ ;;; @ version ;;; (defconst tm-mh-e/RCS-ID - "$Id: tm-mh-e.el,v 6.0 1995/04/12 11:46:08 morioka Exp $") + "$Id: tm-mh-e.el,v 6.1 1995/04/18 16:49:45 morioka Exp $") (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) @@ -50,18 +48,78 @@ With arg, turn MIME processing on if arg is positive." (mh-invalidate-show-buffer) (mh-show-msg (mh-get-msg-num t)) (pop-to-buffer mh-show-buffer t) - ;; patch for mh-narrow.el ;; by YAMAOKA Katsumi (if (featurep 'mh-narrow) (widen) ) ;; end of patch - (mime/viewer-mode) ) +;;; @ for tm-comp +;;; +(defun tm-mh-e::make-message (folder number) + (vector folder number) + ) + +(defun tm-mh-e::message/folder (message) + (elt message 0) + ) + +(defun tm-mh-e::message/number (message) + (elt message 1) + ) + +(defun tm-mh-e::message/file-name (message) + (expand-file-name + (tm-mh-e::message/number message) + (mh-expand-file-name (tm-mh-e::message/folder message)) + )) + +(defun tm-mh-e::prompt-for-message (prompt folder &optional default) + (let ((files + (directory-files (mh-expand-file-name folder) nil "^[0-9]+$") + )) + (completing-read prompt + (let ((i 0)) + (mapcar (function + (lambda (file) + (setq i (+ i 1)) + (list file i) + )) + files) + )) + )) + +(defun tm-mh-e::query-message () + (let* ((folder (mh-prompt-for-folder "Visit" "+inbox" nil)) + (number (tm-mh-e::prompt-for-message "Number?" folder)) + ) + (tm-mh-e::make-message folder number) + )) + +(defun tm-mh-e::insert-message (&optional message) + (if (null message) + (setq message (tm-mh-e::query-message)) + ) + (insert-file (tm-mh-e::message/file-name message)) + ) + +(if (featurep 'tm-comp) + (set-alist 'tm-comp/message-inserter-alist + 'mh-letter-mode (function tm-mh-e::insert-message)) + (add-hook 'tm-comp-load-hook + (function + (lambda () + (set-alist + 'tm-comp/message-inserter-alist + 'mh-letter-mode (function tm-mh-e::insert-message)) + ))) + ) + + ;;; @ set up ;;; @@ -87,3 +145,6 @@ With arg, turn MIME processing on if arg is positive." (interactive) (scroll-other-window -1) ))) + + +(provide 'tm-mh-e) diff --git a/rel-6eng.ol b/rel-6eng.ol index 8a2fcd1..f0a07db 100644 --- a/rel-6eng.ol +++ b/rel-6eng.ol @@ -1,3 +1,28 @@ +* tm/Makefile + + Not only do `make mule2' or `make orig19' compile normal tm modules +but also tm-mh-e and tm-gnus. + + Similarly, not only do `make install-mule2' or `make install-orig19' +install normal tm modules but also tm-mh-e and tm-gnus. + + +* tm-comp + +** message/rfc822 + + We add a message/rfc822 style message inserting command. Its +function name is `tm-comp/insert-message', standard key bind is `C-c +C-x m'. + + Function `tm-comp/insert-message' requires message-inserter function +for your MUA. message-inserter functions are registerd at variable +`tm-comp/message-inserter-alist' which is a assoc-list whose element +is a pair that major-mode is key and message-inserter function is value. + + Now, tm-mh-e is a only implementation for this function. + + * changed points of tm-view Internal structure of tm-view 6.* is changed from tm-view 5.21, such diff --git a/rel-6jp.ol b/rel-6jp.ol index 2cfa6c6..dca39f1 100644 --- a/rel-6jp.ol +++ b/rel-6jp.ol @@ -1,3 +1,25 @@ +* tm/Makefile + + Emacs 19.* (Mule 2.*) では、tm の {byte-compile | install} を行う際 +に、tm-mh-e, tm-gnus の {byte-compile | install} も行います。 + + +* tm-comp + +** message/rfc822 + + MUA が保存している message を message/rfc822 形式で取り込むものを追 +加しました。関数名は tm-comp/insert-message で、標準の key bind は C-c +C-x m です。 + + 関数 tm-comp/insert-message は MUA 毎の message-inserter 関数を必要 +とします。message-inserter は変数 tm-comp/message-inserter-alist に登 +録されます。この変数は、major-mode が key で、それに対する値が +message-inserter 関数である連想リスト構造をしています。 + + 現在のところ、tm-mh-e のみ、この機能を実装しています。 + + * tm-view の変更点について tm-view 6.* では内部構造が変更され、データ構造や symbol 名などが変更 diff --git a/tiny-mime.el b/tiny-mime.el index 2ee7982..d017434 100644 --- a/tiny-mime.el +++ b/tiny-mime.el @@ -21,7 +21,7 @@ ;;; @ version ;;; (defconst mime/RCS-ID - "$Id: tiny-mime.el,v 5.10 1995/01/09 18:56:42 morioka Exp $") + "$Id: tiny-mime.el,v 5.11 1995/04/18 12:28:22 morioka Exp $") (defconst mime/tiny-mime-version (get-version-string mime/RCS-ID)) @@ -82,7 +82,9 @@ (defun mime/rest-of-string (str) (if (stringp str) (substring str (match-end 0)) - (buffer-substring (match-end 0)))) + (buffer-substring (match-end 0)(point-max)) + )) + ;;; @ variables ;;; diff --git a/tm-comp.el b/tm-comp.el index 3c74b92..32ff347 100644 --- a/tm-comp.el +++ b/tm-comp.el @@ -7,11 +7,14 @@ ;;; MORIOKA Tomohiko, ;;; Kazushi (Jam) MARUKAWA , ;;; OKABE Yasuo, -;;; and Shuhei KOBAYASHI +;;; KOBAYASHI Shuhei , +;;; and YAMAOKA Katsumi +;;; -(provide 'tm-comp) (require 'tm-misc) +(require 'tm-view) (require 'tl-header) +(require 'tl-list) (require 'mail-utils) @@ -19,7 +22,7 @@ ;;; (defconst mime/composer-RCS-ID - "$Id: tm-comp.el,v 5.1 1995/04/17 18:52:07 morioka Exp $") + "$Id: tm-comp.el,v 6.3 1995/04/18 16:38:42 morioka Exp $") (defconst mime/composer-version (get-version-string mime/composer-RCS-ID)) @@ -171,6 +174,8 @@ (and (fboundp 'bury-buffer) (bury-buffer)))) )) +(defvar tm-comp/message-inserter-alist nil) + ;;; @ edit ;;; @@ -237,6 +242,18 @@ Optional argument ENCODING specifies an encoding method such as base64." )) +(defun tm-comp/insert-message (&optional message) + (interactive) + (let ((inserter (assoc-value major-mode tm-comp/message-inserter-alist))) + (if (and inserter (fboundp inserter)) + (progn + (mime-insert-tag "message" "rfc822") + (funcall inserter message) + ) + (message "Sorry, I don't have message inserter for your MUA.") + ))) + + ;;; @ split ;;; @@ -370,15 +387,70 @@ Optional argument ENCODING specifies an encoding method such as base64." (fset 'mime-mode-exit-and-run 'tm-comp::mime-mode-exit-and-run) )) + (define-key (lookup-key (current-local-map) mime-prefix) + "m" 'tm-comp/insert-message) ))) -(autoload 'mime/viewer-mode "tm-view" nil t) + +;;; @ draft preview +;;; +;; by "OKABE Yasuo +;; Mon, 10 Apr 1995 20:03:07 +0900 + +(defvar mime/draft-header-separator-alist + '((news-reply-mode . mail-header-separator) + (mh-letter-mode . mail-header-separator) + )) + +(defvar mime::article/draft-header-separator nil) (defun mime/draft-preview () (interactive) - (goto-char (point-min)) - (mime/viewer-mode) - (pop-to-buffer (current-buffer))) + (let ((sep (assoc-value major-mode mime/draft-header-separator-alist))) + (or (stringp sep) (setq sep (eval sep))) + (make-variable-buffer-local 'mime::article/draft-header-separator) + (goto-char (point-min)) + (re-search-forward + (concat "^\\(" (regexp-quote sep) "\\)?$")) + (setq mime::article/draft-header-separator + (buffer-substring (match-beginning 0) (match-end 0))) + (replace-match "") + (mime/viewer-mode (current-buffer)) + (pop-to-buffer (current-buffer)) + )) + +(defun mime-viewer::quitting-method/draft-preview () + (let ((mother mime/mother-buffer)) + (save-excursion + (switch-to-buffer mother) + (goto-char (point-min)) + (if (and + (re-search-forward + (concat "^\\(" + (regexp-quote mime::article/draft-header-separator) + "\\)?$") nil t) + (bolp)) + (progn + (insert mime::article/draft-header-separator) + (set-buffer-modified-p (buffer-modified-p)) + ))) + (mime-viewer/kill-buffer) + (pop-to-buffer mother) + )) + +(set-alist 'mime-viewer/quitting-method-alist + 'mh-letter-mode + (function mime-viewer::quitting-method/draft-preview) + ) + +(set-alist 'mime-viewer/quitting-method-alist + 'news-reply-mode + (function mime-viewer::quitting-method/draft-preview) + ) + + +;;; @ etc +;;; (defun message/get-header-string-except (pat boundary) (save-excursion @@ -410,3 +482,8 @@ Optional argument ENCODING specifies an encoding method such as base64." ?_ arg)))) str "") ) + + +(run-hooks 'tm-comp-load-hook) + +(provide 'tm-comp) diff --git a/tm-setup.el b/tm-setup.el index 70176ef..5101186 100644 --- a/tm-setup.el +++ b/tm-setup.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tm-setup.el,v 5.1 1995/01/10 02:02:51 morioka Exp $ +;;; $Id: tm-setup.el,v 6.0 1995/04/18 19:40:11 morioka Exp $ ;;; (provide 'tm-setup) @@ -18,6 +18,10 @@ (add-hook 'tm-view-load-hook (function (lambda () + ;; for message/partial + (require 'tm-partial) + + ;; for LaTeX (set-atype 'mime/content-decoding-condition '((type . "text/x-latex") (method . mime/decode-text/latex) diff --git a/tm-view.el b/tm-view.el index b64ed21..bd0d0a8 100644 --- a/tm-view.el +++ b/tm-view.el @@ -21,7 +21,7 @@ ;;; (defconst mime-viewer/RCS-ID - "$Id: tm-view.el,v 6.14 1995/04/12 11:52:34 morioka Exp morioka $") + "$Id: tm-view.el,v 6.15 1995/04/18 16:48:08 morioka Exp $") (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID)) (defconst mime/viewer-version mime-viewer/version) @@ -153,45 +153,54 @@ "text/x-latex" "application/x-latex" "application/octet-stream" nil)) +(defvar mime-viewer/decoding-mode "play" "MIME body decoding mode") + + +;;; @@ quitting +;;; + +(defun mime::viewer/quitting-method-for-gnus4 () + (mime-viewer/kill-buffer) + (delete-other-windows) + (gnus-article-show-summary) + ) + +(defun mime::viewer/quitting-method-for-rmail () + (mime-viewer/kill-buffer) + (rmail-summary) + (delete-other-windows) + ) + +(defun mime::viewer/quitting-method-for-mh-e () + (let ((win (get-buffer-window + mime/output-buffer-name)) + (buf + (mime::preview-content-info/buffer + (car mime::preview/content-list))) + ) + (if win + (delete-window win) + ) + (mime-viewer/kill-buffer) + (pop-to-buffer + (let ((name (buffer-name buf))) + (string-match "show-" name) + (substring name (match-end 0)) + )) + ;; patch for mh-narrow.el + ;; by YAMAOKA Katsumi + (if (and (featurep 'mh-narrow) + (fboundp 'mh-narrow-to-page)) + (save-excursion + (set-buffer mh-show-buffer) + (mh-narrow-to-page))) + ;; end of patch + )) + (defvar mime-viewer/quitting-method-alist - '((gnus-article-mode - . (lambda () - (mime-viewer/kill-buffer) - (delete-other-windows) - (gnus-article-show-summary) - )) - (rmail-mode - . (lambda () - (mime-viewer/kill-buffer) - (rmail-summary) - (delete-other-windows) - )) - (mh-show-mode - . (lambda () - (let ((win (get-buffer-window - mime/output-buffer-name)) - (buf - (mime::preview-content-info/buffer - (car mime::preview/content-list))) - ) - (if win - (delete-window win) - ) - (mime-viewer/kill-buffer) - (pop-to-buffer - (let ((name (buffer-name buf))) - (string-match "show-" name) - (substring name (match-end 0)) - )) - ;; patch for mh-narrow.el - ;; by YAMAOKA Katsumi - (if (and (featurep 'mh-narrow) - (fboundp 'mh-narrow-to-page)) - (save-excursion - (set-buffer mh-show-buffer) - (mh-narrow-to-page))) - ;; end of patch - ))) + '((gnus-article-mode . mime::viewer/quitting-method-for-gnus4) + (rmail-mode . mime::viewer/quitting-method-for-rmail) + (mh-show-mode . mime::viewer/quitting-method-for-mh-e) (mime/show-message-mode . (lambda () (set-window-configuration @@ -207,8 +216,6 @@ ))) )) -(defvar mime-viewer/decoding-mode "play" "MIME body decoding mode") - ;;; @ data structure ;;; -- 1.7.10.4