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