tm 7.25.
authormorioka <morioka>
Mon, 9 Mar 1998 11:34:57 +0000 (11:34 +0000)
committermorioka <morioka>
Mon, 9 Mar 1998 11:34:57 +0000 (11:34 +0000)
14 files changed:
Changes-7.25.en [new file with mode: 0644]
Changes-7.25.ja [new file with mode: 0644]
Makefile
gnus/Makefile
gnus/tm-gnus5.el
gnus/tm-sgnus.el
mh-e/Makefile
mh-e/tm-mh-e.el
mk-tm
tm-def.el
tm-edit.el
tm-parse.el
tm-view.el
tm-vm.el

diff --git a/Changes-7.25.en b/Changes-7.25.en
new file mode 100644 (file)
index 0000000..5dd7fa1
--- /dev/null
@@ -0,0 +1,102 @@
+* tl
+
+  Attached version 7.01.6.
+
+
+* tm
+
+tm-def.el
+----------------------------
+revision 7.3
+date: 1995/11/15 14:21:50;  author: morioka;  state: Exp;  lines: +5 -3
+fixed problem of function `tm:add-fields' and `tm:delete-fields'.
+----------------------------
+
+tm-edit.el
+----------------------------
+revision 7.25
+date: 1995/11/15 14:17:09;  author: morioka;  state: Exp;  lines: +6 -4
+(1) fixed problem of initialize of variable
+    `mime-editor/yank-ignored-field-regexp'.
+(2) In function `mime-viewer::quitting-method/draft-preview', it was
+    fixed problem of renaming mistake `mime/mother-buffer' ->
+    `mime::preview/mother-buffer'.
+----------------------------
+
+tm-parse.el
+----------------------------
+revision 6.0
+date: 1995/11/15 11:56:10;  author: morioka;  state: Exp;  lines: +15 -12
+According to KOBAYASHI Shuuhei <shuhei@cmpt01.phys.tohoku.ac.jp>, I
+fixed error of function `mime/parse-multipart'.
+----------------------------
+
+tm-view.el
+----------------------------
+revision 7.25
+date: 1995/11/15 13:57:33;  author: morioka;  state: Exp;  lines: +4 -2
+fixed problem of initialize of variable
+`mime-viewer/ignored-field-regexp'.
+----------------------------
+
+tm-vm.el
+----------------------------
+revision 7.7
+date: 1995/11/15 15:35:54;  author: morioka;  state: Exp;  lines: +101 -61
+Function `tm-vm/preview-current-message' was modified based of Simon
+Rowe <smr@robots.oxford.ac.uk>'s code. (c.f. [tm-eng:163])
+----------------------------
+revision 7.6
+date: 1995/11/15 10:20:05;  author: morioka;  state: Exp;  lines: +28 -5
+applied KOBAYASHI Shuuhei <shuhei@cmpt01.phys.tohoku.ac.jp>'s patch.
+(c.f. [tm ML:1102])
+----------------------------
+revision 7.5
+date: 1995/11/15 09:06:19;  author: morioka;  state: Exp;  lines: +38 -31
+applied Oscar Figueiredo <figueire@lspsun2.epfl.ch>'s modification.
+----------------------------
+
+
+* tm/mh-e
+
+  Attached version 7.20.
+
+tm-mh-e.el
+----------------------------
+revision 7.20
+date: 1995/11/15 12:45:44;  author: morioka;  state: Exp;  lines: +3 -3
+Function `tm-mh-e/mh-forward' was renamed to `tm-mh-e/forward'.
+----------------------------
+revision 7.19
+date: 1995/11/15 12:37:25;  author: morioka;  state: Exp;  lines: +82 -1
+New function `tm-mh-e/mh-forward' by OKABE Yasuo
+<okabe@kudpc.kyoto-u.ac.jp>. (c.f. [tm ML:1099])
+----------------------------
+revision 7.18
+date: 1995/11/15 12:25:25;  author: morioka;  state: Exp;  lines: +28 -14
+applied OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>'s modification.
+(c.f. [tm ML:1096])
+----------------------------
+
+
+* tm/gnus
+
+  Attached version 7.16.
+
+tm-gnus5.el
+----------------------------
+revision 7.9
+date: 1995/11/15 10:41:02;  author: morioka;  state: Exp;  lines: +4 -3
+According to Masahiro MURATA <murata@sol.cs.ritsumei.ac.jp>, I fixed
+problem of function `tm-gnus/summary-toggle-header'.
+(c.f. [tm ML:1104])
+----------------------------
+
+tm-sgnus.el
+----------------------------
+revision 7.16
+date: 1995/11/15 10:36:09;  author: morioka;  state: Exp;  lines: +4 -3
+According to Masahiro MURATA <murata@sol.cs.ritsumei.ac.jp>, I fixed
+problem of function `tm-gnus/summary-toggle-header'.
+(c.f. [tm ML:1104])
+----------------------------
diff --git a/Changes-7.25.ja b/Changes-7.25.ja
new file mode 100644 (file)
index 0000000..3d4bbee
--- /dev/null
@@ -0,0 +1,101 @@
+* tl
+
+  Version 7.01.6 \e$B$rE:IU$7$?!#\e(B
+
+
+* tm
+
+tm-def.el
+----------------------------
+revision 7.3
+date: 1995/11/15 14:21:50;  author: morioka;  state: Exp;  lines: +5 -3
+\e$B4X?t\e(B tm:add-fields \e$B$H4X?t\e(B tm:delete-fields \e$B$NIT6q9g$r=$@5$7$?!#\e(B
+----------------------------
+
+tm-edit.el
+----------------------------
+revision 7.25
+date: 1995/11/15 14:17:09;  author: morioka;  state: Exp;  lines: +6 -4
+(1) \e$BJQ?t\e(B mime-editor/yank-ignored-field-regexp \e$B$N=i4|2=$K$*$1$kIT6q9g\e(B
+    \e$B$r=$@5$7$?!#\e(B
+(2) \e$B4X?t\e(B mime-viewer::quitting-method/draft-preview \e$B$K$*$$$F!"JQ?t\e(B
+    mime/mother-buffer \e$B$r\e(B `mime::preview/mother-buffer' \e$B$K2~L>$7K:$l$F\e(B
+    \e$B$$$?$N$r=$@5$7$?!#\e(B
+----------------------------
+
+tm-parse.el
+----------------------------
+revision 6.0
+date: 1995/11/15 11:56:10;  author: morioka;  state: Exp;  lines: +15 -12
+\e$B>.NS\e(B \e$B=$J?\e(B <shuhei@cmpt01.phys.tohoku.ac.jp> \e$B$5$s$N;XE&$K=>$$!"4X?t\e(B
+mime/parse-multipart \e$B$N8m$j$r=$@5$7$?!#\e(B
+----------------------------
+
+tm-view.el
+----------------------------
+revision 7.25
+date: 1995/11/15 13:57:33;  author: morioka;  state: Exp;  lines: +4 -2
+\e$BJQ?t\e(B mime-viewer/ignored-field-regexp \e$B$N=i4|2=$K$*$1$k8m$j$r=$@5$7$?!#\e(B
+----------------------------
+
+tm-vm.el
+----------------------------
+revision 7.7
+date: 1995/11/15 15:35:54;  author: morioka;  state: Exp;  lines: +101 -61
+[tm-eng:163] \e$B$K$*$1$k\e(B Simon Rowe <smr@robots.oxford.ac.uk> \e$B$5$s$N\e(B code
+\e$B$r$b$H$K4X?t\e(B tm-vm/preview-current-message \e$B$r=$@5$7$?!#\e(B
+----------------------------
+revision 7.6
+date: 1995/11/15 10:20:05;  author: morioka;  state: Exp;  lines: +28 -5
+\e$B>.NS\e(B \e$B=$J?\e(B <shuhei@cmpt01.phys.tohoku.ac.jp> \e$B$5$s$N\e(B patch \e$B$rEv$F$?!#\e(B
+(c.f. [tm ML:1102])
+----------------------------
+revision 7.5
+date: 1995/11/15 09:06:19;  author: morioka;  state: Exp;  lines: +38 -31
+Oscar Figueiredo <figueire@lspsun2.epfl.ch> \e$B$5$s$N=$@5$r2C$($?!#\e(B
+----------------------------
+
+
+* tm/mh-e
+
+  Version 7.20 \e$B$rE:IU$7$?!#\e(B
+
+tm-mh-e.el
+----------------------------
+revision 7.20
+date: 1995/11/15 12:45:44;  author: morioka;  state: Exp;  lines: +3 -3
+\e$B4X?t\e(B tm-mh-e/mh-forward \e$B$r\e(B `tm-mh-e/forward' \e$B$K2~L>$7$?!#\e(B
+----------------------------
+revision 7.19
+date: 1995/11/15 12:37:25;  author: morioka;  state: Exp;  lines: +82 -1
+\e$B2,It\e(B \e$B<wCK\e(B <okabe@kudpc.kyoto-u.ac.jp> \e$B$5$s$N:n$N4X?t\e(B 
+tm-mh-e/mh-forward \e$B$rDI2C$7$?!#\e(B(c.f. [tm ML:1099])
+----------------------------
+revision 7.18
+date: 1995/11/15 12:25:25;  author: morioka;  state: Exp;  lines: +28 -14
+[tm ML:1096] \e$B$G$N!"2,It!!<wCK\e(B <okabe@kudpc.kyoto-u.ac.jp> \e$B$5$s$N=$@5$r\e(B
+\e$B:N$jF~$l$k!#\e(B
+----------------------------
+
+
+* tm/gnus
+
+  Version 7.16 \e$B$rE:IU$7$?!#\e(B
+
+tm-gnus5.el
+----------------------------
+revision 7.9
+date: 1995/11/15 10:41:02;  author: morioka;  state: Exp;  lines: +4 -3
+[tm ML:1104] \e$B$K$*$1$k!"B<EDA442\e(B (Masahiro MURATA)
+<murata@sol.cs.ritsumei.ac.jp> \e$B$5$s$N;XE&$K=>$$!"4X?t\e(B
+tm-gnus/summary-toggle-header \e$B$NIT6q9g$r=$@5$7$?!#\e(B
+----------------------------
+
+tm-sgnus.el
+----------------------------
+revision 7.16
+date: 1995/11/15 10:36:09;  author: morioka;  state: Exp;  lines: +4 -3
+[tm ML:1104] \e$B$K$*$1$k!"B<EDA442\e(B (Masahiro MURATA)
+<murata@sol.cs.ritsumei.ac.jp> \e$B$5$s$N;XE&$K=>$$!"4X?t\e(B
+tm-gnus/summary-toggle-header \e$B$NIT6q9g$r=$@5$7$?!#\e(B
+----------------------------
index a62acba..c69ddba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,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.24.tar.gz
+TARFILE = tm7.25.tar.gz
 
 
 nemacs:
index 061bfd9..60cef77 100644 (file)
@@ -17,7 +17,7 @@ TMDIR19 = $(HOME)/lib/emacs19/lisp
 
 FILES  = tm/gnus/*.el tm/doc/tm-gnus*.texi
 
-TARFILE = tm-gnus7.15.tar
+TARFILE = tm-gnus7.16.tar
 
 
 gnus3:
index f92c6a0..25b1443 100644 (file)
@@ -22,7 +22,7 @@
 ;;;
 
 (defconst tm-gnus/RCS-ID
-  "$Id: tm-gnus5.el,v 7.8 1995/11/10 10:07:15 morioka Exp $")
+  "$Id: tm-gnus5.el,v 7.9 1995/11/15 10:41:02 morioka Exp $")
 
 (defconst tm-gnus/version
   (concat (get-version-string tm-gnus/RCS-ID) " for GNUS 5.0.x"))
@@ -81,7 +81,7 @@ This variable is set to `gnus-show-mime'.")
                 (set-buffer gnus-article-buffer)
                 (gnus-fetch-field "Mime-Version")
                 )))
-      (let ((mime-viewer/ignored-field-list
+      (let ((mime-viewer/ignored-field-regexp
             (if (save-excursion
                   (set-buffer gnus-article-buffer)
                   (some-element
@@ -89,7 +89,8 @@ This variable is set to `gnus-show-mime'.")
                      (rfc822/get-field-body field)
                      )
                    mime-viewer/ignored-field-list))
-                mime-viewer/ignored-field-list)))
+                mime-viewer/ignored-field-regexp
+              "^:$")))
        (gnus-summary-select-article t t)
        )
     (gnus-summary-toggle-header arg)
index 23afbaa..c253d00 100644 (file)
@@ -21,7 +21,7 @@
 ;;;
 
 (defconst tm-gnus/RCS-ID
-  "$Id: tm-sgnus.el,v 7.15 1995/11/13 09:29:19 morioka Exp $")
+  "$Id: tm-sgnus.el,v 7.16 1995/11/15 10:36:09 morioka Exp $")
 
 (defconst tm-gnus/version
   (concat (get-version-string tm-gnus/RCS-ID) " for September"))
@@ -70,7 +70,7 @@ This variable is set to `gnus-show-mime'.")
                 (set-buffer gnus-article-buffer)
                 (gnus-fetch-field "Mime-Version")
                 )))
-      (let ((mime-viewer/ignored-field-list
+      (let ((mime-viewer/ignored-field-regexp
             (if (save-excursion
                   (set-buffer gnus-article-buffer)
                   (some-element
@@ -78,7 +78,8 @@ This variable is set to `gnus-show-mime'.")
                      (rfc822/get-field-body field)
                      )
                    mime-viewer/ignored-field-list))
-                mime-viewer/ignored-field-list)))
+                mime-viewer/ignored-field-regexp
+              "^:$")))
        (gnus-summary-select-article t t)
        )
     (gnus-summary-toggle-header arg)
index d5f98c8..448bc11 100644 (file)
@@ -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.17.tar
+TARFILE = tm-mh-e7.20.tar
 
 
 elc:
index 9907f71..559388e 100644 (file)
@@ -5,6 +5,7 @@
 ;;; Copyright (C) 1993,1994,1995 MORIOKA Tomohiko
 ;;;
 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;;         OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
 ;;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -26,7 +27,7 @@
 ;;;
 
 (defconst tm-mh-e/RCS-ID
-  "$Id: tm-mh-e.el,v 7.17 1995/11/14 06:29:27 morioka Exp $")
+  "$Id: tm-mh-e.el,v 7.20 1995/11/15 12:45:44 morioka Exp $")
 
 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
 
@@ -289,18 +290,30 @@ With arg, turn MIME processing on if arg is positive."
    (tm-mh-e::message/number message)
    (mh-expand-file-name (tm-mh-e::message/folder message))
    ))
-  
+
+;;; modified by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
+;;;    1995/11/14 (c.f. [tm ML:1096])
 (defun tm-mh-e/prompt-for-message (prompt folder &optional default)
-  (let ((files
-        (directory-files (mh-expand-file-name folder) nil "^[0-9]+$")
-        )
-       (default (and (boundp 'mh-sent-from-msg) mh-sent-from-msg))
-       )
-    (setq default
-         (if default
-             (int-to-string default)
-           (car files)
-           ))
+  (let* ((files
+         (directory-files (mh-expand-file-name folder) nil "^[0-9]+$")
+         )
+        (folder-buf (get-buffer folder))
+        (default
+          (if folder-buf
+              (save-excursion
+                (set-buffer folder-buf)
+                (let ((show-buffer (get-buffer mh-show-buffer)))
+                  (if show-buffer
+                      (file-name-nondirectory
+                       (buffer-file-name show-buffer))
+                    ))))))
+    (if (or (null default)
+           (not (string-match "^[0-9]+$" default)))
+       (setq default
+             (if (string= folder mh-sent-from-folder)
+                 (int-to-string mh-sent-from-msg)
+               (car files)
+               )))
     (completing-read prompt
                     (let ((i 0))
                       (mapcar (function
@@ -313,11 +326,86 @@ With arg, turn MIME processing on if arg is positive."
     ))
 
 (defun tm-mh-e/query-message ()
-  (let* ((folder (mh-prompt-for-folder "Visit" "+inbox" nil))
-        (number (tm-mh-e/prompt-for-message "Number: " folder))
+  (let* ((folder (mh-prompt-for-folder
+                 "Message from" (or mh-sent-from-folder "+inbox") nil))
+        (number (tm-mh-e/prompt-for-message "Message number: " folder))
         )
     (tm-mh-e::make-message folder number)
     ))
+;;; end
+
+;;; by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
+;;;    1995/11/14 (c.f. [tm ML:1099])
+(defun tm-mh-e/forward (to cc &optional msg-or-seq)
+  "Forward a message or message sequence as MIME multipart/digest.
+Defaults to displayed message. If optional prefix argument provided,
+then prompt for the message sequence. See also documentation for
+`\\[mh-send]' function."
+  (interactive (list (mh-read-address "To: ")
+                    (mh-read-address "Cc: ")
+                    (if current-prefix-arg
+                        (mh-read-seq-default "Forward" t)
+                        (mh-get-msg-num t))))
+  (or msg-or-seq
+      (setq msg-or-seq (mh-get-msg-num t)))
+  (if (numberp msg-or-seq)
+      (setq msg-or-seq (int-to-string msg-or-seq)))
+  (let* ((folder mh-current-folder)
+        (config (current-window-configuration))
+        ;; use "draft" for compatibility with forw.
+        ;; forw always leaves file in "draft" since it doesn't have -draft
+        (draft-name (expand-file-name "draft" mh-user-path))
+        (draft (cond ((or (not (file-exists-p draft-name))
+                          (y-or-n-p "The file 'draft' exists.  Discard it? "))
+                      (mh-exec-cmd "comp"
+                                   "-noedit" "-nowhatnowproc"
+                                   "-nodraftfolder")
+                      (prog1
+                          (mh-read-draft "" draft-name t)
+                        (mh-insert-fields "To:" to "Cc:" cc)
+                        (set-buffer-modified-p nil)))
+                     (t
+                      (mh-read-draft "" draft-name nil)))))
+    (let (orig-from
+         orig-subject)
+      (goto-char (point-min))
+      (save-excursion
+       (save-restriction
+         (re-search-forward "^-*\n")
+         (insert "--<<digest>>-{\n")
+         (mh-exec-cmd-output "pick" nil folder msg-or-seq)
+         (narrow-to-region (point) (mark t))
+         (while (re-search-forward "^\\([0-9]+\\)\n" nil t)
+           (let ((forw-msg
+                  (buffer-substring (match-beginning 1) (match-end 1))))
+             (replace-match "--[[message/rfc822]]\n" nil nil)
+             (insert-file (mh-expand-file-name
+                           forw-msg (mh-expand-file-name folder)))
+             (if (not (bolp)) (insert "\n"))
+             (mime-editor/inserted-message-filter))
+           (goto-char (mark t)))
+         (insert-string "--}-<<digest>>")))
+      (re-search-forward "^--\\[\\[message/rfc822\\]")
+      (forward-line 1)
+      (save-restriction
+       (narrow-to-region (point) (point-max))
+       (setq orig-from (mh-get-header-field "From:"))
+       (setq orig-subject (mh-get-header-field "Subject:")))
+      (let ((forw-subject
+            (mh-forwarded-letter-subject orig-from orig-subject)))
+       (mh-insert-fields "Subject:" forw-subject)
+       (goto-char (point-min))
+       (re-search-forward "^--\\[\\[message/rfc822\\]")
+       (forward-line -1)
+       (delete-other-windows)
+       (if (numberp msg-or-seq)
+           (mh-add-msgs-to-seq msg-or-seq 'forwarded t)
+         (mh-add-msgs-to-seq (mh-seq-to-msgs msg-or-seq) 'forwarded t))
+       (mh-compose-and-send-mail draft "" folder msg-or-seq
+                                 to forw-subject cc
+                                 mh-note-forw "Forwarded:"
+                                 config)))))
+;;; end
 
 (defun tm-mh-e/insert-message (&optional message)
   (if (null message)
@@ -342,6 +430,13 @@ With arg, turn MIME processing on if arg is positive."
      'news-reply-mode (function tm-mh-e/insert-message))
     )))
 
+(call-after-loaded
+ 'mime-setup
+ (lambda ()
+   (substitute-key-definition
+    'mh-forward 'tm-mh-e/forward mh-folder-mode-map)
+   ))
+
 
 ;;; @ set up
 ;;;
diff --git a/mk-tm b/mk-tm
index b8a2135..86e9d00 100644 (file)
--- a/mk-tm
+++ b/mk-tm
@@ -14,6 +14,9 @@
 
 (require 'tl-misc)
 
+;; Please specify VM path.
+(add-path "vm-5.95beta/")
+
 (setq tm-modules
       (append
        (cons
index adda95a..2ecb1a4 100644 (file)
--- a/tm-def.el
+++ b/tm-def.el
@@ -6,7 +6,7 @@
 ;;;
 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Version:
-;;;    $Id: tm-def.el,v 7.2 1995/11/14 04:56:15 morioka Exp $
+;;;    $Id: tm-def.el,v 7.3 1995/11/15 14:21:50 morioka Exp $
 ;;; Keywords: mail, news, MIME, multimedia, definition
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -227,7 +227,8 @@ ROT47 will be performed for Japanese text in any case."
               ))
            (reverse field-list)
            )
-    (set regexp-sym (apply (function regexp-or) fields))
+    (set regexp-sym
+        (concat "^" (apply (function regexp-or) fields) ":"))
     (set sym fields)
     ))
 
@@ -248,7 +249,8 @@ ROT47 will be performed for Japanese text in any case."
               (setq fields (delete field fields))
               ))
            field-list)
-    (set regexp-sym (apply (function regexp-or) fields))
+    (set regexp-sym
+        (concat "^" (apply (function regexp-or) fields) ":"))
     (set sym fields)
     ))
 
index 3e18008..05311fc 100644 (file)
 ;; LCD Archive Entry:
 ;; mime|Masanobu UMEDA|umerin@mse.kyutech.ac.jp|
 ;; Simple MIME Composer|
-;; $Date: 1995/11/14 05:04:22 $|$Revision: 7.24 $|~/misc/mime.el.Z|
+;; $Date: 1995/11/15 14:17:09 $|$Revision: 7.25 $|~/misc/mime.el.Z|
 
 ;;; Code:
 
 ;;;
 
 (defconst mime-editor/RCS-ID
-  "$Id: tm-edit.el,v 7.24 1995/11/14 05:04:22 morioka Exp $")
+  "$Id: tm-edit.el,v 7.25 1995/11/15 14:17:09 morioka Exp $")
 
 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
 
@@ -311,7 +311,9 @@ as message/rfc822 part.
 Each elements are regexp of field-name. [tm-edit.el]")
 
 (defvar mime-editor/yank-ignored-field-regexp
-  (apply (function regexp-or) mime-editor/yank-ignored-field-list))
+  (concat "^"
+         (apply (function regexp-or) mime-editor/yank-ignored-field-list)
+         ":"))
 
 (defvar mime-editor/message-inserter-alist nil)
 (defvar mime-editor/mail-inserter-alist nil)
@@ -2161,7 +2163,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
     ))
 
 (defun mime-viewer::quitting-method/draft-preview ()
-  (let ((mother mime/mother-buffer))
+  (let ((mother mime::preview/mother-buffer))
     (save-excursion
       (switch-to-buffer mother)
       (goto-char (point-min))
index 3f74127..3dbfa3f 100644 (file)
@@ -6,7 +6,7 @@
 ;;;
 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Version:
-;;;    $Id: tm-parse.el,v 5.0 1995/10/12 14:29:30 morioka Exp $
+;;;    $Id: tm-parse.el,v 6.0 1995/11/15 11:56:10 morioka Exp $
 ;;; Keywords: mail, news, MIME, multimedia
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -85,17 +85,20 @@ If is is not found, return DEFAULT-ENCODING. [tm-parse.el]"
 
 (defun mime/parse-multipart (boundary ctype params encoding rcnum)
   (goto-char (point-min))
-  (let ((beg (point-min))
-       (end (if (re-search-forward
-                 (concat "^--" (regexp-quote boundary) "--$") nil t)
-                (match-beginning 0)
-              (point-max)
-              ))
-       (rsep (concat "^--" (regexp-quote boundary) "\n"))
-       (dc-ctl
-        (cond ((string= ctype "multipart/digest") '("message/rfc822"))
-              (t '("text/plain"))))
-       cb ce ct ret ncb children (i 0))
+  (let* ((dash-boundary   (concat "--" boundary))
+        (delimiter       (concat "\n" dash-boundary))
+        (close-delimiter (concat delimiter "--"))
+        (beg (point-min))
+        (end (if (search-forward close-delimiter nil t)
+                 (match-beginning 0)
+               (point-max)
+               ))
+        (rsep (concat (regexp-quote delimiter) "[ \t]*\n"))
+        (dc-ctl
+         (cond ((string= ctype "multipart/digest") '("message/rfc822"))
+               (t '("text/plain"))
+               ))
+        cb ce ct ret ncb children (i 0))
     (save-restriction
       (narrow-to-region beg end)
       (goto-char beg)
index 906f524..0d88b18 100644 (file)
@@ -25,7 +25,7 @@
 ;;;
 
 (defconst mime-viewer/RCS-ID
-  "$Id: tm-view.el,v 7.24 1995/11/14 06:14:37 morioka Exp $")
+  "$Id: tm-view.el,v 7.25 1995/11/15 13:57:33 morioka Exp $")
 
 (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
 (defconst mime/viewer-version mime-viewer/version)
 Each elements are regexp of field-name. [tm-view.el]")
 
 (defvar mime-viewer/ignored-field-regexp
-  (apply (function regexp-or) mime-viewer/ignored-field-list))
+  (concat "^"
+         (apply (function regexp-or) mime-viewer/ignored-field-list)
+         ":"))
 
 (defvar mime-viewer/announcement-for-message/partial
   (if (and (>= emacs-major-version 19) window-system)
index 2dc847b..adb0e0a 100644 (file)
--- a/tm-vm.el
+++ b/tm-vm.el
@@ -4,23 +4,25 @@
 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
 ;;; 
 ;;; Author:   MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
-;;;          and Kenji Wakamiya <wkenji@flab.fujitsu.co.jp>
+;;;           Kenji Wakamiya <wkenji@flab.fujitsu.co.jp>
+;;;           MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;;           Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
+;;;           Oscar Figueiredo <figueire@lspsun2.epfl.ch>
 ;;; modified by SHIONO Jun'ichi <jun@p5.nm.fujitsu.co.jp>,
-;;;                Steinar Bang <steinarb@falch.no>,
-;;;            Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>,
-;;;        and MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;;         and Steinar Bang <steinarb@falch.no>,
+;;;
 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
 ;;;
-;;; Plese insert (require 'tm-vm) in your .vm or .emacs.
+;;; Plese insert (require 'tm-vm) in your ~/.vm or ~/.emacs file.
 ;;;
 
 (require 'tm-view)
 (require 'vm)
 
 (defconst tm-vm/RCS-ID
-  "$Id: tm-vm.el,v 7.4 1995/11/14 04:52:30 morioka Exp $")
+  "$Id: tm-vm.el,v 7.7 1995/11/15 15:35:54 morioka Exp $")
 (defconst tm-vm/version (get-version-string tm-vm/RCS-ID))
 
 (define-key vm-mode-map "Z" 'tm-vm/view-message)
@@ -120,7 +122,28 @@ all marked messages are affected, other messages are ignored."
   "If non-nil, show MIME processed article.")
 
 (defun tm-vm/preview-current-message ()
-  (if tm-vm/automatic-mime-preview
+  ;;; suggested by Simon Rowe <smr@robots.oxford.ac.uk>
+  ;;;  (c.f. [tm-eng:163])
+  ;; Selecting a new mail message, but we're already displaying a mime
+  ;; on in the window, make sure that the mail buffer is displayed.
+  (if (get-buffer-window "*MIME-out*")
+      (delete-window (get-buffer-window (get-buffer "*MIME-out*")))
+    )
+  (display-buffer (current-buffer))
+  (if (and tm-vm/automatic-mime-preview
+          (let* ((mp (car vm-message-pointer))
+                 (ct  (vm-get-header-contents mp "Content-Type:"))
+                 (cte (vm-get-header-contents
+                       mp "Content-Transfer-Encoding:"))
+                 )
+            ;; Check if this message actually is a mime, or just a text
+            ;; one sent by someone using PINE or similar.
+            (and ct
+                 (not (and (string= (car (mime/parse-Content-Type ct))
+                                    "text/plain")
+                           (member cte '("7bit" "8bit" "binary"))
+                           ))))
+          )
       (let ((win (selected-window)))
        (vm-display (current-buffer) t
                    '(tm-vm/preview-current-message
@@ -128,81 +151,106 @@ all marked messages are affected, other messages are ignored."
                    '(tm-vm/preview-current-message reading-message))
        (mime/viewer-mode)
        (select-window win)
-       )
-    ))
+       )))
 
 (add-hook 'vm-select-message-hook 'tm-vm/preview-current-message)
 (add-hook 'vm-visit-folder-hook 'tm-vm/preview-current-message)
 
+;; fixed by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
+;;     1995/11/14 (c.f. [tm-eng:162])
 (defun tm-vm/scroll-forward ()
   (interactive)
-  (if tm-vm/automatic-mime-preview
-      (let ((win (get-buffer-window
-                 (save-excursion
-                   (set-buffer vm-mail-buffer)
-                   mime::article/preview-buffer)))
-           (the-win (selected-window))
-           np)
-       (if win
-           (progn
-             (select-window win)
-             (setq np (save-excursion
-                        (forward-line (window-height))
-                        (point)
-                        ))
-             )
-         (vm-scroll-forward)
-         (switch-to-buffer mime::article/preview-buffer)
-         (setq win (selected-window))
-         (setq np (point-min))
-         )
-       (if (eq np (point-max))
-           (progn
-             (select-window the-win)
-             (vm-next-message)
-             )
-         (set-window-start (selected-window) np)
-         (select-window the-win)
-         ))
-    (vm-scroll-forward)
-    ))
+  (if (not tm-vm/automatic-mime-preview)
+      (vm-scroll-forward)
+    (let* ((summary-buffer (or vm-summary-buffer
+                              (and (eq major-mode 'vm-summary-mode)
+                                   (current-buffer))))
+          (summary-win (get-buffer-window summary-buffer))
+          (mail-buffer (save-excursion
+                         (set-buffer summary-buffer)
+                         vm-mail-buffer))
+          (mail-win (get-buffer-window mail-buffer))
+          (preview-win (get-buffer-window
+                        (save-excursion
+                          (set-buffer mail-buffer)
+                          mime::article/preview-buffer))))                     
+      (if preview-win
+         (progn
+           (select-window preview-win)
+           (if (pos-visible-in-window-p (point-max) preview-win)
+               (progn
+                 (switch-to-buffer mail-buffer)
+                 (goto-char (point-max))
+                 (select-window summary-win))
+             (scroll-up)       
+             (switch-to-buffer mail-buffer)
+             (select-window summary-win))))
+      (vm-scroll-forward)
+      (save-excursion
+       (set-buffer summary-buffer)
+       (setq mail-win (get-buffer-window vm-mail-buffer)))
+      (if mail-win
+         (progn
+           (select-window mail-win)
+           (switch-to-buffer mime::article/preview-buffer)
+           (select-window summary-win)))
+      )))
 
 (defun tm-vm/scroll-backward ()
   (interactive)
-  (if tm-vm/automatic-mime-preview
-      (let ((win (get-buffer-window
-                 (save-excursion
-                   (set-buffer vm-mail-buffer)
-                   mime::article/preview-buffer)))
-           (the-win (selected-window))
-           np)
-       (if win
-           (progn
-             (select-window win)
-             (setq np (save-excursion
-                        (forward-line (- (window-height)))
-                        (point)
-                        ))
-             (if (eq np (window-start))
-                 (progn
-                   (select-window the-win)
-                   (vm-previous-message)
-                   )
-               (set-window-start (selected-window) np)
-               (select-window the-win)
-               ))
-         (vm-scroll-forward)
-         (switch-to-buffer mime::article/preview-buffer)
-         (setq win (selected-window))
-         (select-window the-win)
-         ))
-    (vm-scroll-backward)
-    ))
+  (if (not tm-vm/automatic-mime-preview)
+      (vm-scroll-backward)
+    (let* ((summary-buffer (or vm-summary-buffer
+                              (and (eq major-mode 'vm-summary-mode)
+                                   (current-buffer))))
+          (summary-win (get-buffer-window summary-buffer))
+          (mail-buffer (save-excursion
+                         (set-buffer summary-buffer)
+                         vm-mail-buffer))
+          (mail-win (get-buffer-window mail-buffer))
+          (preview-win (get-buffer-window
+                        (save-excursion
+                          (set-buffer mail-buffer)
+                          mime::article/preview-buffer))))                     
+      (if preview-win
+         (progn
+           (select-window preview-win)
+           (if (pos-visible-in-window-p (point-min) preview-win)
+               (progn
+                 (switch-to-buffer mail-buffer)
+                 (goto-char (point-min))
+                 (select-window summary-win))
+             (scroll-down)             
+             (switch-to-buffer mail-buffer)
+             (select-window summary-win))))
+      (vm-scroll-backward nil)
+      (save-excursion
+       (set-buffer summary-buffer)
+       (setq mail-win (get-buffer-window vm-mail-buffer)))
+      (if mail-win
+         (progn
+           (select-window mail-win)
+           (switch-to-buffer mime::article/preview-buffer)
+           (select-window summary-win)))
+      )))
+
+(defun tm-vm/quit ()
+  (interactive)
+  (save-excursion
+    (set-buffer vm-mail-buffer)
+    (if mime::article/preview-buffer
+       (kill-buffer mime::article/preview-buffer)))
+  (vm-quit)
+  )
 
 (substitute-key-definition 'vm-scroll-forward
                           'tm-vm/scroll-forward vm-mode-map)
 (substitute-key-definition 'vm-scroll-backward
                           'tm-vm/scroll-backward vm-mode-map)
+(substitute-key-definition 'vm-quit
+                          'tm-vm/quit vm-mode-map)
+;; end
+
 
 (defun tm-vm/toggle-preview-mode ()
   (interactive)
@@ -231,7 +279,7 @@ all marked messages are affected, other messages are ignored."
       )
     ))
 
-       
+
 ;;; @ for tm-view
 ;;;
 
@@ -329,7 +377,8 @@ The resulting digest is inserted at point in the current buffer.
 MLIST should be a list of message structs (real or virtual).
 These are the messages that will be enclosed."
   (if mlist
-      (let (m)
+      (let ((digest (consp (cdr mlist)))
+            m)
        (save-restriction
          (narrow-to-region (point) (point))
          (while mlist
@@ -338,7 +387,8 @@ These are the messages that will be enclosed."
             (tm-vm/insert-message m)
             (goto-char (point-max))
            (setq mlist (cdr mlist)))
-          (mime-editor/enclose-digest-region (point-min) (point-max))
+          (if digest
+              (mime-editor/enclose-digest-region (point-min) (point-max)))
           ))))
 
 (defun tm-vm/forward-message ()
@@ -396,20 +446,40 @@ only marked messages will be put into the digest."
     (vm-check-for-killed-summary)
     (vm-error-if-folder-empty)
     (let ((dir default-directory)
+          (mp vm-message-pointer)
           (mlist (if (eq last-command 'vm-next-command-uses-marks)
                      (vm-select-marked-or-prefixed-messages 0)
-                   vm-message-list)))
+                   vm-message-list))
+          start)
       (save-restriction
         (widen)
         (vm-mail-internal (format "digest from %s" (buffer-name)))
         (setq vm-system-state 'forwarding
+              vm-forward-list mlist
               default-directory dir)
         (goto-char (point-min))
         (re-search-forward (concat "^" (regexp-quote mail-header-separator)
                                    "\n"))
         (goto-char (match-end 0))
+        (setq start (point)
+              mp mlist)
         (vm-unsaved-message "Building %s digest..." vm-digest-send-type)
         (tm-vm/enclose-messages mlist)
+        (goto-char start)
+        (setq mp mlist)
+        (if prefix
+         (progn
+            (mime-editor/insert-tag "text" "plain")
+           (vm-unsaved-message "Building digest preamble...")
+           (while mp
+             (let ((vm-summary-uninteresting-senders nil))
+               (insert (vm-sprintf 'vm-digest-preamble-format (car mp)) "\n"))
+             (if vm-digest-center-preamble
+                 (progn
+                   (forward-char -1)
+                   (center-line)
+                   (forward-char 1)))
+             (setq mp (cdr mp)))))
         (mail-position-on-field "To")
         (message "Building %s digest... done" vm-digest-send-type)))
     ;; (run-hooks 'tm-vm/send-digest-hook) ; Is it necessary?