tm 7.41.1.
authormorioka <morioka>
Mon, 9 Mar 1998 12:47:59 +0000 (12:47 +0000)
committermorioka <morioka>
Mon, 9 Mar 1998 12:47:59 +0000 (12:47 +0000)
19 files changed:
ChangeLog
Makefile
doc/tm-edit=ja.texi [new file with mode: 0644]
doc/tm-ew=ja.texi
doc/tm-view=ja.texi
doc/tm_ja.texi
gnus/ChangeLog
gnus/Makefile
gnus/s-path
gnus/tm-gnus3.el
gnus/tm-gnus4.el
gnus/tm-sgnus.el
mh-e/ChangeLog
mh-e/tm-mh-e.el
mk-tm
tm-bbdb.el [new file with mode: 0644]
tm-rmail.el
tm-view.el
tm-vm.el

index ef1a511..47f26a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+Tue Jan 23 05:38:46 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm: Version 7.41.1 was released.
+       * tm/mh-e: Version 7.46 was released.
+       * tm/gnus: Version 7.34 was released.
+
+       * tm-view.el: declare `(defvar mime::preview/article-buffer nil)'
+       for XEmacs
+
+Tue Jan 23 04:49:16 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm-rmail.el: (require 'tm-bbdb) if bbdb is provided.
+
+       * tm-vm.el: Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>'s
+       new implementation
+
+       * tm-bbdb.el: new module: about BBDB
+
 Sat Jan 20 13:23:47 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
 
        * tl: Version 7.09 was released.
index 30cfadb..e7e254f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ TM_FILES = tm/README.en tm/ChangeLog \
                tm/tm-play.el tm/tm-partial.el tm/tm-pgp.el \
                tm/tm-ftp.el tm/tm-latex.el tm/tm-html.el tm/tm-file.el \
                tm/tm-tar.el \
+               tm/tm-bbdb.el \
                tm/tm-edit.el tm/signature.el \
                tm/tm-setup.el tm/mime-setup.el \
                tm/sc-setup.el \
@@ -39,7 +40,7 @@ TL_FILES = tl/README.en tl/Makefile tl/mk-tl tl/*.el tl/doc/*.texi \
 
 FILES  = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES)
 
-TARFILE = tm7.41.tar.gz
+TARFILE = tm7.41.1.tar.gz
 
 
 18:
diff --git a/doc/tm-edit=ja.texi b/doc/tm-edit=ja.texi
new file mode 100644 (file)
index 0000000..95f1932
--- /dev/null
@@ -0,0 +1,200 @@
+@c $Id: tm-edit=ja.texi,v 1.1 1996/01/23 05:04:48 morioka Exp $
+
+@node tm-edit, encoded-word, tm-view, Top
+@comment  node-name,  next,  previous,  up
+@chapter tm-edit
+@cindex tm-edit
+
+tm-edit ¤Ï GNU Emacs ¤ÇÆ°ºî¤¹¤ëÈÆÍÑŪ¤Ê MIME viewer ¤Ç¤¹¡£
+
+tm-edit ¤Ï GNUS ¤Îºî¼Ô¤È¤·¤Æ¤âͭ̾¤Ê UMEDA Masanobu
+<umerin@@mse.kyutech.ac.jp> ¤µ¤ó¤¬½ñ¤«¤ì¤¿ mime.el ¤ò´ð¤Ë
+
+@itemize
+@item RFC 1521/1522 ²½
+@item Content-Disposition field (RFC 1806) ¤ÎÍøÍÑ
+@item Æþ¤ì»Ò¤Ë¤Ê¤Ã¤¿ multi-part message
+@item PGP
+@item file type ¤Ë¤ª¤±¤ë parameter ¤Î¼«Æ°»ØÄê¤Î¶¯²½
+@end itemize
+
+¤Ê¤É¤Î²þÎɤò¹Ô¤¤¤Þ¤·¤¿¡£
+
+tm-MUA ¤Ç¤Ï tm-edit ¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢ÍưפˠMIME message ¤òºîÀ®¤Ç¤­¤Þ
+¤¹¡£
+
+
+@menu
+* mime/editor-mode::            mime/editor-mode ¤È¤Ï
+* single-part operations::      single-part ¤ÎºîÀ®
+* enclosure operation::         multi-part ¤ÎºîÀ®
+* other operations of mime/editor-mode::  ¤½¤Î¾¤ÎÁàºî 
+@end menu
+
+
+@node mime/editor-mode, single-part operations, tm-edit, tm-edit
+@comment  node-name,  next,  previous,  up
+@section mime/editor-mode
+@cindex mime/editor-mode
+
+@emph{mime/editor-mode} ¤Ï MIME message ¤òºîÀ®¤¹¤ë¤¿¤á¤Î minor mode ¤Ç
+¤¹¡£¤³¤Î mode ¤Ç¤Ï @emph{tag} ¤ò»È¤Ã¤Æ¤µ¤Þ¤¶¤Þ¤Ê¼ïÎà¤Î data ¤òɽ¸½¤·¡¢
+Ê£¿ô¤ÎÉôʬ¤«¤é¤Ê¤ë message ¤òÊÔ½¸¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
+
+@emph{tag} ¤Ë¤Ï
+
+@itemize
+@item single-part tag
+@item multi-part tag
+@end itemize
+
+¤Î£²¤Ä¤¬¤¢¤ê¤Þ¤¹¡£
+
+single-part tag ¤Ï single part ¤òɽ¸½¤¹¤ë¤¿¤á¤Î tag ¤Ç¡¢
+
+@example
+        --[[TYPE/SUBTYPE;PARAMETERS][ENCODING]
+        OPTIONAL-FIELDS]
+@end example
+
+¤È¤¤¤¦¤è¤¦¤Ê·Á¤ò¤·¤Æ¤¤¤Þ¤¹¡£
+
+TYPE/SUBTYPE ¤ª¤è¤Ó PARAMETERS ¤Ï Content-Type field ¤Î type/subtype 
+¤ª¤è¤Ó parameters ¤òɽ¤·¤Þ¤¹¡£TYPE/SUBTYPE ¤Ïɬ¿Ü¤Ç¤¢¤ê¡¢PARAMETERS ¤Ï
+¾Êά²Ä¤Ç¤¹¡£
+
+ENCODING ¤Ï Content-Transfer-Encoding field ¤òɽ¤·¤Þ¤¹¡£¤³¤ì¤â¾Êά²Ä¤Ç
+¤¹¡£
+
+OPTIONAL-FIELDS ¤Ï Content-Type, Content-Transfer-Encoding °Ê³°¤Î 
+field ¤ò½ñ¤¯¤¿¤á¤ÎÉôʬ¤Ç¡¢¾Êά²Ä¤Ç¤¹¡£
+
+multi-part tag ¤Ï multi part ¤òɽ¸½¤¹¤ë¤¿¤á¤Î tag ¤Ç¡¢
+
+@example
+        --<<TYPE>>-{
+@end example
+
+¤È¤¤¤¦·Á¤Î @emph{multi-part ³«»Ï tag} ¤È¸Æ¤Ð¤ì¤ë multi part ¤Î³«»Ï¤ò¼¨
+¤¹ tag ¤È
+
+@example
+        --}-<<TYPE>>
+@end example
+
+
+¤È¤¤¤¦·Á¤Î @emph{multi-part ½ªÎ» tag} ¤È¸Æ¤Ð¤ì¤ë multi part ¤Î½ªÎ»¤ò¼¨
+¤¹ tag ¤¬¤¢¤ê¤Þ¤¹¡£
+
+¤Þ¤¿¡¢multi-part ³«»Ï tag ¤È multi-part ½ªÎ» tag ¤Ç°Ï¤Þ¤ì¤¿Éôʬ¤ò 
+@emph{enclosure} ¤È¸Æ¤Ó¤Þ¤¹¡£
+
+
+@node single-part operations, enclosure operation, mime/editor-mode, tm-edit
+@comment  node-name,  next,  previous,  up
+@section single-part ¤ËÂФ¹¤ëÁàºî
+@cindex single-part
+
+single-part ¤òºî¤ë¤¿¤á¤ÎÁàºî¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£
+
+@table @kbd
+@item @key{C-c C-x C-t}
+text part ¤òɽ¤¹ single-part tag ¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-i}
+file ¤ò MIME part ¤È¤·¤ÆźÉÕ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-e}
+external part ¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-v}
+@key{C-g} ¤¬²¡¤µ¤ì¤ë¤Þ¤ÇÏ¿²»¤ò¹Ô¤¤¡¢²»À¼ part ¤òÁÞÆþ¤·¤Þ¤¹¡£¡Ê»ÈÍѤǤ­
+¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡Ë
+
+@item @key{C-c C-x C-y}
+¸½ºßɽ¼¨Ãæ¤Î (mail or news) message ¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-m}
+mail message ¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-w, C-c C-x C-s}
+signature ¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-k}
+PGP ¤Î¸ø³«¸°¤òÁÞÆþ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x t}
+Ǥ°Õ¤Î single-part tag ¤òÁÞÆþ¤·¤Þ¤¹¡£
+@end table
+
+
+@node enclosure operation, other operations of mime/editor-mode, single-part operations, tm-edit
+@comment  node-name,  next,  previous,  up
+@section enclosure ¤ËÂФ¹¤ëÁàºî
+@cindex multi-part
+@cindex enclosure
+
+enclosure ¤òºî¤ë¤¿¤á¤ÎÁàºî¤È¤·¤Æ¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£
+
+@table @kbd
+@item @key{C-c C-x a}
+»ØÄꤷ¤¿ region ¤ò multipart/alternative ¤È¤·¤Æ°Ï¤ß¤Þ¤¹¡£
+
+@item @key{C-c C-x p}
+»ØÄꤷ¤¿ region ¤ò multipart/parallel ¤È¤·¤Æ°Ï¤ß¤Þ¤¹¡£
+
+@item @key{C-c C-x m}
+»ØÄꤷ¤¿ region ¤ò multipart/mixed ¤È¤·¤Æ°Ï¤ß¤Þ¤¹¡£
+
+@item @key{C-c C-x d}
+»ØÄꤷ¤¿ region ¤ò multipart/digest ¤È¤·¤Æ°Ï¤ß¤Þ¤¹¡£
+
+@item @key{C-c C-x s}
+»ØÄꤷ¤¿ region ¤ËÅŻҽð̾¤ò¹Ô¤¤¤Þ¤¹¡£(*1)
+
+@item @key{C-c C-x e}
+»ØÄꤷ¤¿ region ¤ò°Å¹æ²½¤·¤Þ¤¹¡£(*1)
+@end table
+
+@b{¡ÎÃí°Õ¡Ï}
+@enumerate
+@item
+¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï Mailcrypt package ¤È pgp package ¤¬É¬ÍפǤ¹¡£¤Þ
+¤¿¡¢ÊÑ¿ô @code{mime-editor/signing-type} ¤ÈÊÑ¿ô 
+@code{mime-editor/encrypting-type} ¤Ë @code{pgp-elkins} ¤« 
+@code{pgp-kazu} ¤òÂåÆþ¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+@code{pgp-elkins} ¤ò»ØÄꤷ¤¿¾ì¹ç draft-elkins-pem-pgp-02.txt ¤¬»È¤ï¤ì¡¢
+@code{pgp-kazu} ¤ò»ØÄꤷ¤¿¾ì¹ç draft-kazu-pgp-mime-00.txt ¤¬»È¤ï¤ì¤Þ¤¹¡£
+@end enumerate
+
+
+@node other operations of mime/editor-mode,  , enclosure operation, tm-edit
+@comment  node-name,  next,  previous,  up
+@section mime/editor-mode ¤Ë¤ª¤±¤ë¤½¤Î¾¤ÎÁàºî
+
+mime/editor-mode ¤Ë¤ª¤±¤ë¤½¤Î¾¤ÎÁàºî¤òÀâÌÀ¤·¤Þ¤¹¡£
+
+@table @kbd
+@item @key{C-c C-c}
+ÊÔ½¸Ãæ¤Î message ¤òÁ÷¿®¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-p}
+ÊÔ½¸Ãæ¤Î message ¤ò preview ¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x C-z}
+ÊÔ½¸Ãæ¤Î message ¤òÁ÷¿®¤¹¤ë¤³¤È¤Ê¤¯¡¢mime/editor-mode ¤ò½ªÎ»¤·¤Þ¤¹¡£
+
+@item @key{C-c C-x ?}
+help message ¤òɽ¼¨¤·¤Þ¤¹¡£
+
+@item @key{M-x mime-editor/set-split}
+Â礭¤Ê message ¤òÁ÷¿®¤¹¤ë¾ì¹ç¤Ë message/partial ·Á¼°¤Ë¼«Æ°Ê¬³ä²Äǽ¤È¤¹
+¤ë¤«¤É¤¦¤«¤ò·è¤á¤Þ¤¹¡£
+
+@item @key{M-x mime-editor/set-sign}
+message Á´ÂΤò @code{pgp-kazu} ·Á¼°¤ÇÅŻҽð̾¤¹¤ë¤«¤É¤¦¤«¤ò·è¤á¤Þ¤¹¡£
+
+@item @key{M-x mime-editor/set-encrypt}
+message Á´ÂΤò @code{pgp-kazu} ·Á¼°¤Ç°Å¹æ²½¤¹¤ë¤«¤É¤¦¤«¤ò·è¤á¤Þ¤¹¡£
+@end table
index 5b72cbd..3b9b588 100644 (file)
@@ -1,6 +1,6 @@
-@c $Id: tm-ew=ja.texi,v 4.0 1995/12/17 22:55:44 morioka Exp $
+@c $Id: tm-ew=ja.texi,v 4.0 1995/12/17 22:55:44 morioka Exp morioka $
 
-@node encoded-word, customize, tm-view, Top
+@node encoded-word, customize, tm-edit, Top
 @comment  node-name,  next,  previous,  up
 @chapter encoded-word
 @cindex encoded-word
index 2163552..f0a02cf 100644 (file)
@@ -1,6 +1,6 @@
-@c $Id: tm-view=ja.texi,v 7.10 1995/12/25 10:00:27 morioka Exp $
+@c $Id: tm-view=ja.texi,v 7.10 1995/12/25 10:00:27 morioka Exp morioka $
 
-@node tm-view, encoded-word, tm-MUA, Top
+@node tm-view, tm-edit, tm-MUA, Top
 @comment  node-name,  next,  previous,  up
 @chapter tm-view
 @cindex tm-view
index f21994e..518efb0 100644 (file)
@@ -31,6 +31,7 @@ GNU Emacs 
 * tm-vm: (tm-vm_ja.info).       VM
 
 * tm-view::                     MIME message ¤Î±ÜÍ÷
+* tm-edit::                     MIME message ¤ÎºîÀ®
 * encoded-word::                
 * customize::                   tm ¤Î customize
 
@@ -384,6 +385,8 @@ support 
 
 @include tm-view=ja.texi
 
+@include tm-edit=ja.texi
+
 @include tm-ew=ja.texi
 
 @include tm-util=ja.texi
index 29bfd0e..2c04f28 100644 (file)
@@ -1,3 +1,11 @@
+Tue Jan 23 04:57:53 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm/gnus: Version 7.34 was released.
+
+       * tm-sgnus.el, tm-gnus4.el, tm-gnus3.el:
+       (require 'tm-bbdb) if bbdb is provided.
+
+\f
 Sat Jan 20 02:23:40 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
 
        * tm/gnus: Version 7.33.1 was released.
index 625614a..1bc540c 100644 (file)
@@ -28,7 +28,7 @@ TMDIR19_29 = $(DATADIR19_29)/$(EMACS_PREFIX)/site-lisp
 
 FILES  = tm/gnus/*.el tm/doc/tm-gnus*.texi
 
-TARFILE = tm-gnus7.33.1.tar
+TARFILE = tm-gnus7.34.tar
 
 
 gnus:
index c94a383..ec13557 100644 (file)
@@ -7,4 +7,4 @@
 ;;;
 
 ;; please edit
-(add-path "sgnus-0.29/lisp" 'all-paths)
+(add-path "sgnus-0.30/lisp" 'all-paths)
index ec1d7da..f7b3833 100644 (file)
@@ -7,7 +7,7 @@
 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1993/11/20
-;;; Version: $Revision: 7.3 $
+;;; Version: $Revision: 7.4 $
 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -25,6 +25,8 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with This program.  If not, write to the Free Software
 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
 
 (require 'tl-list)
 (require 'tl-str)
@@ -44,7 +46,7 @@
 ;;;
 
 (defconst tm-gnus/RCS-ID
-  "$Id: tm-gnus3.el,v 7.3 1995/11/21 02:08:31 morioka Exp $")
+  "$Id: tm-gnus3.el,v 7.4 1996/01/23 04:53:43 morioka Exp $")
 
 (defconst tm-gnus/version
   (concat (get-version-string tm-gnus/RCS-ID) " for GNUS 3"))
@@ -234,8 +236,17 @@ With arg, turn MIME encoded-word processing on iff arg is positive."
 
 (tm-gnus/bbdb-setup)
 
+(call-after-loaded
+ 'bbdb
+ (function
+  (lambda ()
+    (require 'tm-bbdb)
+    )))
+
 
 ;;; @ end
 ;;;
 
 (provide 'tm-gnus3)
+
+;;; tm-gnus3.el ends here
index e59f8e6..9b227dc 100644 (file)
@@ -8,7 +8,7 @@
 ;;; modified by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1993/11/20 (merged tm-gnus5.el)
-;;; Version: $Revision: 7.15 $
+;;; Version: $Revision: 7.16 $
 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
 ;;;
 
 (defconst tm-gnus/RCS-ID
-  "$Id: tm-gnus4.el,v 7.15 1995/12/20 12:00:19 morioka Exp $")
+  "$Id: tm-gnus4.el,v 7.16 1996/01/23 04:56:21 morioka Exp $")
 
 (defconst tm-gnus/version
-  (concat (get-version-string tm-gnus/RCS-ID) " for 3.15 .. 5.1"))
+  (concat (get-version-string tm-gnus/RCS-ID) " for 3.15 .. 5.1.*"))
 
 
 ;;; @ variable
@@ -227,8 +227,17 @@ This variable is set to `gnus-show-mime'.")
 
 (tm-gnus/bbdb-setup)
 
+(call-after-loaded
+ 'bbdb
+ (function
+  (lambda ()
+    (require 'tm-bbdb)
+    )))
+
 
 ;;; @ end
 ;;;
 
 (provide 'tm-gnus4)
+
+;;; tm-gnus4.el ends here
index dd7cf1f..fae6e87 100644 (file)
@@ -8,7 +8,7 @@
 ;;;         MURATA Masahiro <murata@sol.cs.ritsumei.ac.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1995/09/24
-;;; Version: $Revision: 7.33 $
+;;; Version: $Revision: 7.34 $
 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -43,7 +43,7 @@
 ;;;
 
 (defconst tm-gnus/RCS-ID
-  "$Id: tm-sgnus.el,v 7.33 1996/01/09 12:06:29 morioka Exp $")
+  "$Id: tm-sgnus.el,v 7.34 1996/01/23 04:57:53 morioka Exp $")
 
 (defconst tm-gnus/version
   (concat (get-version-string tm-gnus/RCS-ID) " for September"))
@@ -242,8 +242,16 @@ This variable is set to `gnus-show-mime'.")
 
 (tm-gnus/bbdb-setup)
 
+(call-after-loaded
+ 'bbdb
+ (lambda ()
+   (require 'tm-bbdb)
+   ))
+
 
 ;;; @ end
 ;;;
 
 (provide 'tm-sgnus)
+
+;;; tm-sgnus.el ends here
index 7192af4..7c3f06b 100644 (file)
@@ -1,3 +1,18 @@
+Tue Jan 23 04:51:18 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm/mh-e: Version 7.46 was released.
+
+       * tm-mh-e.el: (require 'tm-bbdb) if bbdb is provided.
+
+\f
+Mon Jan 22 00:42:53 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm/mh-e: Version 7.45 was released.
+
+       * tm-mh-e.el (tm-mh-e/forward):
+       `msg-or-seq' must be number or symbol, not string
+       (cf. [tm-ja:1482])
+
 Thu Jan 18 01:55:25 1996  Yoshiyuki Yamagami <yamagami@hb.nmcc.co.jp>
 
        * Makefile: specify `-no-site-file' option (cf. [tm-ja:1474])
index b1bb8cf..1bbff3a 100644 (file)
@@ -9,7 +9,7 @@
 ;;; modified by YAMAOKA Katsumi <yamaoka@ga.sony.co.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1993/11/21 (obsolete mh-e-mime.el)
-;;; Version: $Revision: 7.44 $
+;;; Version: $Revision: 7.46 $
 ;;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -47,7 +47,7 @@
 ;;;
 
 (defconst tm-mh-e/RCS-ID
-  "$Id: tm-mh-e.el,v 7.44 1995/12/13 05:48:43 morioka Exp $")
+  "$Id: tm-mh-e.el,v 7.46 1996/01/23 04:51:18 morioka Exp $")
 
 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
 
@@ -399,8 +399,6 @@ then prompt for the message sequence. See also documentation for
                         ))))
   (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))
         ;; uses "draft" for compatibility with forw.
@@ -595,6 +593,17 @@ then prompt for the message sequence. See also documentation for
     )))
 
 
+;;; @ for BBDB
+;;;
+
+(call-after-loaded
+ 'bbdb
+ (function
+  (lambda ()
+    (require 'tm-bbdb)
+    )))
+
+
 ;;; @ set up
 ;;;
 
@@ -651,3 +660,5 @@ then prompt for the message sequence. See also documentation for
 (provide 'tm-mh-e)
 
 (run-hooks 'tm-mh-e-load-hook)
+
+;;; tm-mh-e.el ends here
diff --git a/mk-tm b/mk-tm
index b9a4294..32e7a7c 100644 (file)
--- a/mk-tm
+++ b/mk-tm
 (require 'tl-misc)
 
 ;; Please specify VM path.
-(add-path "vm-5.95beta/")
+(add-path "vm-5.95beta/" 'all-paths)
 
 ;; Please specify Mailcrypt path.
-(add-path "mailcrypt-3.4/")
+(add-path "mailcrypt-3.4/" 'all-paths)
+
+;; Please specify Mailcrypt path.
+(add-path "bbdb-1.50/" 'all-paths)
+
 
 (setq tm-modules
       (cons
        (append tm-uncompile-el-files '("tm-pgp.el")))
   )
 
+(if (catch 'tag
+      (let ((paths load-path) path)
+       (while paths
+         (setq path (expand-file-name "bbdb.el" (car paths)))
+         (if (file-exists-p path)
+             (throw 'tag path)
+           )
+         (setq paths (cdr paths))
+         )))
+    (setq tm-modules (append tm-modules '("tm-bbdb")))
+  (setq tm-uncompile-el-files
+       (append tm-uncompile-el-files '("tm-bbdb.el")))
+  )
+
 (if (and (file-exists-p "tm-evs.el")
         (or (boundp 'MULE)
             (boundp 'NEMACS))
diff --git a/tm-bbdb.el b/tm-bbdb.el
new file mode 100644 (file)
index 0000000..d417606
--- /dev/null
@@ -0,0 +1,187 @@
+;;;
+;;; tm-bbdb.el --- tm shred module for BBDB
+;;;
+;;; Copyright (C) 1995 KOBAYASHI Shuhei <shuhei@cmpt01.phys.tohoku.ac.jp>
+;;;
+;;; Author: KOBAYASHI Shuhei <shuhei@cmpt01.phys.tohoku.ac.jp>
+;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Version: $Id: tm-bbdb.el,v 2.0 1996/01/23 04:34:12 morioka Exp $
+;;; Keywords: mail, news, MIME, multimedia, multilingual, BBDB
+;;;
+;;; This file is part of tm (Tools for MIME).
+;;;
+;;; This program is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU General Public License as
+;;; published by the Free Software Foundation; either version 2, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with This program.  If not, write to the Free Software
+;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;;
+;;; Code:
+
+(require 'bbdb)
+(require 'tl-822)
+(require 'tm-ew-d)
+
+(defun tm-bbdb/extract-address-components (str)
+  (let* ((ret     (rfc822/extract-address-components str))
+         (phrase  (car ret))
+         (address (cdr ret))
+         (methods tm-bbdb/canonicalize-full-name-methods))
+    (while (and phrase methods)
+      (setq phrase  (funcall (car methods) phrase)
+            methods (cdr methods)))
+    (cons phrase address)
+    ))
+
+(fset 'mail-extract-address-components
+      (symbol-function 'tm-bbdb/extract-address-components))
+(provide 'mail-extr)
+
+(or (fboundp 'tm:bbdb-extract-field-value)
+    (progn
+      ;; (require 'bbdb-hooks) ; not provided.
+      (or (fboundp 'bbdb-extract-field-value)
+          (load "bbdb-hooks"))
+      (fset 'tm:bbdb-extract-field-value
+            (symbol-function 'bbdb-extract-field-value))
+      (defun bbdb-extract-field-value (field)
+        (let ((value (rfc822/get-field-body field)))
+          (and value
+               (mime-eword/decode-string value))))
+      ))
+
+
+;;; @ full-name canonicalization methods
+;;;
+
+(defun tm-bbdb/canonicalize-spaces (str)
+  (let (dest)
+    (while (string-match "\\s +" str)
+      (setq dest (cons (substring str 0 (match-beginning 0)) dest))
+      (setq str (substring str (match-end 0)))
+      )
+    (or (string= str "")
+        (setq dest (cons str dest)))
+    (setq dest (nreverse dest))
+    (mapconcat 'identity dest " ")
+    ))
+
+(defun tm-bbdb/canonicalize-dots (str)
+  (let (dest)
+    (while (string-match "\\." str)
+      (setq dest (cons (substring str 0 (match-end 0)) dest))
+      (setq str (substring str (match-end 0)))
+      )
+    (or (string= str "")
+        (setq dest (cons str dest)))
+    (setq dest (nreverse dest))
+    (mapconcat 'identity dest " ")
+    ))
+
+(defvar tm-bbdb/canonicalize-full-name-methods nil)
+
+(setq tm-bbdb/canonicalize-full-name-methods
+      '(mime-eword/decode-string
+        tm-bbdb/canonicalize-dots
+        tm-bbdb/canonicalize-spaces))
+
+
+;;; @ BBDB functions for mime/viewer-mode
+;;;
+
+(defvar tm-bbdb/auto-create-p nil)
+
+(defun tm-bbdb/update-record (&optional offer-to-create)
+  "Return the record corresponding to the current MIME previewing message.
+Creating or modifying it as necessary. A record will be created if
+tm-bbdb/auto-create-p is non-nil, or if OFFER-TO-CREATE is non-nil and
+the user confirms the creation."
+  (save-excursion
+    (and mime::article/preview-buffer
+         (get-buffer mime::article/preview-buffer)
+         (set-buffer mime::article/preview-buffer))
+    (if bbdb-use-pop-up
+        (tm-bbdb/pop-up-bbdb-buffer offer-to-create)
+    (let ((from (rfc822/get-field-body "From")))
+      (if (or (null from)
+              (string-match (bbdb-user-mail-names)
+                            (car
+                             (cdr
+                              ;; (tm-bbdb/extract-address-components from)
+                              (mail-extract-address-components from)
+                              ))))
+          (setq from (or (rfc822/get-field-body "To")
+                         from)))
+      (if from
+          (bbdb-annotate-message-sender
+           from t
+           (or (bbdb-invoke-hook-for-value tm-bbdb/auto-create-p)
+               offer-to-create)
+           offer-to-create))
+      ))))
+
+(defun tm-bbdb/annotate-sender (string)
+  "Add a line to the end of the Notes field of the BBDB record 
+corresponding to the sender of this message."
+  (interactive
+   (list (if bbdb-readonly-p
+             (error "The Insidious Big Brother Database is read-only.")
+           (read-string "Comments: "))))
+  (bbdb-annotate-notes (tm-bbdb/update-record t) string))
+
+(defun tm-bbdb/edit-notes (&optional arg)
+  "Edit the notes field or (with a prefix arg) a user-defined field
+of the BBDB record corresponding to the sender of this message."
+  (interactive "P")
+  (let ((record (or (tm-bbdb/update-record t)
+                    (error ""))))
+    (bbdb-display-records (list record))
+    (if arg
+       (bbdb-record-edit-property record nil t)
+      (bbdb-record-edit-notes record t))))
+
+(defun tm-bbdb/show-sender ()
+  "Display the contents of the BBDB for the sender of this message.
+This buffer will be in bbdb-mode, with associated keybindings."
+  (interactive)
+  (let ((record (tm-bbdb/update-record t)))
+    (if record
+       (bbdb-display-records (list record))
+       (error "unperson"))))
+
+(defun tm-bbdb/pop-up-bbdb-buffer (&optional offer-to-create)
+  "Make the *BBDB* buffer be displayed along with the MIME preview window(s),
+displaying the record corresponding to the sender of the current message."
+  (bbdb-pop-up-bbdb-buffer
+    (function (lambda (w)
+      (let ((b (current-buffer)))
+       (set-buffer (window-buffer w))
+       (prog1 (eq major-mode 'mime/viewer-mode)
+         (set-buffer b))))))
+  (let ((bbdb-gag-messages t)
+       (bbdb-use-pop-up nil)
+       (bbdb-electric-p nil))
+    (let ((record (tm-bbdb/update-record offer-to-create))
+         (bbdb-elided-display (bbdb-pop-up-elided-display))
+         (b (current-buffer)))
+      (bbdb-display-records (if record (list record) nil))
+      (set-buffer b)
+      record)))
+
+
+;;; @ end
+;;;
+
+(provide 'tm-bbdb)
+
+(run-hooks 'tm-bbdb-load-hook)
+
+;;; end of tm-bbdb.el
index 98b2415..3e617dc 100644 (file)
@@ -6,7 +6,7 @@
 ;;; modified by KOBAYASHI Shuhei <shuhei@cmpt01.phys.tohoku.ac.jp>
 ;;; Created: 1994/8/30
 ;;; Version:
-;;;    $Revision: 7.22 $
+;;;    $Revision: 7.23 $
 ;;; Keywords: mail, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -40,7 +40,7 @@
 ;;;
 
 (defconst tm-rmail/RCS-ID
-  "$Id: tm-rmail.el,v 7.22 1995/12/25 09:08:50 morioka Exp $")
+  "$Id: tm-rmail.el,v 7.23 1996/01/23 04:49:16 morioka Exp $")
 (defconst tm-rmail/version (get-version-string tm-rmail/RCS-ID))
 
 (defvar tm-rmail/decode-all nil)
@@ -361,9 +361,22 @@ GNUS. The message will be appended if being composed."
     )))
 
 
+;;; @ for BBDB
+;;;
+
+(call-after-loaded
+ 'bbdb
+ (function
+  (lambda ()
+    (require 'tm-bbdb)
+    )))
+
+
 ;;; @ end
 ;;;
 
 (provide 'tm-rmail)
 
 (run-hooks 'tm-rmail-load-hook)
+
+;;; tm-rmail.el ends here.
index 075446f..2043900 100644 (file)
@@ -8,7 +8,7 @@
 ;;; modified by Steven L. Baur <steve@miranova.com>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1994/7/13 (1994/8/31 obsolete tm-body.el)
-;;; Version: $Revision: 7.39 $
+;;; Version: $Revision: 7.40 $
 ;;; Keywords: mail, news, MIME, multimedia
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -44,7 +44,7 @@
 ;;;
 
 (defconst mime-viewer/RCS-ID
-  "$Id: tm-view.el,v 7.39 1995/12/25 07:54:02 morioka Exp $")
+  "$Id: tm-view.el,v 7.40 1996/01/23 05:38:46 morioka Exp $")
 
 (defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
 (defconst mime/viewer-version mime-viewer/version)
@@ -303,6 +303,7 @@ Each elements are regexp of field-name. [tm-view.el]")
 ;; for XEmacs
 (defvar mime::article/preview-buffer nil)
 (defvar mime::article/code-converter nil)
+(defvar mime::preview/article-buffer nil)
 
 (make-variable-buffer-local 'mime::article/content-info)
 (make-variable-buffer-local 'mime::article/preview-buffer)
@@ -1079,3 +1080,5 @@ listed in key order:
 (provide 'tm-view)
 
 (run-hooks 'tm-view-load-hook)
+
+;;; tm-view.el ends here
index bcc34e8..a9718ed 100644 (file)
--- a/tm-vm.el
+++ b/tm-vm.el
@@ -10,9 +10,9 @@
 ;;;           Oscar Figueiredo <figueire@lspsun2.epfl.ch>
 ;;; modified by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
 ;;;         and ISHIHARA Akito <aki@bpel.tutics.tut.ac.jp>
-;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; Maintainer: Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
 ;;; Created: 1994/10/29
-;;; Version: $Revision: 7.37 $
+;;; Version: $Revision: 7.39 $
 ;;; Keywords: mail, MIME, multimedia, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -39,7 +39,7 @@
 (require 'vm)
 
 (defconst tm-vm/RCS-ID
-  "$Id: tm-vm.el,v 7.37 1995/12/18 19:25:24 morioka Exp $")
+  "$Id: tm-vm.el,v 7.39 1996/01/23 04:46:54 morioka Exp $")
 (defconst tm-vm/version (get-version-string tm-vm/RCS-ID))
 
 (define-key vm-mode-map "Z" 'tm-vm/view-message)
@@ -80,6 +80,20 @@ If you use tiny-mime patch for VM (by RIKITAKE Kenji
 (defun vm-su-subject (m)
   (mime-eword/decode-string (tm:vm-su-subject m))
   )
+
+(or (fboundp 'tm:vm-su-full-name)
+    (fset 'tm:vm-su-full-name (symbol-function 'vm-su-full-name))
+    )
+(defun vm-su-full-name (m)
+  (mime-eword/decode-string (tm:vm-su-full-name m))
+  )
+
+(or (fboundp 'tm:vm-su-to-names)
+    (fset 'tm:vm-su-to-names (symbol-function 'vm-su-to-names))
+    )
+(defun vm-su-to-names (m)
+  (mime-eword/decode-string (tm:vm-su-to-names m))
+  )
 ;;;
 ))
 
@@ -134,263 +148,337 @@ all marked messages are affected, other messages are ignored."
        (vm-preview-current-message)
        (setq vbufs (cdr vbufs))))))
 
-
+\f
 ;;; @ automatic MIME preview
 ;;;
 
 (defvar tm-vm/automatic-mime-preview t
   "*If non-nil, show MIME processed article.")
 
+(defvar tm-vm/strict-mime t
+  "*If nil, do MIME processing even if there is not MIME-Version field.")
+
 (defvar tm-vm/select-message-hook nil
   "*List of functions called every time a message is selected.
 tm-vm uses `vm-select-message-hook', use this hook instead.")
 
+(defvar tm-vm/system-state nil)
+(defun tm-vm/system-state ()
+  (save-excursion
+    (if mime::preview/article-buffer
+        (set-buffer mime::preview/article-buffer)
+      (vm-select-folder-buffer))
+    tm-vm/system-state))
+
+(defun tm-vm/display-preview-buffer ()
+  (let* ((mbuf (current-buffer))
+         (mwin (vm-get-visible-buffer-window mbuf))
+         (pbuf (and mime::article/preview-buffer
+                    (get-buffer mime::article/preview-buffer)))
+         (pwin (and pbuf (vm-get-visible-buffer-window pbuf)))) 
+    (if (and pbuf (tm-vm/system-state))
+        ;; display preview buffer
+        (cond
+         ((and mwin pwin)
+          (vm-undisplay-buffer mbuf)
+          (tm-vm/show-current-message))
+         ((and mwin (not pwin))
+          (set-window-buffer mwin pbuf)
+          (tm-vm/show-current-message))
+         (pwin
+          (tm-vm/show-current-message))
+         (t
+          ;; don't display if neither mwin nor pwin was displayed before.
+          ))
+      ;; display folder buffer
+      (cond
+       ((and mwin pwin)
+        (vm-undisplay-buffer pbuf))
+       ((and (not mwin) pwin)
+        (set-window-buffer pwin mbuf))
+       (mwin
+        ;; folder buffer is already displayed.
+        )
+       (t
+        ;; don't display if neither mwin nor pwin was displayed before.
+        )))
+    (set-buffer mbuf)))
+
 (defun tm-vm/preview-current-message ()
-  ;;; suggested by Simon Rowe <smr@robots.oxford.ac.uk>
-  ;;;  (cf. [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.
-  (vm-save-buffer-excursion
-   (if (get-buffer-window mime/output-buffer-name)
-       (delete-window (get-buffer-window (get-buffer mime/output-buffer-name)))
-     )
-   ;; fixed by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
-   ;;  1995/12/4 (cf. [tm-ja:1190])
-   (if (and vm-message-pointer tm-vm/automatic-mime-preview
-            ;; fixed by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-            ;; 1995/11/17 (cf. [tm-ja:1120])
-            (display-buffer (current-buffer))
-            (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)) buf)
-         (setq buf (window-buffer win))
-         (let ((pwin (and mime::article/preview-buffer
-                          (get-buffer mime::article/preview-buffer)
-                          (get-buffer-window mime::article/preview-buffer))))
-           (if (and pwin
-                    (not (eq win pwin)))
-               (delete-window pwin)
-             ))
-         (vm-display nil nil
-                     '(vm-next-message
-                       vm-previous-message
-                       vm-delete-message
-                       vm-undelete-message
-                       vm-scroll-forward vm-scroll-backward)
-                     (list this-command 'reading-message))
-         (setq win (get-buffer-window buf))
-         (if win
-             (select-window win)
-           )
-         (save-window-excursion
-           (vm-select-folder-buffer)
-           (setq win (get-buffer-window (current-buffer)))
-           ;; (vm-display (current-buffer) t
-           ;;             '(vm-scroll-forward vm-scroll-backward)
-           ;;             (list this-command 'reading-message))
-           ;; (select-window (get-buffer-window (current-buffer)))
-           (mime/viewer-mode)
-           (setq buf (current-buffer))
-           )
-         (set-window-buffer win buf)
-         ;;(select-window win)
-         )
-     ;; fixed by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-     ;;        1995/11/17
-     (if (and mime::article/preview-buffer
-              (get-buffer mime::article/preview-buffer))
-         (kill-buffer mime::article/preview-buffer))
-     (if tm-vm/automatic-mime-preview
-         (let (buffer-read-only)
-           (mime/decode-message-header)
-           ))
-     ))
+  ;; assumed current buffer is folder buffer.
+  (setq tm-vm/system-state nil)
+  (if (get-buffer mime/output-buffer-name)
+      (vm-undisplay-buffer mime/output-buffer-name))
+  (if (and vm-message-pointer tm-vm/automatic-mime-preview)
+      (if (or (not tm-vm/strict-mime)
+              (vm-get-header-contents (car vm-message-pointer)
+                                      "MIME-Version:"))
+          ;; do MIME processiong.
+          (progn
+            (set (make-local-variable 'tm-vm/system-state) 'previewing)
+            (save-window-excursion
+              (mime/viewer-mode)
+              (goto-char (point-min))
+              (narrow-to-region (point)
+                                (search-forward "\n\n" nil t))
+              ))
+        ;; don't do MIME processing. decode header only.
+        (let (buffer-read-only)
+          (mime/decode-message-header))
+        )
+    ;; don't preview; do nothing.
+    )
+  (tm-vm/display-preview-buffer)
   (run-hooks 'tm-vm/select-message-hook))
 
+(defun tm-vm/show-current-message ()
+  (if mime::preview/article-buffer
+      (set-buffer mime::preview/article-buffer)
+    (vm-select-folder-buffer))
+  ;; Now current buffer is folder buffer.
+  (if (or t ; mime/viewer-mode doesn't support narrowing yet.
+          (null vm-preview-lines)
+          (and (not vm-preview-read-messages)
+               (not (vm-new-flag
+                     (car vm-message-pointer)))
+               (not (vm-unread-flag
+                     (car vm-message-pointer)))))
+      (save-excursion
+        (set-buffer mime::article/preview-buffer)
+        (save-excursion
+          (save-excursion
+            (goto-char (point-min))
+            (widen))
+          ;; narrow to page; mime/viewer-mode doesn't support narrowing yet.
+          )))
+  (if (vm-get-visible-buffer-window mime::article/preview-buffer)
+      (progn
+        (setq tm-vm/system-state 'reading)
+        (if (vm-new-flag (car vm-message-pointer))
+            (vm-set-new-flag (car vm-message-pointer) nil))
+        (if (vm-unread-flag (car vm-message-pointer))
+            (vm-set-unread-flag (car vm-message-pointer) nil))
+        (vm-update-summary-and-mode-line)
+        (tm-vm/howl-if-eom))
+    (vm-update-summary-and-mode-line)))
+
+(defun tm-vm/toggle-preview-mode ()
+  (interactive)
+  (vm-select-folder-buffer)
+  (vm-display (current-buffer) t (list this-command)
+              (list this-command 'reading-message))
+  (if tm-vm/automatic-mime-preview
+      (setq tm-vm/automatic-mime-preview nil
+            tm-vm/system-state nil)
+    (setq tm-vm/automatic-mime-preview t
+          tm-vm/system-state nil)
+    (save-restriction
+       (vm-widen-page)
+       (let* ((mp (car vm-message-pointer))
+              (exposed (= (point-min) (vm-start-of mp))))
+         (if (or (not tm-vm/strict-mime)
+                 (vm-get-header-contents mp "MIME-Version:"))
+             ;; do MIME processiong.
+             (progn
+               (set (make-local-variable 'tm-vm/system-state) 'previewing)
+               (save-window-excursion
+                 (mime/viewer-mode)
+                 (goto-char (point-min))
+                 (narrow-to-region (point)
+                                   (search-forward "\n\n" nil t))
+                 ))
+           ;; don't do MIME processing. decode header only.
+           (let (buffer-read-only)
+             (mime/decode-message-header))
+           )
+         ;; don't preview; do nothing.
+         ))
+    (tm-vm/display-preview-buffer)
+    ))
+
 (add-hook 'vm-select-message-hook 'tm-vm/preview-current-message)
 (add-hook 'vm-visit-folder-hook   'tm-vm/preview-current-message)
+\f
+;;; tm-vm move commands
+;;;
 
-;; fixed by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-;;     1995/11/14 (cf.[tm-eng:162])
+(defmacro tm-vm/save-window-excursion (&rest forms)
+  (list 'let '((tm-vm/selected-window (selected-window)))
+        (list 'unwind-protect
+              (cons 'progn forms)
+              '(if (window-live-p tm-vm/selected-window)
+                   (select-window tm-vm/selected-window)))))
+
+;;; based on vm-scroll-forward [vm-page.el]
 (defun tm-vm/scroll-forward (&optional arg)
   (interactive "P")
-  (if (not tm-vm/automatic-mime-preview)
-      ;; fixed by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-      ;;       1995/11/17 (cf.[tm-ja:1119])
-      (progn
-       (setq this-command 'vm-scroll-forward)
-       (vm-scroll-forward arg))
-    (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-buf (save-excursion
-                         (set-buffer mail-buffer)
-                         mime::article/preview-buffer))
-          (preview-win (and preview-buf (get-buffer-window preview-buf)))
-          )
-      (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))))
-      ;; fixed by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-      ;;       1995/11/17 (cf.[tm-ja:1119])
-      (setq this-command 'vm-scroll-forward)
-      (let ((vm-inhibit-startup-message t))
-        (vm-scroll-forward arg))
-      (save-excursion
-       (set-buffer summary-buffer)
-       (setq mail-win (get-buffer-window vm-mail-buffer)))
-      ;; fixed by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-      ;;       1995/11/17
-      (if (and mail-win
-              mime::article/preview-buffer
-              (get-buffer mime::article/preview-buffer))
-         (progn
-           (select-window mail-win)
-           (switch-to-buffer mime::article/preview-buffer)
-           (select-window summary-win)))
+  (let ((this-command 'vm-scroll-forward))
+    (if (not (tm-vm/system-state))
+        (vm-scroll-forward arg)
+      (let* ((mp-changed (vm-follow-summary-cursor))
+             (mbuf (or (vm-select-folder-buffer) (current-buffer)))
+             (mwin (vm-get-buffer-window mbuf))
+             (pbuf (and mime::article/preview-buffer
+                        (get-buffer mime::article/preview-buffer)))
+             (pwin (and pbuf (vm-get-buffer-window pbuf)))
+             (was-invisible (and (null mwin) (null pwin)))
+             )
+        ;; now current buffer is folder buffer.
+        (tm-vm/save-window-excursion
+         (if (or mp-changed was-invisible)
+             (vm-display mbuf t '(vm-scroll-forward vm-scroll-backward)
+                         (list this-command 'reading-message)))
+         (tm-vm/display-preview-buffer)
+         (setq mwin (vm-get-buffer-window mbuf)
+               pwin (and pbuf (vm-get-buffer-window pbuf)))
+         (cond
+          (was-invisible
+           nil
+           )
+          ((null pbuf)
+           ;; preview buffer is killed.
+           (tm-vm/preview-current-message)
+           (vm-update-summary-and-mode-line))
+          ((eq (tm-vm/system-state) 'previewing)
+           (tm-vm/show-current-message))
+          (t
+           (select-window pwin)
+           (set-buffer pbuf)
+           (if (pos-visible-in-window-p (point-max) pwin)
+               (tm-vm/next-message)
+             ;; not end of message. scroll preview buffer only.
+             (scroll-up)
+             (tm-vm/howl-if-eom)
+             (set-buffer mbuf))
+           ))))
       )))
 
+;;; based on vm-scroll-backward [vm-page.el]
 (defun tm-vm/scroll-backward (&optional arg)
   (interactive "P")
-  (if (not tm-vm/automatic-mime-preview)
-      ;; fixed by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-      ;;       1995/11/17 (cf.[tm-ja:1119])
-      (progn
-       (setq this-command 'vm-scroll-backward)
-       (vm-scroll-backward arg))
-    (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-buf (save-excursion
-                         (set-buffer mail-buffer)
-                         mime::article/preview-buffer))
-          (preview-win (and preview-buf (get-buffer-window preview-buf)))
-          )
-      (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))))
-      ;; fixed by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-      ;;       1995/11/17 (cf.[tm-ja:1119])
-      (setq this-command 'vm-scroll-backward)
-      (let ((vm-inhibit-startup-message t))
-        (vm-scroll-backward arg))
-      (save-excursion
-       (set-buffer summary-buffer)
-       (setq mail-win (get-buffer-window vm-mail-buffer)))
-      (if (and mail-win
-              mime::article/preview-buffer
-              (get-buffer mime::article/preview-buffer))
-         (progn
-           (select-window mail-win)
-           (switch-to-buffer mime::article/preview-buffer)
-           (select-window summary-win)))
+  (let ((this-command 'vm-scroll-backward))
+    (if (not (tm-vm/system-state))
+        (vm-scroll-backward arg)
+      (let* ((mp-changed (vm-follow-summary-cursor))
+             (mbuf (or (vm-select-folder-buffer) (current-buffer)))
+             (mwin (vm-get-buffer-window mbuf))
+             (pbuf (and mime::article/preview-buffer
+                        (get-buffer mime::article/preview-buffer)))
+             (pwin (and pbuf (vm-get-buffer-window pbuf)))
+             (was-invisible (and (null mwin) (null pwin)))
+             )
+        ;; now current buffer is folder buffer.
+        (if (or mp-changed was-invisible)
+            (vm-display mbuf t '(vm-scroll-forward vm-scroll-backward)
+                        (list this-command 'reading-message)))
+        (tm-vm/save-window-excursion
+         (tm-vm/display-preview-buffer)
+         (setq mwin (vm-get-buffer-window mbuf)
+               pwin (and pbuf (vm-get-buffer-window pbuf)))
+         (cond
+          (was-invisible
+           nil
+           )
+          ((null pbuf)
+           ;; preview buffer is killed.
+           (tm-vm/preview-current-message)
+           (vm-update-summary-and-mode-line))
+          ((eq (tm-vm/system-state) 'previewing)
+           (tm-vm/show-current-message))
+          (t
+           (select-window pwin)
+           (set-buffer pbuf)
+           (if (pos-visible-in-window-p (point-min) pwin)
+               nil
+             ;; scroll preview buffer only.
+             (scroll-down)
+             (set-buffer mbuf))
+           ))))
       )))
 
-(defun tm-vm/over-to-previous-method ()
-  (set-buffer mime::preview/article-buffer)
-  (setq this-command 'vm-previous-message)
-  (let (buf)
-    (save-window-excursion
-      (vm-previous-message 1 nil t)
-      (setq buf
-           (if (and mime::article/preview-buffer
-                    (get-buffer mime::article/preview-buffer))
-               mime::article/preview-buffer
-             (current-buffer)
-             ))
-      )
-    (set-window-buffer (selected-window) buf)
-    ))
-
-(defun tm-vm/over-to-next-method ()
-  (set-buffer mime::preview/article-buffer)
-  (setq this-command 'vm-next-message)
-  (let (buf)
-    (save-window-excursion
-      (vm-next-message 1 nil t)
-      (setq buf
-           (if (and mime::article/preview-buffer
-                    (get-buffer mime::article/preview-buffer)
-                    )
-               mime::article/preview-buffer
-             (current-buffer)
-             ))
-      )
-    (set-window-buffer (selected-window) buf)
-    ))
-
-(set-alist 'mime-viewer/over-to-previous-method-alist
-          'vm-mode 'tm-vm/over-to-previous-method)
-(set-alist 'mime-viewer/over-to-next-method-alist
-          'vm-mode 'tm-vm/over-to-next-method)
-(set-alist 'mime-viewer/over-to-previous-method-alist
-          'vm-virtual-mode 'tm-vm/over-to-previous-method)
-(set-alist 'mime-viewer/over-to-next-method-alist
-          'vm-virtual-mode 'tm-vm/over-to-next-method)
-
-;; 1995/11/16 by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-(defun tm-vm/expunge-folder ()
+;;; based on vm-beginning-of-message [vm-page.el]
+(defun tm-vm/beginning-of-message ()
+  "Moves to the beginning of the current message."
   (interactive)
-  (let* ((summary-buf (or (and (eq major-mode 'vm-summary-mode)
-                              (current-buffer))
-                         vm-summary-buffer))
-        (preview-buf (save-excursion
-                       (set-buffer (save-excursion
-                                     (set-buffer summary-buf)
-                                     vm-mail-buffer))
-                       mime::article/preview-buffer))
-        (preview-win (and preview-buf
-                          (get-buffer-window preview-buf)))
-        (win (selected-window)))
-    
-    (vm-expunge-folder)
-    (if preview-win
-       (save-excursion
-         (set-buffer summary-buf)
-         (set-buffer vm-mail-buffer)
-         (if (eq (point-min) (point-max))
-             (kill-buffer preview-buf))))
-    ))
+  (if (not (tm-vm/system-state))
+      (vm-beginning-of-message)
+    (vm-follow-summary-cursor)
+    (vm-select-folder-buffer)
+    (vm-check-for-killed-summary)
+    (vm-error-if-folder-empty)
+    (let ((mbuf (current-buffer))
+          (pbuf (and mime::article/preview-buffer
+                     (get-buffer mime::article/preview-buffer))))
+      (if (null pbuf)
+          (progn
+            (tm-vm/preview-current-message)
+            (setq pbuf (get-buffer mime::article/preview-buffer))
+            ))
+      (vm-display mbuf t '(vm-beginning-of-message)
+                  '(vm-beginning-of-message reading-message))
+      (tm-vm/display-preview-buffer)
+      (set-buffer pbuf)
+      (tm-vm/save-window-excursion
+       (select-window (vm-get-buffer-window pbuf))
+       (push-mark)
+       (goto-char (point-min))
+       ))))
+
+;;; based on vm-end-of-message [vm-page.el]
+(defun tm-vm/end-of-message ()
+  "Moves to the end of the current message."
+  (interactive)
+  (if (not (tm-vm/system-state))
+      (vm-end-of-message)
+    (vm-follow-summary-cursor)
+    (vm-select-folder-buffer)
+    (vm-check-for-killed-summary)
+    (vm-error-if-folder-empty)
+    (let ((mbuf (current-buffer))
+          (pbuf (and mime::article/preview-buffer
+                     (get-buffer mime::article/preview-buffer))))
+      (if (null pbuf)
+          (progn
+            (tm-vm/preview-current-message)
+            (setq pbuf (get-buffer mime::article/preview-buffer))
+            ))
+      (vm-display mbuf t '(vm-end-of-message)
+                  '(vm-end-of-message reading-message))
+      (tm-vm/display-preview-buffer)
+      (set-buffer pbuf)
+      (tm-vm/save-window-excursion
+       (select-window (vm-get-buffer-window pbuf))
+       (push-mark)
+       (goto-char (point-max))
+       ))))
+
+;;; based on vm-howl-if-eom [vm-page.el]
+(defun tm-vm/howl-if-eom ()
+  (let* ((pbuf (or mime::article/preview-buffer (current-buffer)))
+         (pwin (and (vm-get-visible-buffer-window pbuf))))
+    (and pwin
+        (save-excursion
+          (save-window-excursion
+            (condition-case ()
+                (let ((next-screen-context-lines 0))
+                  (select-window pwin)
+                  (save-excursion
+                    (save-window-excursion
+                      (let ((scroll-in-place-replace-original nil))
+                        (scroll-up))))
+                  nil)
+              (error t))))
+         (tm-vm/emit-eom-blurb)
+         )))
+
+;;; based on vm-emit-eom-blurb [vm-page.el]
+(defun tm-vm/emit-eom-blurb ()
+  (save-excursion
+    (if mime::preview/article-buffer
+        (set-buffer mime::preview/article-buffer))
+    (vm-emit-eom-blurb)))
 
-;; fixed by Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-;;     1995/11/14 (cf. [tm-eng:162])
+;;; based on vm-quit [vm-folder.el]
 (defun tm-vm/quit ()
   (interactive)
   (save-excursion
@@ -398,48 +486,51 @@ tm-vm uses `vm-select-message-hook', use this hook instead.")
     (if (and mime::article/preview-buffer
             (get-buffer mime::article/preview-buffer))
        (kill-buffer mime::article/preview-buffer)))
-  (vm-quit)
-  )
+  (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-expunge-folder
-                          'tm-vm/expunge-folder vm-mode-map)
+(substitute-key-definition 'vm-beginning-of-message
+                           'tm-vm/beginning-of-message vm-mode-map)
+(substitute-key-definition 'vm-end-of-message
+                           'tm-vm/end-of-message vm-mode-map)
 (substitute-key-definition 'vm-quit
                           'tm-vm/quit vm-mode-map)
-;; end
-
 
-(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)
-      )
-    ))
+;;; based on vm-next-message [vm-motion.el]                        
+(defun tm-vm/next-message ()
+  (set-buffer mime::preview/article-buffer)
+  (let ((this-command 'vm-next-message)
+        (owin (selected-window))
+        (vm-preview-lines nil)
+        )
+    (vm-next-message 1 nil t)
+    (if (window-live-p owin)
+        (select-window owin))))
+
+;;; based on vm-previous-message [vm-motion.el]
+(defun tm-vm/previous-message ()
+  (set-buffer mime::preview/article-buffer)
+  (let ((this-command 'vm-previous-message)
+        (owin (selected-window))
+        (vm-preview-lines nil)
+        )
+    (vm-previous-message 1 nil t)
+    (if (window-live-p owin)
+        (select-window owin))))
 
+(set-alist 'mime-viewer/over-to-previous-method-alist
+          'vm-mode 'tm-vm/previous-message)
+(set-alist 'mime-viewer/over-to-next-method-alist
+          'vm-mode 'tm-vm/next-message)
+(set-alist 'mime-viewer/over-to-previous-method-alist
+          'vm-virtual-mode 'tm-vm/previous-message)
+(set-alist 'mime-viewer/over-to-next-method-alist
+          'vm-virtual-mode 'tm-vm/next-message)
 
+\f
 ;;; @ for tm-view
 ;;;
 
@@ -447,12 +538,20 @@ tm-vm uses `vm-select-message-hook', use this hook instead.")
   "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)))
+      (vm-undisplay-buffer mime/output-buffer-name))
+  (if (and tm-vm/automatic-mime-preview
+           (save-excursion
+             (set-buffer mime::preview/article-buffer)
+             vm-summary-buffer))
+      (switch-to-buffer mime::preview/mother-buffer)
+    (mime-viewer/kill-buffer)
+    (vm-select-folder-buffer)
+    (setq tm-vm/system-state nil))
+  (vm-display (current-buffer) t (list this-command)
+              (list this-command 'reading-message))
+  (tm-vm/display-preview-buffer)
+  )
 
 (defun tm-vm/view-message ()
   "Decode and view MIME encoded message, under VM."
@@ -643,15 +742,18 @@ only marked messages will be put into the digest."
     (run-hooks 'tm-vm/send-digest-hook)
     (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)
 
+;;; @@ for message/rfc822
+;;;
+\f
+
+;;; @@ setting
+;;;
+
 (defvar tm-vm/use-xemacs-popup-menu t)
 
 ;;; modified by Steven L. Baur <steve@miranova.com>
@@ -693,41 +795,25 @@ only marked messages will be put into the digest."
 ;;;
 
 (call-after-loaded
- 'bbdb-vm
+ 'bbdb
  (function
   (lambda ()
+    (require 'bbdb-vm)
+    (require 'tm-bbdb)
     (or (fboundp 'tm:bbdb/vm-update-record)
-       (fset 'tm:bbdb/vm-update-record
-             (symbol-function 'bbdb/vm-update-record))
-       )
+        (fset 'tm:bbdb/vm-update-record
+              (symbol-function 'bbdb/vm-update-record)))
     (defun bbdb/vm-update-record (&optional offer-to-create)
       (vm-select-folder-buffer)
-      (let ((vm-mail-buffer
-            (if (and mime::article/preview-buffer
-                     (get-buffer mime::article/preview-buffer))
-                mime::article/preview-buffer
-              (current-buffer)
-              ))
-           (bbdb/vm-update-record-recursive
-            (boundp 'bbdb/vm-update-record-recursive))
-           bbdb/vm-update-record-recursive ret)
-       (let ((bbdb/vm-update-record-answer
-              (if (boundp 'bbdb/vm-update-record-answer)
-                  (setq bbdb/vm-update-record-answer
-                        (or bbdb/vm-update-record-answer
-                            (tm:bbdb/vm-update-record)
-                            ))
-                (setq ret (tm:bbdb/vm-update-record))
-                nil)))
-         (or bbdb/vm-update-record-answer ret)
-         )))
-    (defun tm-vm/bbdb-update-record (&optional offer-to-create)
-      (let ((vm-mail-buffer (current-buffer)))
-       (tm:bbdb/vm-update-record offer-to-create)
-       ))
+      (if (and (tm-vm/system-state)
+               mime::article/preview-buffer
+               (get-buffer mime::article/preview-buffer))
+          (tm-bbdb/update-record offer-to-create)
+        (tm:bbdb/vm-update-record offer-to-create)
+        ))
     (remove-hook 'vm-select-message-hook 'bbdb/vm-update-record)
     (remove-hook 'vm-show-message-hook 'bbdb/vm-update-record)
-    (add-hook 'tm-vm/select-message-hook 'tm-vm/bbdb-update-record)
+    (add-hook 'tm-vm/select-message-hook 'bbdb/vm-update-record)
     )))