8c8ab9b0f66143a0772479fefbe4f4b1f91c1d36
[elisp/semi.git] / semi-setup.el
1 ;;; semi-setup.el --- setup file for MIME-View.
2
3 ;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: semi-setup.el,v 0.7 1997-02-28 04:49:40 tmorioka Exp $
7 ;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
8
9 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
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 GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 (require 'mime-def)
29
30 (eval-when-compile
31   (require 'mime-play)
32   )
33
34
35 ;;; @ for mime-view
36 ;;;
37
38 (call-after-loaded
39  'mime-view
40  (function
41   (lambda ()
42     ;; for message/partial
43     (require 'mime-partial)
44     
45     ;; for anonymous ftp
46     (set-atype 'mime/content-decoding-condition
47                '((type . "message/external-body")
48                  ("access-type" . "anon-ftp")
49                  (method . mime-article/decode-message/external-ftp)
50                  ))
51     (autoload 'mime-article/decode-message/external-ftp "tm-ftp")
52     
53     ;; for LaTeX
54     (set-atype 'mime/content-decoding-condition
55                '((type . "text/x-latex")
56                  (method . mime/decode-text/latex)
57                  ))
58     (set-atype 'mime/content-decoding-condition
59                '((type . "application/x-latex")
60                  (method . mime/decode-text/latex)
61                  ))
62     ;;(set-atype 'mime/content-decoding-condition
63     ;;  '((type . "application/octet-stream")
64     ;;            ("type" . "latex")
65     ;;            (method . mime/decode-text/latex)
66     ;;            ))
67     (autoload 'mime/decode-text/latex "tm-latex")
68     )))
69
70
71 (defvar running-xemacs (string-match "XEmacs" emacs-version))
72
73 ;; for image/* and X-Face
74 (defvar mime-setup-enable-inline-image
75   (and window-system
76        (or running-xemacs
77            (and (featurep 'mule)(module-installed-p 'bitmap))
78            ))
79   "*If it is non-nil, semi-setup sets up to use mime-image.")
80
81 (if mime-setup-enable-inline-image
82     (call-after-loaded 'mime-view
83                        (function
84                         (lambda ()
85                           (require 'mime-image)
86                           )))
87   )
88
89
90 (defvar mime-setup-enable-pgp
91   (module-installed-p 'mailcrypt)
92   "*If it is non-nil, semi-setup sets uf to use tm-pgp.")
93
94 ;; for PGP
95 (if mime-setup-enable-pgp
96     (call-after-loaded 'mime-view
97                        (function
98                         (lambda ()
99                           (require 'tm-pgp)
100                           )))
101   )
102
103
104 ;;; @ for mh-e
105 ;;;
106
107 (defun semi-setup-load-emh ()
108   (require 'emh)
109   )
110
111 (call-after-loaded 'mh-e 'semi-setup-load-emh 'mh-folder-mode-hook)
112 (or (featurep 'mh-e)
113     (add-hook 'mh-letter-mode-hook 'semi-setup-load-emh)
114     )
115
116
117 ;;; @ for Gnus
118 ;;;
119   
120 (defun semi-setup-load-gnus ()
121   (let (gnus-load-hook)
122     (require 'gnus-mime)
123     ))
124
125 (add-hook 'gnus-load-hook 'semi-setup-load-gnus)
126
127
128 ;;; @ end
129 ;;;
130
131 (provide 'semi-setup)
132
133 ;;; semi-setup.el ends here