tm 7.80.
[elisp/tm.git] / tm-setup.el
1 ;;; tm-setup.el --- setup file for tm viewer.
2
3 ;; Copyright (C) 1994,1995,1996 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: tm-setup.el,v 7.7 1996/08/31 14:39:06 morioka Exp $
7 ;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
8
9 ;; This file is part of tm (Tools for MIME).
10
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
15
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with This program; see the file COPYING.  If not, write to
23 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 (require 'tl-misc)
29
30
31 ;;; @ for tm-view
32 ;;;
33
34 (call-after-loaded
35  'tm-view
36  (function
37   (lambda ()
38     ;; for message/partial
39     (require 'tm-partial)
40     
41     ;; for anonymous ftp
42     (set-atype 'mime/content-decoding-condition
43                '((type . "message/external-body")
44                  ("access-type" . "anon-ftp")
45                  (method . mime/decode-message/external-ftp)
46                  ))
47     (autoload 'mime/decode-message/external-ftp "tm-ftp")
48         
49     ;; for LaTeX
50     (set-atype 'mime/content-decoding-condition
51                '((type . "text/x-latex")
52                  (method . mime/decode-text/latex)
53                  ))
54     (set-atype 'mime/content-decoding-condition
55                '((type . "application/x-latex")
56                  (method . mime/decode-text/latex)
57                  ))
58     ;;(set-atype 'mime/content-decoding-condition
59     ;;  '((type . "application/octet-stream")
60     ;;            ("type" . "latex")
61     ;;            (method . mime/decode-text/latex)
62     ;;            ))
63     (autoload 'mime/decode-text/latex "tm-latex")
64     )))
65
66 ;; for image/* and X-Face
67 (if running-xemacs
68     (call-after-loaded 'tm-view
69                        (function
70                         (lambda ()
71                           (require 'tm-image)
72                           )))
73   )
74
75 ;; for PGP
76 (if (module-installed-p 'mailcrypt)
77     (call-after-loaded 'tm-view
78                        (function
79                         (lambda ()
80                           (require 'tm-pgp)
81                           )))
82   )
83
84
85 ;;; @ for RMAIL
86 ;;;
87
88 (call-after-loaded 'rmail
89                    (function
90                     (lambda ()
91                       (require 'tm-rmail)
92                       ))
93                    'rmail-mode-hook)
94
95
96 ;;; @ for mh-e
97 ;;;
98
99 (let ((le (function
100            (lambda ()
101              (require 'tm-mh-e)
102              ))
103           ))
104   (call-after-loaded 'mh-e le 'mh-folder-mode-hook)
105   (if (not (featurep 'mh-e))
106       (add-hook 'mh-letter-mode-hook le)
107     ))
108
109
110 ;;; @ for GNUS and Gnus
111 ;;;
112
113 (if (featurep 'gnus)
114     (if (boundp 'gnus-load-hook)
115         (require 'gnus-mime)
116       (require 'tm-gnus)
117       )
118   ;; for GNUS
119   (defvar tm-setup/use-gnusutil nil)
120   
121   (defun tm-setup/load-GNUS ()
122     (require 'tm-gnus)
123     )
124   
125   (if (and (boundp 'MULE) tm-setup/use-gnusutil)
126       (progn
127         (add-hook 'gnus-Group-mode-hook (function gnusutil-initialize))
128         (add-hook 'gnus-group-mode-hook (function gnusutil-initialize))
129         (autoload 'gnusutil-initialize "gnusutil")
130         (autoload 'gnusutil-add-group "gnusutil")
131         (add-hook 'gnusutil-initialize-hook 'tm-setup/load-GNUS)
132         )
133     (add-hook 'gnus-Startup-hook 'tm-setup/load-GNUS 'append)
134     (add-hook 'gnus-startup-hook 'tm-setup/load-GNUS 'append)
135     )
136   
137   ;; for Gnus
138   (defun tm-setup/load-gnus ()
139     (let (gnus-load-hook)
140       (remove-hook 'gnus-startup-hook 'tm-setup/load-GNUS)
141       (require 'gnus-mime)
142       ))
143   
144   (add-hook 'gnus-load-hook 'tm-setup/load-gnus)
145   )
146
147
148 ;;; @ end
149 ;;;
150
151 (provide 'tm-setup)
152
153 ;;; tm-setup.el ends here