tm 7.24.
authormorioka <morioka>
Mon, 9 Mar 1998 11:32:01 +0000 (11:32 +0000)
committermorioka <morioka>
Mon, 9 Mar 1998 11:32:01 +0000 (11:32 +0000)
Changes-7.24.en [new file with mode: 0644]
Changes-7.24.ja [new file with mode: 0644]
Makefile
mh-e/Makefile
mh-e/tm-mh-e.el
tm-def.el
tm-edit.el
tm-view.el
tm-vm.el

diff --git a/Changes-7.24.en b/Changes-7.24.en
new file mode 100644 (file)
index 0000000..777d200
--- /dev/null
@@ -0,0 +1,69 @@
+* tl
+
+  Attached version 7.01.5.
+
+
+* tm
+
+tm/tm-def.el
+----------------------------
+revision 7.2
+date: 1995/11/14 04:56:15;  author: morioka;  state: Exp;  lines: +50 -1
+New function `tm:add-fields' and `tm:delete-fields' to modify
+*-field-list and *-field-regexp variables.
+----------------------------
+
+tm/tm-edit.el
+----------------------------
+revision 7.24
+date: 1995/11/14 05:04:22;  author: morioka;  state: Exp;  lines: +21 -11
+(1) fixed mode of message/external-body; access-type = ftp or anon-ftp.
+(2) New variable `mime-editor/yank-ignored-field-list'.
+(3) Variable `mime-editor/yank-ignored-fields-regexp' was renamed to
+    `mime-editor/yank-ignored-field-regexp'.
+(4) Constant `mime-editor/split-ignored-fields-regexp' was renamed to
+    `mime-editor/split-ignored-field-regexp'.
+(5) Variable `mime-editor/split-blind-fields-regexp' was renamed to
+    `mime-editor/split-blind-field-regexp'.
+----------------------------
+
+tm/tm-view.el
+----------------------------
+revision 7.24
+date: 1995/11/14 06:14:37;  author: morioka;  state: Exp;  lines: +7 -8
+(1) Elements of variable `mime-viewer/ignored-field-list' were changes 
+    to regexp.
+(2) Function `mime/viewer-mode' was modified not to reset variable
+    `mime-viewer/ignored-field-regexp' from variable
+    `mime-viewer/ignored-field-list'. (Please use function
+    `tm:add-fields' and `tm:delete-fields' to modify them)
+----------------------------
+
+tm/tm-vm.el
+----------------------------
+revision 7.4
+date: 1995/11/14 04:52:30;  author: morioka;  state: Exp;  lines: +324 -53
+(1) New variable `tm-vm/use-tm-patch'. If it is nil, tm-vm.el sets to
+    decode encoded-word by itself.
+(2) New variable `tm-vm/automatic-mime-preview'. If it is t, tm-vm.el
+    does automatic MIME preview. New function
+    `tm-vm/toggle-preview-mode' is bound to `M-t' key.
+(3) New function `tm-vm/forward-message' and
+    `tm-vm/send-digest'. Function `vm-forward-message' and
+    `vm-send-digest' were replace by them. If mime-setup.el is loaded, 
+    variable `vm-forwarding-digest-type' and variable
+    `vm-digest-send-type' are set to "rfc1522".
+----------------------------
+
+
+* tm/mh-e
+
+  Attached version 7.17.
+
+tm/mh-e/tm-mh-e.el
+----------------------------
+revision 7.17
+date: 1995/11/14 06:29:27;  author: morioka;  state: Exp;  lines: +14 -13
+Variable `tm-mh-e/decode-all' is renamed to
+`tm-mh-e/automatic-mime-preview'.
+----------------------------
diff --git a/Changes-7.24.ja b/Changes-7.24.ja
new file mode 100644 (file)
index 0000000..ccd336d
--- /dev/null
@@ -0,0 +1,70 @@
+* tl
+
+  Version 7.01.5 \e$B$rE:IU$7$?!#\e(B
+
+
+* tm
+
+tm/tm-def.el
+----------------------------
+revision 7.2
+date: 1995/11/14 04:56:15;  author: morioka;  state: Exp;  lines: +50 -1
+*-field-list \e$B$H\e(B *-field-regexp \e$B$rA`:n$9$k$?$a$N4X?t\e(B tm:add-fields \e$B$H4X\e(B
+\e$B?t\e(B tm:delete-fields \e$B$rDI2C$7$?!#\e(B
+----------------------------
+
+tm/tm-edit.el
+----------------------------
+revision 7.24
+date: 1995/11/14 05:04:22;  author: morioka;  state: Exp;  lines: +21 -11
+(1) message/external-body \e$B$N\e(B access-type = ftp, anon-ftp \e$B$N;~$N\e(B mode
+    \e$B$r=$@5$7$?!#\e(B
+(2) \e$BJQ?t\e(B mime-editor/yank-ignored-field-list \e$B$r@_$1$?!#\e(B
+(3) \e$BJQ?t\e(B mime-editor/yank-ignored-fields-regexp \e$B$r\e(B
+    `mime-editor/yank-ignored-field-regexp' \e$B$K2~L>$7$?!#$J$*!"$3$NJQ?t\e(B
+    \e$B$OD>@\A`:n$;$:$K!"\e(Btm:add-fields \e$B$+\e(B tm:delete-fields \e$B$r;H$C$FA`:n$9\e(B
+    \e$B$k$3$H$K$9$k!#\e(B
+(4) \e$BDj?t\e(B mime-editor/split-ignored-fields-regexp \e$B$r\e(B
+    `mime-editor/split-ignored-field-regexp' \e$B$K2~L>$7$?!#\e(B
+(5) \e$BJQ?t\e(B mime-editor/split-blind-fields-regexp \e$B$r\e(B
+    `mime-editor/split-blind-field-regexp' \e$B$K2~L>$7$?!#\e(B
+----------------------------
+
+tm/tm-view.el
+----------------------------
+revision 7.24
+date: 1995/11/14 06:14:37;  author: morioka;  state: Exp;  lines: +7 -8
+(1) \e$BJQ?t\e(B mime-viewer/ignored-field-list \e$B$NMWAG$r@55,I=8=$H$7$?!#\e(B
+(2) \e$B4X?t\e(B mime/viewer-mode \e$B$GJQ?t\e(B mime-viewer/ignored-field-regexp \e$B$r@_\e(B
+    \e$BDj$7D>$9$N$O$d$a$?!#!JJQ?t\e(B mime-viewer/ignored-field-list \e$B$HJQ?t\e(B
+    mime-viewer/ignored-field-regexp \e$B$OD>@\@_Dj$;$:!"4X?t\e(B
+    tm:add-fields \e$B$H4X?t\e(B tm:delete-fields \e$B$r;H$&$3$H!K\e(B
+----------------------------
+
+tm/tm-vm.el
+----------------------------
+revision 7.4
+date: 1995/11/14 04:52:30;  author: morioka;  state: Exp;  lines: +324 -53
+(1) \e$BJQ?t\e(B tm-vm/use-tm-patch \e$B$r@_$1!"$3$l$,\e(B nil \e$B$N>l9g$O<+NO$G\e(B
+    encoded-word \e$B$r\e(B decode \e$B$9$k@_Dj$r9T$&$h$&$K$7$?!#\e(B
+(2) \e$BJQ?t\e(B tm-vm/automatic-mime-preview \e$B$r@_$1!"$3$l$,\e(B t \e$B$N;~\e(B automatic
+    MIME preview \e$B$r9T$&$h$&$K$7$?!#$^$?!"\e(BM-t \e$B$K4X?t\e(B
+    tm-vm/toggle-preview-mode \e$B$r3d$jEv$F$?!#\e(B
+(3) \e$B4X?t\e(B tm-vm/forward-message, \e$B4X?t\e(B tm-vm/send-digest \e$B$r@_$1!"\e(B
+    \e$B4X?t\e(B vm-forward-message, \e$B4X?t\e(B vm-send-digest \e$B$HCV$-49$($?!#$^$?!"\e(B
+    mime-setup.el \e$B$,\e(B load \e$B$5$l$?>l9g$O!"JQ?t\e(B
+    vm-forwarding-digest-type, \e$BJQ?t\e(B vm-digest-send-type \e$B$NCM$r\e(B
+    "rfc1522" \e$B$K$9$k$h$&$K$7$?!#\e(B
+----------------------------
+
+
+* tm/mh-e
+
+  Version 7.17 \e$B$rE:IU$7$?!#\e(B
+
+tm/mh-e/tm-mh-e.el
+----------------------------
+revision 7.17
+date: 1995/11/14 06:29:27;  author: morioka;  state: Exp;  lines: +14 -13
+\e$BJQ?t\e(B tm-mh-e/decode-all \e$B$r\e(B `tm-mh-e/automatic-mime-preview' \e$B$K2~L>$7$?!#\e(B
+----------------------------
index 8568aca..a62acba 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.23.tar.gz
+TARFILE = tm7.24.tar.gz
 
 
 nemacs:
index 8413e61..d5f98c8 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.16.tar
+TARFILE = tm-mh-e7.17.tar
 
 
 elc:
index 56f7d88..9907f71 100644 (file)
@@ -26,7 +26,7 @@
 ;;;
 
 (defconst tm-mh-e/RCS-ID
-  "$Id: tm-mh-e.el,v 7.16 1995/11/11 13:02:40 morioka Exp $")
+  "$Id: tm-mh-e.el,v 7.17 1995/11/14 06:29:27 morioka Exp $")
 
 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
 
 ;;; @ variable
 ;;;
 
-(defvar tm-mh-e/decode-all t
-  "*If t, decode all of the message. Otherwise decode header only.")
+(defvar tm-mh-e/automatic-mime-preview t
+  "If non-nil, show MIME processed message.")
 
-(defvar tm-mh-e/decode-encoded-word t)
+(defvar tm-mh-e/decode-encoded-word t
+  "If non-nil, decode encoded-word when it is not MIME preview mode.")
 
 
 ;;; @ functions
@@ -50,7 +51,7 @@
 
 (defun mh-display-msg (msg-num folder &optional show-buffer mode)
   (or mode
-      (setq mode tm-mh-e/decode-all)
+      (setq mode tm-mh-e/automatic-mime-preview)
       )
   ;; Display message NUMBER of FOLDER.
   ;; Sets the current buffer to the show buffer.
 (defun tm-mh-e/view-message (&optional msg)
   "MIME decode and play this message."
   (interactive)
-  (if (or (null tm-mh-e/decode-all)
+  (if (or (null tm-mh-e/automatic-mime-preview)
          (null (get-buffer mh-show-buffer))
          (save-excursion
            (set-buffer mh-show-buffer)
            (not (eq major-mode 'mime/viewer-mode))
            ))
-      (let ((tm-mh-e/decode-all t))
+      (let ((tm-mh-e/automatic-mime-preview t))
        (mh-invalidate-show-buffer)
        (mh-show-msg msg)
        ))
   "Toggle MIME processing mode.
 With arg, turn MIME processing on if arg is positive."
   (interactive "P")
-  (setq tm-mh-e/decode-all
+  (setq tm-mh-e/automatic-mime-preview
        (if (null arg)
-           (not tm-mh-e/decode-all)
+           (not tm-mh-e/automatic-mime-preview)
          arg))
   (save-excursion
     (set-buffer mh-show-buffer)
-    (if (null tm-mh-e/decode-all)
+    (if (null tm-mh-e/automatic-mime-preview)
        (if (and mime::preview/article-buffer
                 (get-buffer mime::preview/article-buffer))
            (kill-buffer mime::preview/article-buffer)
@@ -189,7 +190,7 @@ With arg, turn MIME processing on if arg is positive."
 (defun tm-mh-e/raw-display ()
   (interactive)
   (mh-invalidate-show-buffer)
-  (let (tm-mh-e/decode-all
+  (let (tm-mh-e/automatic-mime-preview
        tm-mh-e/decode-encoded-word)
     (mh-header-display)
     ))
@@ -233,7 +234,7 @@ With arg, turn MIME processing on if arg is positive."
      (let ((name (buffer-name buf)))
        (substring name 5)
        ))
-    (if (not tm-mh-e/decode-all)
+    (if (not tm-mh-e/automatic-mime-preview)
        (mh-invalidate-show-buffer)
       )
     (mh-show (mh-get-msg-num t))
@@ -262,7 +263,7 @@ With arg, turn MIME processing on if arg is positive."
               'mh-show-mode
               (function
                (lambda ()
-                 (let ((tm-mh-e/decode-all t))
+                 (let ((tm-mh-e/automatic-mime-preview t))
                    (tm-mh-e/show)
                    ))))
     )))
index 297a3b3..adda95a 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.1 1995/11/10 10:43:15 morioka Exp $
+;;;    $Id: tm-def.el,v 7.2 1995/11/14 04:56:15 morioka Exp $
 ;;; Keywords: mail, news, MIME, multimedia, definition
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -204,6 +204,55 @@ ROT47 will be performed for Japanese text in any case."
          (insert str)))))
 
 
+;;; @ field
+;;;
+
+(defun tm:add-fields (sym field-list &optional regexp-sym)
+  (or regexp-sym
+      (setq regexp-sym
+           (let ((name (symbol-name sym)))
+             (intern
+              (concat (if (string-match "\\(.*\\)-list" name)
+                          (substring name 0 (match-end 1))
+                        name)
+                      "-regexp")
+              )))
+      )
+  (let ((fields (eval sym)))
+    (mapcar (function
+            (lambda (field)
+              (or (member field fields)
+                  (setq fields (cons field fields))
+                  )
+              ))
+           (reverse field-list)
+           )
+    (set regexp-sym (apply (function regexp-or) fields))
+    (set sym fields)
+    ))
+
+(defun tm:delete-fields (sym field-list &optional regexp-sym)
+  (or regexp-sym
+      (setq regexp-sym
+           (let ((name (symbol-name sym)))
+             (intern
+              (concat (if (string-match "\\(.*\\)-list" name)
+                          (substring name 0 (match-end 1))
+                        name)
+                      "-regexp")
+              )))
+      )
+  (let ((fields (eval sym)))
+    (mapcar (function
+            (lambda (field)
+              (setq fields (delete field fields))
+              ))
+           field-list)
+    (set regexp-sym (apply (function regexp-or) fields))
+    (set sym fields)
+    ))
+
+
 ;;; @ end
 ;;;
 
index 5aee31a..3e18008 100644 (file)
 ;; LCD Archive Entry:
 ;; mime|Masanobu UMEDA|umerin@mse.kyutech.ac.jp|
 ;; Simple MIME Composer|
-;; $Date: 1995/11/11 12:48:30 $|$Revision: 7.23 $|~/misc/mime.el.Z|
+;; $Date: 1995/11/14 05:04:22 $|$Revision: 7.24 $|~/misc/mime.el.Z|
 
 ;;; Code:
 
 ;;;
 
 (defconst mime-editor/RCS-ID
-  "$Id: tm-edit.el,v 7.23 1995/11/11 12:48:30 morioka Exp $")
+  "$Id: tm-edit.el,v 7.24 1995/11/14 05:04:22 morioka Exp $")
 
 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
 
@@ -221,8 +221,12 @@ To insert a signature file specified by mime-signature-file
        ("site" "ftp.jaist.ac.jp" "wnoc-fuk.wide.ad.jp" "nic.karrn.ad.jp")
        ("directory" "/pub/GNU/elisp/mime")
        ("name")
-       ("mode" "binary" "ascii"))
-       ("ftp" ("site") ("directory") ("name") ("mode" "binary" "ascii"))
+       ("mode" "image" "ascii" "local8"))
+       ("ftp"
+       ("site")
+       ("directory")
+       ("name")
+       ("mode" "image" "ascii" "local8"))
        ("tftp"        ("site") ("name"))
        ("afs"         ("site") ("name"))
        ("local-file"  ("site") ("name"))
@@ -300,8 +304,14 @@ If encoding is nil, it is determined from its contents.")
 ;;; @@ about message inserting
 ;;;
 
-(defvar mime-editor/yank-ignored-fields-regexp
-  "^\\(Received\\|X-UIDL\\|Sender\\|Approved\\|Path\\):")
+(defvar mime-editor/yank-ignored-field-list
+  '("Received" "Sender" "Approved" "Path" "Status" "X-VM-.*" "X-UIDL")
+  "Delete these fields from original message when it is inserted
+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))
 
 (defvar mime-editor/message-inserter-alist nil)
 (defvar mime-editor/mail-inserter-alist nil)
@@ -316,10 +326,10 @@ If encoding is nil, it is determined from its contents.")
 (defvar mime-editor/message-max-length-alist
   '((news-reply-mode . 500)))
 
-(defconst mime-editor/split-ignored-fields-regexp
+(defconst mime-editor/split-ignored-field-regexp
   "\\(^Content-\\|^Subject:\\|^Mime-Version:\\)")
 
-(defvar mime-editor/split-blind-fields-regexp
+(defvar mime-editor/split-blind-field-regexp
   "\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)")
 
 (defvar mime-editor/message-default-sender-alist
@@ -1729,7 +1739,7 @@ a recording host instead of local host."
          )
        (goto-char header-start)
        (while (and (re-search-forward
-                    mime-editor/yank-ignored-fields-regexp nil t)
+                    mime-editor/yank-ignored-field-regexp nil t)
                    (setq beg (match-beginning 0))
                    (setq end (1+ (rfc822/field-end)))
                    )
@@ -1959,7 +1969,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
                           "@" (system-name) "\"")))
          (run-hooks 'mime-editor/before-split-hook)
          (let* ((header (rfc822/get-header-string-except
-                         mime-editor/split-ignored-fields-regexp separator))
+                         mime-editor/split-ignored-field-regexp separator))
                 (subject (mail-fetch-field "subject"))
                 (total (+ (/ lines mime-editor/message-max-length)
                           (if (> (mod lines mime-editor/message-max-length) 0)
@@ -2019,7 +2029,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
                     ))
                  (goto-char (point-min))
                  (while (re-search-forward
-                         mime-editor/split-blind-fields-regexp nil t)
+                         mime-editor/split-blind-field-regexp nil t)
                    (delete-region (match-beginning 0)
                                   (let ((e (rfc822/field-end)))
                                     (if (< e (point-max))
index 5b9d83b..906f524 100644 (file)
@@ -25,7 +25,7 @@
 ;;;
 
 (defconst mime-viewer/RCS-ID
-  "$Id: tm-view.el,v 7.23 1995/11/10 11:15:31 morioka Exp $")
+  "$Id: tm-view.el,v 7.24 1995/11/14 06:14:37 morioka Exp $")
 
 (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
 (defconst mime/viewer-version mime-viewer/version)
 (defvar mime-viewer/ignored-field-list
   '("Received" "Return-Path" "Replied" "Errors-To"
     "Lines" "Sender" "Path" "Nntp-Posting-Host"
-    "Content-Type" "Precedence" "X-Face"))
+    "Content-Type" "Precedence" "X-Face"
+    "Status" "X-VM-.*")
+  "All fields that match this list will be hidden in MIME preview buffer.
+Each elements are regexp of field-name. [tm-view.el]")
 
-(defvar mime-viewer/ignored-field-regexp)
+(defvar mime-viewer/ignored-field-regexp
+  (apply (function regexp-or) mime-viewer/ignored-field-list))
 
 (defvar mime-viewer/announcement-for-message/partial
   (if (and (>= emacs-major-version 19) window-system)
@@ -701,11 +705,6 @@ listed in key order:
 \\{mime/viewer-mode-map}
 "
   (interactive)
-  (setq mime-viewer/ignored-field-regexp
-       (concat "^\\("
-               (mapconcat (function regexp-quote)
-                          mime-viewer/ignored-field-list "\\|")
-               "\\):"))
   (let ((buf (get-buffer mime/output-buffer-name)))
     (if buf
        (save-excursion
index f539621..2dc847b 100644 (file)
--- a/tm-vm.el
+++ b/tm-vm.el
@@ -5,7 +5,7 @@
 ;;; 
 ;;; Author:   MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
 ;;;          and Kenji Wakamiya <wkenji@flab.fujitsu.co.jp>
-;;;          modified by SHIONO <jun@p5.nm.fujitsu.co.jp>,
+;;; 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>
@@ -13,8 +13,6 @@
 ;;;
 ;;; This file is part of tm (Tools for MIME).
 ;;;
-;;; This version is tested under VM-5.76 with tm-6.20.
-;;;
 ;;; Plese insert (require 'tm-vm) in your .vm or .emacs.
 ;;;
 
 (require 'vm)
 
 (defconst tm-vm/RCS-ID
-  "$Id: tm-vm.el,v 7.3 1995/10/28 06:00:09 morioka Exp $")
+  "$Id: tm-vm.el,v 7.4 1995/11/14 04:52:30 morioka Exp $")
 (defconst tm-vm/version (get-version-string tm-vm/RCS-ID))
 
 (define-key vm-mode-map "Z" 'tm-vm/view-message)
 (define-key vm-mode-map "T" 'tm-vm/decode-message-header)
-
-(set-alist 'mime-viewer/quitting-method-alist
-          'vm-mode
-          'tm-vm/quit-view-message)
-
-(set-alist 'mime-viewer/quitting-method-alist
-          'vm-virtual-mode
-          'tm-vm/quit-view-message)
+(define-key vm-mode-map "\et" 'tm-vm/toggle-preview-mode)
 
 
 ;;; @ for MIME encoded-words
 ;;;
-;; If you don't use tiny-mime patch for VM (by RIKITAKE Kenji
-;; <kenji@reseau.toyonaka.osaka.jp>), please use following definition:
-
-;; (setq vm-summary-format "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c, %I\"%UA\"\n")
-;; (defun vm-summary-function-A (m)
-;;   (mime-ewords/decode-string (vm-su-subject m)))
 
+(defvar tm-vm/use-tm-patch nil
+  "Does not decode encoded-words in summary buffer if it is t.
+If you use tiny-mime patch for VM (by RIKITAKE Kenji
+<kenji@reseau.toyonaka.osaka.jp>), please set it t [tm-vm.el]")
 
-;;; @ functions
+(or tm-vm/use-tm-patch
+    (progn
 ;;;
+;; by Steinar Bang <steinarb@falch.no>
+(setq vm-summary-format "%n %*%a %-17.17F %-3.3m %2d %4l/%-5c, %I\"%UA\"\n")
 
-(defun tm-vm/quit-view-message ()
-  "Quit MIME-viewer and go back to VM.
-This function is called by `mime-viewer/quit' command via
-`mime-viewer/quitting-method-alist'."
-  (mime-viewer/kill-buffer)
-  (if (get-buffer mime/output-buffer-name)
-      (bury-buffer mime/output-buffer-name))
-  (vm-select-folder-buffer)
-  (vm-display (current-buffer) t '(mime-viewer/quit mime-viewer/up-content)
-             '(mime-viewer/quit reading-message)))
+(defvar tm-vm/chop-full-name-function 'tm-vm/default-chop-full-name)
+(setq vm-chop-full-name-function tm-vm/chop-full-name-function)
 
-(defun tm-vm/view-message ()
-  "Decode and view MIME encoded message, under VM."
-  (interactive)
-  (vm-follow-summary-cursor)
-  (vm-select-folder-buffer)
-  (vm-check-for-killed-summary)
-  (vm-error-if-folder-empty)
-  (vm-display (current-buffer) t '(tm-vm/view-message)
-              '(tm-vm/view-mesage reading-message))
-  (let* ((mp (car vm-message-pointer))
-        (ct  (vm-get-header-contents mp "Content-Type:"))
-        (cte (vm-get-header-contents mp "Content-Transfer-Encoding:"))
-        (exposed (= (point-min) (vm-start-of mp))))
-    (save-restriction
-      (vm-widen-page)
-      ;; vm-widen-page hides exposed header if pages are delimited.
-      ;; So, here we expose it again.
-      (if exposed
-         (narrow-to-region (vm-start-of mp) (point-max)))
-      (select-window (vm-get-buffer-window (current-buffer)))
-      (mime/viewer-mode nil
-                       (mime/parse-Content-Type (or ct ""))
-                       cte)
-      )))
+(defun tm-vm/default-chop-full-name (address)
+  (let* ((ret (vm-default-chop-full-name address))
+        (full-name (car ret))
+        )
+    (if (stringp full-name)
+       (cons (mime-eword/decode-string full-name)
+             (cdr ret))
+      ret)))
+
+;; by Steinar Bang <steinarb@falch.no>
+(defun vm-summary-function-A (m)
+  (mime-eword/decode-string (vm-su-subject m))
+  )
+;;;
+))
 
 (defun tm-vm/decode-message-header (&optional count)
   "Decode MIME header of current message through tiny-mime.
@@ -138,6 +113,173 @@ all marked messages are affected, other messages are ignored."
        (setq vbufs (cdr vbufs))))))
 
 
+;;; @ automatic MIME preview
+;;;
+
+(defvar tm-vm/automatic-mime-preview t
+  "If non-nil, show MIME processed article.")
+
+(defun tm-vm/preview-current-message ()
+  (if tm-vm/automatic-mime-preview
+      (let ((win (selected-window)))
+       (vm-display (current-buffer) t
+                   '(tm-vm/preview-current-message
+                     vm-preview-current-message)
+                   '(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)
+
+(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)
+    ))
+
+(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)
+    ))
+
+(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)
+
+(defun tm-vm/toggle-preview-mode ()
+  (interactive)
+  (if tm-vm/automatic-mime-preview
+      (progn
+       (setq tm-vm/automatic-mime-preview nil)
+       (vm-select-folder-buffer)
+       (vm-display (current-buffer) t
+                   '(tm-vm/toggle-preview-mode)
+                   '(tm-vm/toggle-preview-mode reading-message))
+       )
+    (setq tm-vm/automatic-mime-preview t)
+    (let ((win (selected-window)))
+      (vm-select-folder-buffer)
+      (save-window-excursion
+       (let* ((mp (car vm-message-pointer))
+              (ct  (vm-get-header-contents mp "Content-Type:"))
+              (cte (vm-get-header-contents mp "Content-Transfer-Encoding:"))
+              )
+         (mime/viewer-mode nil (mime/parse-Content-Type (or ct "")) cte)
+         ))
+      (vm-display mime::article/preview-buffer t
+                 '(tm-vm/toggle-preview-mode)
+                 '(tm-vm/toggle-preview-mode reading-message))
+      (select-window win)
+      )
+    ))
+
+       
+;;; @ for tm-view
+;;;
+
+(defun tm-vm/quit-view-message ()
+  "Quit MIME-viewer and go back to VM.
+This function is called by `mime-viewer/quit' command via
+`mime-viewer/quitting-method-alist'."
+  (mime-viewer/kill-buffer)
+  (if (get-buffer mime/output-buffer-name)
+      (bury-buffer mime/output-buffer-name))
+  (vm-select-folder-buffer)
+  (vm-display (current-buffer) t '(mime-viewer/quit mime-viewer/up-content)
+             '(mime-viewer/quit reading-message)))
+
+(defun tm-vm/view-message ()
+  "Decode and view MIME encoded message, under VM."
+  (interactive)
+  (vm-follow-summary-cursor)
+  (vm-select-folder-buffer)
+  (vm-check-for-killed-summary)
+  (vm-error-if-folder-empty)
+  (vm-display (current-buffer) t '(tm-vm/view-message)
+              '(tm-vm/view-mesage reading-message))
+  (let* ((mp (car vm-message-pointer))
+        (ct  (vm-get-header-contents mp "Content-Type:"))
+        (cte (vm-get-header-contents mp "Content-Transfer-Encoding:"))
+        (exposed (= (point-min) (vm-start-of mp))))
+    (save-restriction
+      (vm-widen-page)
+      ;; vm-widen-page hides exposed header if pages are delimited.
+      ;; So, here we expose it again.
+      (if exposed
+         (narrow-to-region (vm-start-of mp) (point-max)))
+      (select-window (vm-get-buffer-window (current-buffer)))
+      (mime/viewer-mode nil
+                       (mime/parse-Content-Type (or ct ""))
+                       cte)
+      )))
+
+(set-alist 'mime-viewer/quitting-method-alist
+          'vm-mode
+          'tm-vm/quit-view-message)
+
+(set-alist 'mime-viewer/quitting-method-alist
+          'vm-virtual-mode
+          'tm-vm/quit-view-message)
+
+
 ;;; @ for tm-partial
 ;;;
 
@@ -163,12 +305,141 @@ all marked messages are affected, other messages are ignored."
 ;;; @ for tm-edit
 ;;;
 
+;; 1995/11/9 by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
+;;     (c.f. [tm ML:1075])
+(defun tm-vm/insert-message (&optional message)
+  (interactive)
+  (let* (mail-yank-hooks
+        (mail-citation-hook '(mime-editor/inserted-message-filter))
+        (mail-reply-buffer vm-mail-buffer)
+        )
+    (if (null message)
+        (call-interactively 'vm-yank-message)
+      (vm-yank-message message))
+    ))
+
+
+;;; @@ for multipart/digest
+;;;
+
+(defun tm-vm/enclose-messages (mlist)
+  "Enclose the messages in MLIST as multipart/digest.
+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)
+       (save-restriction
+         (narrow-to-region (point) (point))
+         (while mlist
+           (setq m (vm-real-message-of (car mlist)))
+            (mime-editor/insert-tag "message" "rfc822")
+            (tm-vm/insert-message m)
+            (goto-char (point-max))
+           (setq mlist (cdr mlist)))
+          (mime-editor/enclose-digest-region (point-min) (point-max))
+          ))))
+
+(defun tm-vm/forward-message ()
+  "Forward the current message to one or more recipients.
+You will be placed in a Mail mode buffer as you would with a
+reply, but you must fill in the To: header and perhaps the
+Subject: header manually."
+  (interactive)
+  (if (not (equal vm-forwarding-digest-type "rfc1521"))
+      (vm-forward-message)
+    (vm-follow-summary-cursor)
+    (vm-select-folder-buffer)
+    (vm-check-for-killed-summary)
+    (vm-error-if-folder-empty)
+    (if (eq last-command 'vm-next-command-uses-marks)
+        (let ((vm-digest-send-type vm-forwarding-digest-type))
+          (setq this-command 'vm-next-command-uses-marks)
+          (command-execute 'tm-vm/send-digest))
+      (let ((dir default-directory)
+            (mp vm-message-pointer))
+        (save-restriction
+          (widen)
+          (vm-mail-internal
+           (format "forward of %s's note re: %s"
+                   (vm-su-full-name (car vm-message-pointer))
+                   (vm-su-subject (car vm-message-pointer)))
+           nil
+           (and vm-forwarding-subject-format
+                (let ((vm-summary-uninteresting-senders nil))
+                  (vm-sprintf 'vm-forwarding-subject-format (car mp)))))
+          (make-local-variable 'vm-forward-list)
+          (setq vm-system-state 'forwarding
+                vm-forward-list (list (car mp))
+                default-directory dir)
+          (goto-char (point-min))
+          (re-search-forward
+           (concat "^" (regexp-quote mail-header-separator) "\n") nil 0)
+          (tm-vm/enclose-messages vm-forward-list)
+          (mail-position-on-field "To"))
+        ;; (run-hooks 'tm-vm/forward-message-hook) ; Is it necessary?
+        (run-hooks 'vm-mail-mode-hook)))))
+
+(defun tm-vm/send-digest (&optional prefix)
+  "Send a digest of all messages in the current folder to recipients.
+The type of the digest is specified by the variable vm-digest-send-type.
+You will be placed in a Mail mode buffer as is usual with replies, but you
+must fill in the To: and Subject: headers manually.
+
+If invoked on marked messages (via vm-next-command-uses-marks),
+only marked messages will be put into the digest."
+  (interactive "P")
+  (if (not (equal vm-digest-send-type "rfc1521"))
+      (vm-send-digest prefix)
+    (vm-select-folder-buffer)
+    (vm-check-for-killed-summary)
+    (vm-error-if-folder-empty)
+    (let ((dir default-directory)
+          (mlist (if (eq last-command 'vm-next-command-uses-marks)
+                     (vm-select-marked-or-prefixed-messages 0)
+                   vm-message-list)))
+      (save-restriction
+        (widen)
+        (vm-mail-internal (format "digest from %s" (buffer-name)))
+        (setq vm-system-state 'forwarding
+              default-directory dir)
+        (goto-char (point-min))
+        (re-search-forward (concat "^" (regexp-quote mail-header-separator)
+                                   "\n"))
+        (goto-char (match-end 0))
+        (vm-unsaved-message "Building %s digest..." vm-digest-send-type)
+        (tm-vm/enclose-messages mlist)
+        (mail-position-on-field "To")
+        (message "Building %s digest... done" vm-digest-send-type)))
+    ;; (run-hooks 'tm-vm/send-digest-hook) ; Is it necessary?
+    (run-hooks 'vm-mail-mode-hook)))
+
+
+;;; @@ setting
+;;;
+
+(substitute-key-definition 'vm-forward-message
+                          'tm-vm/forward-message vm-mode-map)
+(substitute-key-definition 'vm-send-digest
+                          'tm-vm/send-digest vm-mode-map)
+
+(call-after-loaded
+ 'tm-edit
+ (function
+  (lambda ()
+    (set-alist 'mime-editor/message-inserter-alist
+              'mail-mode (function tm-vm/insert-message))
+    )))
+
 (call-after-loaded
  'mime-setup
  (function
   (lambda ()
     (remove-hook 'mail-mode-hook 'mime/editor-mode)
     (add-hook 'vm-mail-mode-hook 'mime/editor-mode)
+    (setq vm-forwarding-digest-type "rfc1521")
+    (setq vm-digest-send-type "rfc1521")
     )))